§ API REFERENCE
更新 Webhook订阅
PATCH
/webhook-endpoints/{subscription_id}scope: webhook:manage更新回调地址、事件类型、状态或说明。
鉴权:Authorization: Bearer <access_token>。
§ 1
请求信息
REQUESTPATCH https://api.lingxiguangnian.com/api/open/v1/webhook-endpoints/{subscription_id}请求头
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | string | 是 | Bearer <access_token>。由 POST /token 换取,有效期 2 小时;api_secret 不得直连业务端点(→ 401)。 |
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
subscription_id | uuid | 是 | 订阅ID。 |
请求体参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
target_url | https url | 否 | 新的公网HTTPS地址。 |
event_types | string[] | 否 | 新的事件集合。 |
status | enum | 否 | ACTIVE / DISABLED;撤销使用 DELETE。 |
description | string | null | 否 | 说明。 |
§ 2
调用示例
EXAMPLESPATCH /webhook-endpoints/{subscription_id}
curl -X PATCH "https://api.lingxiguangnian.com/api/open/v1/webhook-endpoints/11111111-1111-4111-8111-111111111111" -H "Authorization: Bearer oat_xxxxxxxxxxxxxxxx" -H "Content-Type: application/json" -d '{"status":"DISABLED"}'§ 3
返回结果
RESPONSE返回字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
subscription | object | 是 | 更新后的安全订阅投影;无 signing_secret。 |
RESPONSE · JSON
{ "success": true, "data": { "id": "11111111-1111-4111-8111-111111111111", "status": "DISABLED" } }§ 4
端点错误码
ERRORS通用鉴权、scope 与限流错误见「使用概述」;下表为本端点专属错误。
| HTTP | error_code | 触发条件 |
|---|---|---|
| 404 | open_api.webhook_not_found | 订阅不存在或不属于当前 APP/机构。 |
| 500 | open_api.webhook_write_failed | Webhook订阅更新失败。 |
契约真源:apps/m-master/src/app/api/open/v1/webhook-endpoints/[subscriptionId]/route.ts