Skip to main content
Webhooks

发送 Webhook 测试事件

向指定 Endpoint 发送一个测试事件,用于验证接收地址和签名处理。

Webhook 当前为 Beta 功能,接口、字段和行为可能在后续版本中调整。
POST /api/v1/forward/webhook/endpoints/{endpoint_id}/test 测试事件类型为 webhook.test,无需将它加入 Endpoint 的订阅列表。投递是异步的,接口返回成功表示测试事件已被接受,不表示接收端已经处理完成。 调用前请先确保 Endpoint 已启用。Endpoint 已停用时,接口仍可能返回 202,但 delivery_rows0 且不会产生回调。

请求头

Header是否必填说明
AuthorizationBearer <PAT 或管理员 SAT>

路径参数

参数类型是否必填说明
endpoint_idstringWebhook Endpoint ID。

示例请求

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/webhook/endpoints/e149c233-1234-4abc-8def-1234567890ab/test' \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 202 Accepted
{
  "event_id": 433,
  "delivery_rows": 1
}

响应字段

字段类型说明
event_idinteger本次测试请求的标识。
delivery_rowsinteger本次测试已接受的投递任务数量。
接收端收到的测试事件示例:
{
  "type": "event",
  "id": "whe_01k1jbxexample",
  "endpoint_id": "e149c233-1234-4abc-8def-1234567890ab",
  "emitted_at": "2026-09-01T09:01:22Z",
  "note": "This is a synthetic test event."
}

错误

HTTPType触发条件
401authentication_error认证信息缺失、无效或已过期。
403permission_error当前令牌不能管理 Webhook。
404not_found_errorEndpoint 不存在或当前账号不可见。
500/502/503api_error测试事件暂时无法发送。

相关