Webhook 列表
列出已认证用户拥有的 Webhook 订阅。该端点 不会 返回密钥。
端点
GET /v1/webhooks
权重: 2 鉴权: 必须(已签名)——参见 鉴权。
查询参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
status | enum<active|paused|broken> | NO | 仅返回该状态的 Webhook。省略则返回全部。 |
event | string | NO | 仅返回订阅了该事件类型的 Webhook。通配符订阅会匹配具体事件(例如,订阅了 strategy.* 的 Webhook 在 event=strategy.deployed 时也会被返回)。 |
limit | integer | NO | 分页大小。范围 1–100。默认 25。 |
cursor | string | NO | 由上一次调用返回的不透明分页游标。 |
响应
{
"data": [
{
"id": "wh_2a4f10",
"url": "https://example.com/pipai-webhook",
"events": ["strategy.deployed", "strategy.position_opened", "strategy.error", "backtest.job_done"],
"description": "Production strategy alerts",
"status": "active",
"consecutive_failures": 0,
"last_delivery_at": "2026-04-29T11:58:32Z",
"last_success_at": "2026-04-29T11:58:32Z",
"created_at": "2026-04-20T09:00:00Z"
},
{
"id": "wh_91b3ac",
"url": "https://ops.example.com/pipai-alerts",
"events": ["account.balance_low", "account.api_key_rotated"],
"description": "Ops alerts",
"status": "paused",
"consecutive_failures": 0,
"last_delivery_at": "2026-04-28T20:14:11Z",
"last_success_at": "2026-04-28T20:14:11Z",
"created_at": "2026-04-15T14:32:08Z"
}
],
"next_cursor": null
}
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
data | array<object> | Webhook 对象的一页数据。完整字段语义参见 创建 端点。secret 和 _secret_warning 字段 永远不会 出现在列表响应中。 |
next_cursor | string|null | 下一页的不透明游标;如果是最后一页则为 null。 |
错误
400 INVALID_PARAMETER——limit超出范围;status不是允许的取值之一;event不是已知事件类型或通配符;或cursor格式不正确。403 INSUFFICIENT_PERMISSION—— API 密钥缺少webhooks:read范围。
完整列表参见 错误。
示例
curl -G "https://api.pipai.example/v1/webhooks" \
--data-urlencode "status=active" \
--data-urlencode "limit=50" \
-H "X-PipAI-API-Key: $API_KEY" \
-H "X-PipAI-Timestamp: $TS" \
-H "X-PipAI-Signature: $SIG"