更新 Webhook 的描述、回调地址或订阅事件。字段缺省表示保持不变。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
PUT /webhook_endpoints/{id}
路径参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
id | 是 | string | Webhook ID,格式 wep_<ULID> |
请求体
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
description | 否 | string | null | 最长 256 个字符;null 或空字符串表示清空,字段缺省表示保持不变 |
url | 否 | string | 新回调地址;传入时重新校验,私网、回环、链路本地和保留地址会被拒绝 |
events | 否 | array<string> | 使用具名事件类型替换整个订阅列表;字段缺省表示保持不变 |
请求示例
响应
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | — |
description | string | null | — |
url | string | — |
events | array<string> | — |
status | string | — |
disabled_reason | string | null | — |
consecutive_fail | integer | 返回更新完成时的当前值 |
last_success_at | string | null | 返回更新完成时的当前值 |
last_failure_at | string | null | 返回更新完成时的当前值 |
created_at | string | — |
updated_at | string | — |
request_id | string | 本次请求的唯一标识,排查问题时附带 |
错误码
| 状态码 | 错误码 | 说明 |
|---|---|---|
| 400 | 11800016 | invalid webhook request |
| 404 | 11800001 | webhook not found |