Webhook API 提供 Webhook 端点的创建、查询、更新、删除,以及启用、停用、测试、重置密钥与事件查询操作。Webhook 用于接收 Managed Agents 的事件回调投递。
概述
Webhook 端点(Webhook Endpoint)用于接收 Managed Agents 的事件回调投递。创建后默认停用,需启用后才会对事件进行回调投递。每次投递失败会累计连续失败次数,可通过测试接口验证连通性,或通过重置密钥接口轮换签名密钥。
Webhook 操作
| 操作 | 端点 | 说明 |
|---|---|---|
| 创建 Webhook | POST /webhook_endpoints | 创建 Webhook 端点,配置回调 URL 与订阅事件 |
| 获取 Webhook | GET /webhook_endpoints/{id} | 根据 ID 获取单个 Webhook 详情 |
| 列出 Webhook | GET /webhook_endpoints | 列出当前工作区未删除的 Webhook |
| 更新 Webhook | PUT /webhook_endpoints/{id} | 更新回调 URL、订阅事件、描述 |
| 删除 Webhook | DELETE /webhook_endpoints/{id} | 删除 Webhook,操作不可恢复 |
| 启用 Webhook | POST /webhook_endpoints/{id}/enable | 启用 Webhook,开始对事件进行回调投递 |
| 停用 Webhook | POST /webhook_endpoints/{id}/disable | 停用 Webhook,停止回调投递 |
| 测试 Webhook | POST /webhook_endpoints/{id}/test | 向回调 URL 发送测试事件,验证连通性 |
| 重置密钥 | POST /webhook_endpoints/{id}/reset_secret | 重置签名密钥,旧密钥立即失效 |
| 查询事件 | GET /webhook_endpoints/{id}/events | 分页查询该 Webhook 的投递事件记录 |