Skip to content

修改通知地址 ​

PATCH /webhooks/{webhookId}

权限范围幂等operationId
webhooks:manage本身幂等Webhooks_update

只传要改的字段;enabled: true 会同时清零失败计数。

幂等:本身幂等,重复调用结果相同。

参数 ​

名称位置类型必填说明
webhookId路径string是通知地址 ID(wh_…)

请求体 ​

UpdateWebhook ​

字段类型必填说明
urlstring地址(≤512 字)
eventTypesstring[]订阅的事件类型;["*"] = 全部(最多 50 项)
descriptionstring说明(≤100 字)
enabledboolean是否启用

示例 ​

js
const res = await client.patch("/webhooks/wh_1CcCZKQvkWWEgAfxpMOQNIQ", {
  "url": "https://example.com/sy-webhook",
  "eventTypes": [
    "string"
  ],
  "description": "说明文字",
  "enabled": true
});
http
PATCH /open/v1/webhooks/wh_1CcCZKQvkWWEgAfxpMOQNIQ HTTP/1.1
Host: api.sybb.pw
Authorization: SY-HMAC-SHA256 Credential=ak_…, Timestamp=1796035200, Nonce=…, Signature=…
Content-Type: application/json

{
  "url": "https://example.com/sy-webhook",
  "eventTypes": [
    "string"
  ],
  "description": "说明文字",
  "enabled": true
}

响应 200:

json
{
  "webhookId": "wh_1CcCZKQvkWWEgAfxpMOQNIQ",
  "url": "https://example.com/sy-webhook",
  "eventTypes": [
    "string"
  ],
  "description": "说明文字",
  "status": "enabled",
  "consecutiveFailures": 1,
  "secret": "string",
  "createdAt": "2026-11-30T20:15:00+08:00"
}

响应 ​

WebhookView ​

字段类型必填说明
webhookIdstring通知地址 ID(wh_…)
urlstring地址
eventTypesstring[]订阅的事件类型;["*"] = 全部
descriptionstring说明
statusstringenabled / disabled / auto_disabled(连续 3 天全部失败被系统停用)
consecutiveFailuresinteger连续投递失败次数(成功一次清零;连续失败 3 天自动停用)
secretstring只在创建和轮换时返回
createdAtstring时间(RFC 3339)

错误 ​

HTTP错误码含义
404NOT_FOUND资源不存在或不属于本店

签名、权限、限流等通用错误见错误处理。

ByteForge · 神运开放平台接口地址 https://api.sybb.pw/open/v1