Skip to main content
Webhook

测试 Webhook

向当前 Webhook 发送一次 webhook.test POST 请求,回调地址返回 2xx 后才返回成功。请求体为空。测试不重试,不保存投递记录,不影响连续失败计数。3xx 或安全校验失败仍会按安全规则禁用当前 Webhook。

前提

已完成 Endpoint 与鉴权配置,详见API 总览与认证

接口

POST /webhook_endpoints/{id}/test

路径参数

参数必填类型说明
idstringWebhook ID,格式 wep_<ULID>

请求示例

curl -X POST "$AGENTSTUDIO_URL/webhook_endpoints/wep_01JXX7YQGPRPV1BZXA35QE7WDP/test" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

响应

{
  "type": "event",
  "id": "whe_01JXX8JY9BBM4BK4C2P7K3M3ZR",
  "created_at": "2026-08-06T10:30:21.123Z",
  "data": {
    "id": "wep_01JXX7YQGPRPV1BZXA35QE7WDP",
    "type": "webhook.test",
    "workspace_id": "ws_xxx"
  },
  "request_id": "8e1d16e4"
}

响应字段

字段类型说明
typestring固定为 event
idstring事件 ID,格式 whe_<ULID>
created_atstring事件创建时间,ISO 8601
dataobject事件载荷
data.idstringWebhook ID
data.typestring固定为 webhook.test
data.workspace_idstring工作空间 ID
request_idstring本次请求的唯一标识,排查问题时附带

错误码

状态码错误码说明
40411800001webhook not found
409Webhook 未启用
50211800015Webhook endpoint returned HTTP 408, response body: request timeout