# Delete a subscription

Source: https://help.ruuster.com/api/webhooks-delete

```http
DELETE https://api.ruuster.com/v1/webhooks/{webhookId}
```

Delete a webhook subscription. Pending deliveries are dropped.

- Authentication: `x-api-key` and `x-email` headers of an owner or admin
- Rate limit: 120 requests per minute per key
- Changes only your webhook subscriptions, never your Ruuster data

## Path parameters

| Name | Type | Description |
|---|---|---|
| `webhookId` | string | The subscription id, `whk_…` |

## Response

`data.deleted` is `true`, and `pendingDeliveriesDropped` counts deliveries that were still waiting to be sent.

## Example request

cURL:

```bash
curl -s -X DELETE "https://api.ruuster.com/v1/webhooks/whk_2c7f9a4e1b" \
  -H "x-api-key: $RUUSTER_API_KEY" \
  -H "x-email: $RUUSTER_EMAIL"
```

Node.js:

```javascript
const res = await fetch("https://api.ruuster.com/v1/webhooks/whk_2c7f9a4e1b", {
  method: "DELETE",
  headers: {
    "x-api-key": process.env.RUUSTER_API_KEY,
    "x-email": process.env.RUUSTER_EMAIL,
  },
});
const body = await res.json();
if (!body.ok) throw new Error(`${body.error.code}: ${body.error.message} (${body.requestId})`);
console.log(body.data);
```

Python:

```python
import os
import requests

res = requests.delete(
    "https://api.ruuster.com/v1/webhooks/whk_2c7f9a4e1b",
    headers={"x-api-key": os.environ["RUUSTER_API_KEY"], "x-email": os.environ["RUUSTER_EMAIL"]},
    timeout=30,
)
body = res.json()
if not body["ok"]:
    raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]} ({body.get("requestId")})')
print(body["data"])
```

## Example response

```json
{ "ok": true, "data": { "id": "whk_2c7f9a4e1b", "deleted": true, "pendingDeliveriesDropped": 0 } }
```
