# Query task details

Read an export task and its file statistics.

```text
POST https://moi.matrixorigin.cn/newmoi/export/task/info
```

## Preparation before calling

First [Query task list](list-export-tasks.md) to confirm the export tasks you want to view. Prepare a personal access token with access to the target workspace, the target workspace ID, and the export task ID.

The example below uses:

- `$AI_STUDIO_API_KEY`: The actual personal access token, passed through the `X-API-Key` Header.
- `$WORKSPACE_ID`: Target workspace ID, passed through `X-Workspace-ID` Header.
- `$TASK_ID`: The export task ID to be viewed, fill in the `id` field of the request body.

## Request example

```bash
curl -X POST "https://moi.matrixorigin.cn/newmoi/export/task/info" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "'$TASK_ID'"
  }'
```

## Request body

| Field | Type | Is it required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The export task ID to be queried. |

`[]` after a type denotes an array. `[]` in a field path denotes each item in an array.

## Successful response

Returns `200` on success. `data` contains task definition and file statistics; task `status` is `2` only means that the task has been completed, and `file_stats.failed` should still be used to determine whether there is a failed file.

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": "export-task-123",
    "name": "export-to-s3",
    "creator": "user-001",
    "connector_name": "target-s3",
    "type": 5,
    "status": 2,
    "config": {"s3_config": {"path": "exports/", "need_compress": false, "compress_method": ""}},
    "create_time": "2026-08-18T10:00:00Z",
    "end_time": "2026-08-18T10:02:00Z",
    "file_stats": {"total": 4, "pending": 0, "running": 0, "failed": 1, "completed": 3},
    "fileSuccess": 3,
    "fileFail": 1
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |
| `data.id` | string | Task ID. |
| `data.name` | string | Task name. |
| `data.creator` | string | Creator ID. |
| `data.connector_name` | string | Target connector name. |
| `data.type` | integer | Export target category: `3` for MatrixOne, `4` for OSS, `5` for standard S3. The page generates this value based on the selected target. |
| `data.status` | integer | Task status: `0` pending, `1` running, `2` completed, `3` failed. |
| `data.config` | object | The export configuration saved when created. Its fields are as follows. |
| `data.config.locale` | string | The language identifier used when saving the task. |
| `data.config.merge_title_to_text` | boolean | The title merge text settings saved by the task. |
| `data.config.s3_config` | object or null | The target configuration for object storage tasks; `null` or not returned for non-object storage tasks. |
| `data.config.s3_config.path` | string | The export path within the connector bucket. |
| `data.config.s3_config.need_compress` | boolean | Whether to compress the exported content. |
| `data.config.s3_config.compress_method` | string | Compression method. |
| `data.config.mo_config` | object or null | Target table configuration for MatrixOne tasks; `null` or not returned for non-MatrixOne tasks. |
| `data.config.mo_config.database_name` | string | Target database name. |
| `data.config.mo_config.table_name` | string | Target table name. |
| `data.config.mo_config.new_table` | boolean | Whether to create a new target table. |
| `data.config.mo_config.duplicated_strategy` | integer | Duplicate data processing method: `1` overwrite, `2` skip, `3` retain. |
| `data.config.mo_config.column` | object | Export column and column mapping configuration. |
| `data.config.mo_config.column.export_column` | object[] | Export column mapping list. |
| `data.config.mo_config.column.export_column[].source_column` | string | The source column name in the processing result. |
| `data.config.mo_config.column.export_column[].mapping_column` | string | Column name in the target table. |
| `data.config.mo_config.column.combine_column` | string[] | The source column for merging processing; it is an empty array when not combined. |
| `data.create_time` | string or null | Creation time. |
| `data.end_time` | string or null | End time; `null` if not ended. |
| `data.file_stats` | object | Summary of file count. |
| `data.file_stats.total` | integer | The total number of files in the task. |
| `data.file_stats.pending` | integer | The number of files to be processed. |
| `data.file_stats.running` | integer | Number of files being exported. |
| `data.file_stats.failed` | integer | The number of files that failed to export. |
| `data.file_stats.completed` | integer | The number of files that have been successfully completed. |
| `data.fileSuccess` | integer | The number of files that have been successfully exported. |
| `data.fileFail` | integer | The number of files that failed to export. |

## Error response

```json
{
  "code": "ErrServer",
  "msg": "Internal server error",
  "data": null
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 24 36 28

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - —
  - The request body cannot be parsed; this compatible path returns an `error` field.
  - Pass in a JSON object containing `id`.
* - `200`
  - `ErrServer`
  - The task does not exist or the details cannot be read.
  - Check the task ID and try again.
* - `403`
  - `ErrForbidden`
  - The current identity does not have permission to read the task.
  - Request that read permission be granted to the export task.
```

## Follow-up operations

Use task ID [Query export files](list-export-task-files.md) to view file-level results; when progress summary is needed, [Query task status](get-export-task-state.md).
