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
}| 字段 | 类型 | 必填 | 备注 |
|---|---|---|---|
url | string (HTTPS URL) | 是 | 仅限公共 DNS。回环/私有 IP 会被拒绝。 |
events | string[] | 是 | 以下任意:job.completed、job.failed、credits.low_balance、credits.topped_up。 |
enabled | boolean | 否 | 默认 true。 |
signing_secret | string | 否 | 16-255 字符。省略时自动生成。 |
provider_filter | string 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。