<span id="查询导入任务统计"></span>

# Get import task statistics

<span id="查看导入任务统计"></span>

Return import task statistics visible to the caller in the current workspace. Results include the total task count and counts by state, without reading individual task details.

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

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

## Before you call this API

Prepare a [Personal access token](../../../../../guides/genesis/api-keys.md#creating-and-managing-personal-access-tokens) with access to the target workspace and the [Target workspace ID](../../../../../guides/ai-studio/resource-center/workspace.md#复制工作区-id).

<span id="请求参数"></span>

## Request parameters


Replace <code>$AI_STUDIO_API_KEY</code> and <code>$WORKSPACE_ID</code> with actual values.

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

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

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

This API has no path or query parameters.

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


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

## Successful response

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

```json
{
  "total": 22,
  "running": 10,
  "waiting": 8,
  "failed": 4
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `data.total` | integer | Total import tasks visible to the current caller. |
| `data.running` | integer | Number of running tasks. |
| `data.waiting` | integer | Number of tasks waiting for processing, including paused tasks. |
| `data.failed` | integer | Number of failed tasks. |

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