Overview
Webhooks send HTTP POST notifications when task status changes, eliminating polling.Webhooks are optional. You can always use polling instead.
Setup
IncludecallBackUrl when creating a task:
Webhook Payload
All webhook payloads use the following envelope format:Success
Failure
Payload Fields
| Field | Type | Description |
|---|---|---|
data.taskId | string | Unique task identifier |
data.orderId | string | Order identifier |
data.model | string | Model used for generation (e.g. seedance-20) |
data.state | string | "success" or "fail" |
data.creditsUsed | number | Credits consumed for this task |
data.output | array | null | Array of output objects on success, null on failure |
data.output[].url | string | URL of the generated video |
data.output[].width | number | Video width in pixels |
data.output[].height | number | Video height in pixels |
data.error | object | null | Error details on failure, null on success |
data.error.code | string | Error code (e.g. "2038", "4011", "500" for generic errors). See Task Error Messages. |
data.error.message | string | Human-readable error message. See Task Error Messages. |
data.createTime | number | Task creation timestamp (ms) |
data.completeTime | number | null | Task completion timestamp (ms), null if failed before completion |
data.updateTime | number | Last update timestamp (ms) |
The webhook payload format matches the Get Task Status response — same fields, same structure. You can use the same parsing logic for both.
Webhook Handler Examples
Best Practices
- Always respond 200 immediately — process asynchronously if needed
- Implement idempotency — use
taskIdto deduplicate (webhooks may be delivered multiple times) - Use HTTPS for webhook endpoints
- Implement fallback polling for critical tasks — webhooks are best-effort