
# Delete a webhook endpoint

`DELETE /v1/webhook-endpoints/{endpoint_id}` · permission `webhook-endpoints:write` · all plans

Deletes an endpoint. Its pending and retrying deliveries are cancelled in the same transaction; the delivery history stays for its 30-day retention. `If-Match` is required; `*` deletes whatever version is stored.

## Request

| Field | Type | Required | Description |
|---|---|---|---|
| `endpoint_id` | path | yes | Webhook endpoint ID (`whe_…`). |
| `If-Match` | header | yes | Current `ETag` of the endpoint, or `*`. |

## Response

`204 No Content`.

## Errors

| HTTP | code | When |
|---|---|---|
| 404 | `not_found` | No such endpoint in this environment. |
| 412 | `precondition_failed` | `If-Match` does not match the current version. |
| 428 | `precondition_required` | `If-Match` is missing. |
| 401 | `unauthenticated` | The credential is missing, invalid or revoked. |
| 403 | `insufficient_permissions` | The credential lacks `webhook-endpoints:write`. |
| 503 | `service_unavailable` | Webhook administration is temporarily unavailable; retry after the `Retry-After` period. |

## Example

```bash
curl -X DELETE https://api.eu.keenauth.com/v1/webhook-endpoints/whe_01k8a3m5q7t9v1w3x5y7z9b2c4 \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY" \
  -H 'If-Match: "3"'
```

CLI: `keenauth webhook-endpoints delete whe_01k8a3m5q7t9v1w3x5y7z9b2c4 --if-match '"3"'`
