Webhook 当前为 Beta 功能,接口、字段和行为可能在后续版本中调整。
POST /api/v1/forward/webhook/endpoints/{endpoint_id}/enable
Endpoint 已启用时重复调用仍返回当前状态。
请求头
| Header | 是否必填 | 说明 |
|---|
Authorization | 是 | Bearer <PAT 或管理员 SAT> |
路径参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|
endpoint_id | string | 是 | Webhook Endpoint ID。 |
示例请求
curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/webhook/endpoints/e149c233-1234-4abc-8def-1234567890ab/enable' \
-H "Authorization: Bearer $QODER_PAT"
示例响应
HTTP 200 OK
返回启用后的完整 Endpoint 对象,其中:
{
"id": "e149c233-1234-4abc-8def-1234567890ab",
"url": "https://example.com/webhooks/qoder",
"events": ["forward.schedule_run.succeeded"],
"metadata": {},
"active": true,
"last_success_at": null,
"last_failure_at": null,
"consecutive_fail": 0,
"created_at": "2026-09-01T08:00:00Z",
"updated_at": "2026-09-01T10:00:00Z"
}
响应字段见获取 Webhook Endpoint。
| HTTP | Type | 触发条件 |
|---|
401 | authentication_error | 认证信息缺失、无效或已过期。 |
403 | permission_error | 当前令牌不能管理 Webhook。 |
404 | not_found_error | Endpoint 不存在或当前账号不可见。 |
500/502/503 | api_error | 服务暂时不可用。 |