Webhook
Gửi lại lần giao
Gửi lại sự kiện của một lần giao.
https://api.sangtao.ai/v2/webhooks/{id}/deliveries/{deliveryId}/retryXác thực
X-Api-Keystring · headerbắt buộcAPI key của bạn, tạo ở trang API key trong tài khoản.
Tham số đường dẫn
idstringbắt buộcID trong đường dẫn.
deliveryIdstringbắt buộcdeliveryId trong đường dẫn.
Xếp lại cùng sự kiện vào hàng gửi, bất kể lần giao đang ở trạng thái nào: lần giao mới (dlv_… mới), cùng mã sự kiện — nên khử trùng vẫn đúng.
Response
idstringbắt buộcLần giao, dlv_…
eventIdstringbắt buộcSự kiện, evt_… — giữ nguyên khi gửi lại
eventTypestringbắt buộcVí dụ image.completed
statusstringbắt buộccanceled: endpoint bị xoá hoặc tắt trước khi gửi
Giá trị có thể:
pendingsucceededfailedcanceledattemptCountnumberbắt buộcSố lần đã thử
lastHttpStatusnumber | nullMã URL của bạn trả lần gần nhất
lastErrorstring | nullLý do lần thử gần nhất hỏng
nextAttemptAtstring | nullLần thử lại tiếp theo. Chỉ có khi pending
createdAtstringbắt buộcLúc lần giao vào hàng đợi
completedAtstring | nullLúc kết thúc: succeeded, failed hoặc canceled
Trả 202, status pending.
Mã lỗi
| Mã | errorCode | Khi nào |
|---|---|---|
| 404 | WEBHOOK_NOT_FOUND | Không có endpoint nào của bạn với id này |
| 404 | DELIVERY_NOT_FOUND | Không có lần giao này ở endpoint đó |
| 409 | WEBHOOK_DISABLED | Endpoint đang tắt — PATCH enabled: true trước |
/webhooks/{id}/deliveries/{deliveryId}/retrycurl -X POST "https://api.sangtao.ai/v2/webhooks/whk_4nP8rT2xK/deliveries/dlv_5Vt1kRm9P/retry" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": {
"id": "dlv_9Rx3qTa6M",
"eventId": "evt_8Kq2mXa7T",
"eventType": "image.completed",
"status": "pending",
"attemptCount": 0,
"lastHttpStatus": null,
"lastError": null,
"nextAttemptAt": "2026-11-10T10:00:00Z",
"createdAt": "2026-11-10T10:00:00Z",
"completedAt": null
}
}/webhooks/{id}/deliveries/{deliveryId}/retrycurl -X POST "https://api.sangtao.ai/v2/webhooks/whk_4nP8rT2xK/deliveries/dlv_5Vt1kRm9P/retry" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": {
"id": "dlv_9Rx3qTa6M",
"eventId": "evt_8Kq2mXa7T",
"eventType": "image.completed",
"status": "pending",
"attemptCount": 0,
"lastHttpStatus": null,
"lastError": null,
"nextAttemptAt": "2026-11-10T10:00:00Z",
"createdAt": "2026-11-10T10:00:00Z",
"completedAt": null
}
}