sangtao.ai
API key

Webhook

Lịch sử giao

Những gì đã gửi tới endpoint và kết quả từng lần giao.

GEThttps://api.sangtao.ai/v2/webhooks/{id}/deliveries

Xác thực

  • X-Api-Keystring · headerbắt buộc

    API key của bạn, tạo ở trang API key trong tài khoản.

Tham số đường dẫn

  • idstringbắt buộc

    ID 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

  • statusstring

    Chỉ trạng thái này

    Giá trị có thể:pendingsucceededfailedcanceled

  • typestring

    Chỉ loại sự kiện này

    Giá trị có thể:image.completedimage.failedvideo.completedvideo.failedpost.publishedpost.failedsocial_account.needs_attentionwebhook.test

  • sincestring

    Tạo từ lúc này (ISO 8601)

  • untilstring

    Tạo tới lúc này (ISO 8601)

  • pagenumber

    Bắt đầu từ 1

  • pageSizenumber

    Mặc định 20, tối đa 100. Tổng số ở header X-Total-Count

Response

  • idstringbắt buộc

    Lần giao, dlv_…

  • eventIdstringbắt buộc

    Sự kiện, evt_… — giữ nguyên khi gửi lại

  • eventTypestringbắt buộc

    Ví dụ image.completed

  • statusstringbắt buộc

    canceled: endpoint bị xoá hoặc tắt trước khi gửi

    Giá trị có thể:pendingsucceededfailedcanceled

  • attemptCountnumberbắt buộc

    Số lần đã thử

  • lastHttpStatusnumber | null

    Mã URL của bạn trả lần gần nhất

  • lastErrorstring | null

    Lý do lần thử gần nhất hỏng

  • nextAttemptAtstring | null

    Lần thử lại tiếp theo. Chỉ có khi pending

  • createdAtstringbắt buộc

    Lúc lần giao vào hàng đợi

  • completedAtstring | null

    Lúc kết thúc: succeeded, failed hoặc canceled

Mã lỗi

MãerrorCodeKhi nào
404WEBHOOK_NOT_FOUNDKhông có endpoint nào của bạn với id này
GET/webhooks/{id}/deliveries
curl "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"
    }
  ]
}