Forgedocs

列出账户 webhooks

GET /api/webhooks

返回已认证账户配置的所有 webhooks。

认证

需要在 Authorization 头中提供 Bearer 令牌。

响应 (200)

字段类型描述
accountIdnumber账户 ID
webhooksarray已配置的 webhooks 列表
webhooks[].idnumberWebhook 唯一标识符
webhooks[].typestring事件类型:cash_incash_outrefund_inrefund_out
webhooks[].urlstring已配置的端点 URL
webhooks[].headersobject自定义请求头(键值对)
webhooks[].isActiveboolean表示 webhook 是否处于活动状态
webhooks[].createdAtstring创建日期(ISO 8601)
totalnumber已配置的 webhooks 总数
{
  "accountId": 93,
  "webhooks": [
    {
      "id": 1,
      "type": "cash_in",
      "url": "https://api.example.com/webhooks/pix",
      "headers": {
        "Authorization": "Bearer token123"
      },
      "isActive": true,
      "createdAt": "2025-01-09T12:00:00.000Z"
    }
  ],
  "total": 4
}

错误

状态码描述
401令牌缺失或无效
404账户未找到

本页目录