> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Digital Human 任务查询 API

> Digital Human 集成指南 - Ace Data Cloud

使用 `POST /digital-human/tasks` 查询自己的视频或声音任务。先通过 [视频生成指南](https://platform.acedata.cloud/documents/digitalhuman-videos-integration) 创建任务，再保存返回的 `task_id`。

## 查询最终结果

```bash theme={null}
curl --request POST 'https://api.acedata.cloud/digital-human/tasks' \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"task_id":"YOUR_TASK_ID"}'
```

### 处理中响应 JSON

```json theme={null}
{
  "success": true,
  "task_id": "YOUR_TASK_ID",
  "trace_id": "YOUR_TRACE_ID",
  "state": "pending",
  "progress": 0
}
```

### 完成响应 JSON

```json theme={null}
{
  "success": true,
  "task_id": "task_...",
  "trace_id": "...",
  "state": "succeed",
  "progress": 100,
  "video_url": "https://cdn.acedata.cloud/634d760216.mp4",
  "duration": 17.2,
  "width": 1280,
  "height": 720
}
```

省略 `action` 时返回平铺任务结果。读取 `state` 和 `progress`，在 `state=succeed` 后读取视频的 `video_url` 或声音的 `voice_id`。`state=failed` 表示执行失败，读取 `error` 并结束轮询。任务查询的 `success` 描述查询是否成功，生成是否完成由任务状态决定。

## 详细记录与历史

查询详细记录时提交 `{"action":"retrieve","id":"YOUR_TASK_ID"}`，原始请求位于 `request`，输出位于 `response`。也可以使用 `task_id` 字段代替 `id`。

读取最近历史时提交 `{"action":"retrieve_batch","limit":20}`，可按 `type`、`created_at_min` 和 `created_at_max` 筛选。结果包含 `count` 与 `items`。这里的 `retrieve_batch` 返回最近任务历史，指定若干任务 ID 时逐个查询即可。

删除操作使用 `action=delete` 和单个 ID，执行前确认确实需要删除这条任务记录。完整参数与响应字段见 [任务 API 参考](https://platform.acedata.cloud/documents/digitalhuman-tasks)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.