Skip to content

Integration guide

Completion notifications

Receive one task completion notice and verify its signature.

Set the account default with PUT /v1/webhook, or pass webhookUrl in an individual task. Notification URLs must use HTTPS. Retrieve the account signingSecret with GET /v1/webhook.

Each task sends its own logical notification:

{
"event": "task.finished",
"deliveryRevision": 1,
"task": {
"taskId": "00000000-0000-4000-8000-000000000001",
"state": "completed",
"content": "Answer content",
"revision": 1
}
}

Calculate HMAC-SHA256 over the raw request bytes with the notification secret. Return HTTP 2xx promptly. Network retries may repeat a delivery, so deduplicate by X-Douzhi-Delivery.

Call POST /v1/webhook/signing-secret/rotation to rotate the secret. New notifications use the new secret immediately.

For a large result, task.resultOmitted is true; retrieve the full content with the task query endpoint.

When the result is not omitted, task uses the same structure as the single-task response, including content, sources, products, videos, media, reasoningProcess, and searchProcess. Rich-media arrays share one global position sequence.