跳到正文
Won.dev
冷邮件 API

删除 Webhook

停止向某个 Webhook 推送事件。免费。

DELETE https://api.won.dev/v1/webhooks/{id}

删除 Webhook,停止向它推送事件,排队中的推送也会一并丢弃。事件本身仍可通过 GET /events 读取。免费。

  • 计费: 免费。

参数

id 放在路径中。DELETE 请求还支持 Idempotency-Key 请求头,见重复请求。

参数类型必填说明(API 原文)
idstring是Webhook ID, such as whk_2m9x7p1q8w3e5r4k.

响应

错误说明见错误码。

字段类型说明(API 原文)
dataobjectThe webhook that was deleted.
data.idstringThe webhook that was deleted.
data.deletedbooleanAlways true: the webhook is gone.
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

示例

curl -X DELETE "https://api.won.dev/v1/webhooks/whk_2m9x7p1q8w3e5r4k" \
  -H "Authorization: Bearer $WON_API_KEY"
{
  "data": {
    "id": "whk_2m9x7p1q8w3e5r4k",
    "deleted": true
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}

用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。

本页内容