sangtao.ai
API key

Webhook

Danh sách endpoint

Các endpoint webhook của bạn.

GEThttps://api.sangtao.ai/v2/webhooks

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.

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ột mảng, cũ nhất trước. Không bao giờ có secret.

GET/webhooks
curl "https://api.sangtao.ai/v2/webhooks" \
  -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
    }
  ]
}