Webhooks
Get a delivery
One delivery: every attempt and the body sent.
https://api.sangtao.ai/v2/webhooks/deliveries/{deliveryId}Authorization
X-Api-Keystring · headerrequiredYour API key, from the API keys page of your account.
Path parameters
deliveryIdstringrequiredThe deliveryId in the path.
Response
idstringrequiredThe delivery, dlv_…
eventIdstringrequiredThe event, evt_… — the same on a retry
eventTypestringrequirede.g. image.completed
statusstringrequiredcanceled: the endpoint was deleted or turned off before it went
Available options:
pendingsucceededfailedcanceledattemptCountnumberrequiredAttempts so far
lastHttpStatusnumber | nullWhat your URL answered last
lastErrorstring | nullWhy the last attempt failed
nextAttemptAtstring | nullThe next retry. Only while pending
createdAtstringrequiredWhen the delivery was queued
completedAtstring | nullWhen it ended: succeeded, failed or canceled
attemptsobject[]requiredEvery attempt, oldest first
Show child attributesHide child attributes
atstringrequiredWhen
httpStatusnumber | nullWhat your URL answered. null: not reached
durationMsnumberrequiredHow long it took
responseSnippetstring | nullThe first 1 KB of your URL’s answer
errorstring | nullA network error or timeout
payloadobjectrequiredThe body that was sent, parsed
bodystringrequiredThe body exactly as sent. Check a signature against this, not against payload
targetUrlstringThe webhookUrl it went to. Only for way B (a delivery for a request’s webhookUrl)
Errors
| Status | errorCode | When |
|---|---|---|
| 404 | DELIVERY_NOT_FOUND | No delivery of yours with this id |
/webhooks/deliveries/{deliveryId}curl "https://api.sangtao.ai/v2/webhooks/deliveries/dlv_5Vt1kRm9P" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": {
"id": "dlv_5Vt1kRm9P",
"eventId": "evt_8Kq2mXa7T",
"eventType": "image.completed",
"status": "succeeded",
"attemptCount": 1,
"lastHttpStatus": 200,
"lastError": null,
"nextAttemptAt": null,
"createdAt": "2026-11-10T09:43:31Z",
"completedAt": "2026-11-10T09:43:32Z",
"attempts": [
{
"at": "2026-11-10T09:43:32Z",
"httpStatus": 200,
"durationMs": 143,
"responseSnippet": "ok",
"error": null
}
],
"payload": {
"id": "evt_8Kq2mXa7T",
"type": "image.completed",
"createdAt": "2026-11-10T09:43:31Z",
"apiVersion": "v2",
"data": {
"jobId": "acff47cbfacf4e27bbc08770c9ea246d",
"status": "complete",
"source": "api"
}
},
"body": "{\"id\":\"evt_8Kq2mXa7T\",\"type\":\"image.completed\",\"createdAt\":\"2026-11-10T09:43:31Z\",\"apiVersion\":\"v2\",\"data\":{\"jobId\":\"acff47cbfacf4e27bbc08770c9ea246d\",\"status\":\"complete\",\"source\":\"api\"}}"
}
}/webhooks/deliveries/{deliveryId}curl "https://api.sangtao.ai/v2/webhooks/deliveries/dlv_5Vt1kRm9P" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": {
"id": "dlv_5Vt1kRm9P",
"eventId": "evt_8Kq2mXa7T",
"eventType": "image.completed",
"status": "succeeded",
"attemptCount": 1,
"lastHttpStatus": 200,
"lastError": null,
"nextAttemptAt": null,
"createdAt": "2026-11-10T09:43:31Z",
"completedAt": "2026-11-10T09:43:32Z",
"attempts": [
{
"at": "2026-11-10T09:43:32Z",
"httpStatus": 200,
"durationMs": 143,
"responseSnippet": "ok",
"error": null
}
],
"payload": {
"id": "evt_8Kq2mXa7T",
"type": "image.completed",
"createdAt": "2026-11-10T09:43:31Z",
"apiVersion": "v2",
"data": {
"jobId": "acff47cbfacf4e27bbc08770c9ea246d",
"status": "complete",
"source": "api"
}
},
"body": "{\"id\":\"evt_8Kq2mXa7T\",\"type\":\"image.completed\",\"createdAt\":\"2026-11-10T09:43:31Z\",\"apiVersion\":\"v2\",\"data\":{\"jobId\":\"acff47cbfacf4e27bbc08770c9ea246d\",\"status\":\"complete\",\"source\":\"api\"}}"
}
}