Skip to main content

启用 Webhook

启用被禁用的 Webhook。请求体为空。重新启用不会补发禁用期间产生的事件。

前提

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

接口

POST /webhook_endpoints/{id}/enable

路径参数

id string (必选)Webhook ID,格式 wep_<ULID>

请求示例

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

响应字段

id string—description string | null—url string—events array<string>—status string启用后为 ACTIVEdisabled_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本次请求的唯一标识,排查问题时附带

响应

{
  "id": "wep_01JXX7YQGPRPV1BZXA35QE7WDP",
  "description": "生产环境会话事件",
  "url": "https://example.com/managedagent/webhooks",
  "events": [
    "session.status_idled"
  ],
  "status": "ACTIVE",
  "disabled_reason": null,
  "consecutive_fail": 2,
  "last_success_at": "2026-08-06T10:05:00Z",
  "last_failure_at": "2026-08-06T10:10:00Z",
  "created_at": "2026-08-06T10:00:00Z",
  "updated_at": "2026-08-06T10:20:00Z",
  "request_id": "8e1d16e4"
}

错误码

状态码错误码说明
40411800001webhook not found