跳到正文
会nokai.studio

Webhook endpoints

Auth: 需要 Authorization: Bearer zpk_...。


GET /v1/webhook-endpoints

列出所有已注册的端点。

Response 200

{
  "data": [
    {
      "id": "endpoint_uuid",
      "customer_id": "cust_uuid",
      "url": "https://yourapp.com/webhooks/kinokai",
      "events": ["job.completed", "job.failed"],
      "enabled": true,
      "has_custom_signing_secret": false,
      "provider_filter": null,
      "created_at": "2026-05-01T00:00:00Z",
      "updated_at": "2026-05-01T00:00:00Z"
    }
  ]
}

POST /v1/webhook-endpoints

注册一个新端点。

Request body

{
  "url": "https://yourapp.com/webhooks/kinokai",
  "events": ["job.completed", "job.failed"],
  "enabled": true,
  "signing_secret": "my-custom-secret-min-16-chars",
  "provider_filter": null
}
字段类型必填备注
urlstring (HTTPS URL)是仅限公共 DNS。回环/私有 IP 会被拒绝。
eventsstring[]是以下任意:job.completed、job.failed、credits.low_balance、credits.topped_up。
enabledboolean否默认 true。
signing_secretstring否16-255 字符。省略时自动生成。
provider_filterstring or null否仅接收该生成提供商的事件。

Response 201

返回已创建的端点对象(若你提供了 secret,则 has_custom_signing_secret: true)。


PATCH /v1/webhook-endpoints/:id

更新一个端点。

Path param

id -- 端点的 UUID。

Request body(所有字段可选)

{
  "url": "https://yourapp.com/webhooks/v2",
  "events": ["job.completed", "job.failed", "credits.low_balance"],
  "enabled": true,
  "signing_secret": "new-secret-min-16-chars",
  "provider_filter": null
}

传入 signing_secret: null 可重置为自动生成的 secret。

Response 200

返回已更新的端点对象。


DELETE /v1/webhook-endpoints/:id

删除一个端点。返回 204 No Content。


投递历史

见 Webhook deliveries。