账户

设置 Webhook

PUT /v1/account/webhook webhook

设置 Webhook URL,或用 null 清除。

请求体

请求体字段类型含义
url *string (https://…) | null必须以 https:// 开头
rotate_secretbool = false即使 URL 未变也强制生成新的签名密钥

响应

签名密钥只在创建或轮换时返回;再次发送相同 URL 会回应 unchanged 且 secret: null。

状态: 200, 400

请求
curl -X PUT https://api.xsignalfeed.com/v1/account/webhook \
  -H "Authorization: Bearer xsf_your_key" -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/hooks/xsf"}'
响应 · 200 / 400
{
  "status": "set",
  "url": "https://example.com/hooks/xsf",
  "secret": "a1b2c3…",
  "rotated": true,
  "signature_header": "X-XSF-Signature",
  "algorithm": "hmac-sha256(secret, raw_body)"
}