Delete a webhook
Stop sending events to a webhook. Free.
DELETE https://api.won.dev/v1/webhooks/{id}
Stops sending events to a webhook and forgets it, with the deliveries that were still waiting. The events themselves stay readable with GET /events. Free.
- Billing: Free.
Parameters
id is part of the path. DELETE requests also take an Idempotency-Key header, see Sending a request twice.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Webhook ID, such as whk_2m9x7p1q8w3e5r4k. |
Response
Errors are described in Errors.
| Field | Type | Description |
|---|---|---|
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. |
Example
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
}
}A test key (won_test_...) runs this in the sandbox: nothing is sent and nothing is charged.