sangtao.ai
API key

Webhook

Lấy một endpoint

Một endpoint và lần giao gần nhất.

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

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.

Response

  • idstringbắt buộc

    Mã endpoint, whk_…

  • urlstringbắt buộc

    Nơi nhận sự kiện

  • eventsstring[]bắt buộc

    Các loại sự kiện endpoint nhận. ["*"] là tất cả

  • descriptionstring | null

    Ghi chú của bạn

  • enabledbooleanbắt buộc

    Có đang gửi sự kiện tới endpoint không

  • statusstringbắt buộc

    disabled_failing: tự tắt sau 3 ngày giao hỏng liên tục

    Giá trị có thể:activedisableddisabled_failing

  • createdAtstringbắt buộc

    Lúc tạo (ISO 8601, UTC). Endpoint chỉ nhận sự kiện xảy ra từ lúc này

  • lastDeliveryAtstring | null

    Lần gần nhất thử giao tới endpoint

  • lastSuccessAtstring | null

    Lần gần nhất endpoint trả 2xx

  • lastFailureAtstring | null

    Lần gần nhất giao hỏng

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}
curl "https://api.sangtao.ai/v2/webhooks/whk_4nP8rT2xK" \
  -H "X-Api-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "id": "whk_4nP8rT2xK",
    "url": "https://example.com/webhooks/sangtao",
    "events": [
      "image.completed",
      "image.failed"
    ],
    "description": "Production",
    "enabled": true,
    "status": "active",
    "createdAt": "2026-11-10T08:00:00Z",
    "lastDeliveryAt": "2026-11-10T09:43:32Z",
    "lastSuccessAt": "2026-11-10T09:43:32Z",
    "lastFailureAt": null
  }
}