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

# Webhooks

> 接收异步任务完成回调。

在 API Key 或请求允许的情况下，异步媒体任务可以配置 callback URL。

当回调发送失败时，平台会根据配置进行重试。

回调内容与任务详情结构一致。`result` 按任务类型不同：图片任务的地址在
`result.data[0].url`，视频/音频任务的地址在 `result.video_url` /
`result.audio_url`（并同时列在 `result.urls[]`）。

```json theme={null}
{
  "task_id": "task_123",
  "status": "completed",
  "model": "seedance-2.0",
  "type": "video",
  "result": {
    "status": "completed",
    "video_url": "https://.../video.mp4",
    "urls": ["https://.../video.mp4"]
  }
}
```

## 建议

对于高价值工作流，收到 webhook 后仍建议通过 `/v1/tasks/{task_id}` 查询一次最终状态，再执行后续业务逻辑。
