<span id="查询工作区导出任务统计"></span>

# Get workspace export task statistics

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read total, pending, running, and failed export-task counts in the current workspace.

```text
GET https://api.moi.matrixorigin.cn/v5/export/task/stats
```

<span id="调用前准备"></span>

## Before you call this API

Prepare current Workspace credentials and resource privileges. See [Shared information](objects.md) for variables, import files, and operation boundaries.

<span id="请求示例"></span>

## Request example

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl -X GET "https://api.moi.matrixorigin.cn/v5/export/task/stats" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::::
:::::{tab-item} Parameters

No task ID, list filters, or pagination parameters. Counts group by task state and exclude records whose lifecycle is not ready or is deleting. total includes completed tasks, so it need not equal pending+running+failed. This current snapshot does not replace checking individual task states, failed files, or target data.

No query parameters; select the workspace through headers.
:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "total": 22,
    "running": 10,
    "pending": 6,
    "failed": 4
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | Response information. |
| `data` | object | Current operation result. Single-object imports return a knowledge base object directly. |
| `data.total` | integer | Total tasks in current scope, including completed tasks. |
| `data.running` | integer | Running task count. |
| `data.pending` | integer | Pending task count. |
| `data.failed` | integer | Failed task count. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error response

Check HTTP status, business code, and target resources separately. Retain request information and read again according to [Errors and environments](objects.md#错误与环境).
