冷邮件 API
删除 Webhook
停止向某个 Webhook 推送事件。免费。
DELETE https://api.won.dev/v1/webhooks/{id}
删除 Webhook,停止向它推送事件,排队中的推送也会一并丢弃。事件本身仍可通过 GET /events 读取。免费。
- 计费: 免费。
参数
id 放在路径中。DELETE 请求还支持 Idempotency-Key 请求头,见重复请求。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
id | string | 是 | Webhook ID, such as whk_2m9x7p1q8w3e5r4k. |
响应
错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object | The webhook that was deleted. |
data.id | string | The webhook that was deleted. |
data.deleted | boolean | Always true: the webhook is gone. |
notice | string | null | A plain sentence when there is something to know about this answer. Null otherwise. |
usage | object | Nothing is charged here. The balance, for reference. |
usage.cost | number | What this call cost, in US dollars. |
usage.balance | number | The balance left after this call, in US dollars. |
usage.replayed | boolean | True 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_...)发送这个请求,会在沙箱中运行:不发信,不收费。