# Webhookを削除する

Source: https://won.dev/ja/docs/email/webhooks-delete

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

Webhookへのイベントの送信を止めて削除し、待機中だった配信も破棄します。イベント自体は引き続き `GET /events` で読めます。無料です。

- **課金：** 無料。

テストキー（`won_test_...`）では、これは[サンドボックス](/ja/docs/email#sandbox)で動きます。何も送信されず、課金もされません。

## パラメーター [#parameters]

`id` はパスに含めます。`DELETE` リクエストでは `Idempotency-Key` ヘッダーも使えます。[同じリクエストを2回送ったとき](/ja/docs/email#idempotency)を参照してください。

| パラメーター | 型 | 必須 | 説明（APIの原文） |
| --- | --- | --- | --- |
| `id` | string | はい | Webhook ID, such as `whk_2m9x7p1q8w3e5r4k`. |

## レスポンス [#response]

エラーについては[エラーコード](/ja/docs/errors)を参照してください。

| フィールド | 型 | 説明（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. |

## 例 [#example]

```bash
curl -X DELETE "https://api.won.dev/v1/webhooks/whk_2m9x7p1q8w3e5r4k" \
  -H "Authorization: Bearer $WON_API_KEY"
```

```json
{
  "data": {
    "id": "whk_2m9x7p1q8w3e5r4k",
    "deleted": true
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}
```