Webhook
Lịch sử giao
Những gì đã gửi tới endpoint và kết quả từng lần giao.
https://api.sangtao.ai/v2/webhooks/{id}/deliveriesXá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.
Các lần giao tới endpoint này trong 30 ngày, mới nhất trước.
Tham số query
statusstringChỉ trạng thái này
Giá trị có thể:
pendingsucceededfailedcanceledtypestringChỉ loại sự kiện này
Giá trị có thể:
image.completedimage.failedvideo.completedvideo.failedpost.publishedpost.failedsocial_account.needs_attentionwebhook.testsincestringTạo từ lúc này (ISO 8601)
untilstringTạo tới lúc này (ISO 8601)
pagenumberBắt đầu từ 1
pageSizenumberMặc định 20, tối đa 100. Tổng số ở header X-Total-Count
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
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 |
/webhooks/{id}/deliveriescurl "https://api.sangtao.ai/v2/webhooks/whk_4nP8rT2xK/deliveries?status=failed&page=1&pageSize=20" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": [
{
"id": "dlv_5Vt1kRm9P",
"eventId": "evt_8Kq2mXa7T",
"eventType": "image.completed",
"status": "failed",
"attemptCount": 8,
"lastHttpStatus": 500,
"lastError": "HTTP 500",
"nextAttemptAt": null,
"createdAt": "2026-11-10T09:43:31Z",
"completedAt": "2026-11-12T00:00:00Z"
}
]
}/webhooks/{id}/deliveriescurl "https://api.sangtao.ai/v2/webhooks/whk_4nP8rT2xK/deliveries?status=failed&page=1&pageSize=20" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": [
{
"id": "dlv_5Vt1kRm9P",
"eventId": "evt_8Kq2mXa7T",
"eventType": "image.completed",
"status": "failed",
"attemptCount": 8,
"lastHttpStatus": 500,
"lastError": "HTTP 500",
"nextAttemptAt": null,
"createdAt": "2026-11-10T09:43:31Z",
"completedAt": "2026-11-12T00:00:00Z"
}
]
}