> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dojah.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a webhook subscription

> Remove a webhook subscription by service name to stop Dojah from delivering its events.

<div className="dj-endpoint">
  <span className={`dj-method dj-method-delete`}>DELETE</span>
  <code>/api/v1/webhook/delete</code>
</div>

Stop delivering events for a service by removing its subscription. Identify the subscription by its service name; the matching webhook for the calling environment is removed.

## Headers

| Header          | Required | Description                                         |
| --------------- | -------- | --------------------------------------------------- |
| `Authorization` | Yes      | Your app's secret key, sent as-is — *not* `Bearer`. |
| `AppId`         | Yes      | The App ID from your dashboard.                     |
| `Content-Type`  | Yes      | `application/json`                                  |

## Body parameters

| Parameter | Type   | Required | Description                                                                                                                                                       |
| --------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `service` | string | Yes      | The service whose subscription to delete — e.g. `sms`, `kyc_widget`, `address`. The subscription removed is the one for the environment of the key you call with. |

## Response

A `200` returns a confirmation string in `entity`. Dojah stops sending events for that service immediately. To re-enable delivery later, [subscribe](/api-reference/webhook-management/subscribe) again. While a subscription is live, always confirm each delivery’s signature — see [Webhooks & signatures](/api-reference/core-concepts/webhooks-signatures#verify-events-are-from-dojah).

## Errors

| Code  | Meaning                                                                |
| ----- | ---------------------------------------------------------------------- |
| `400` | Bad request — `service` is missing or isn't a recognised value.        |
| `401` | Unauthorized — check your secret key and `AppId` (no `Bearer` prefix). |
| `404` | No subscription found for that service in this environment.            |
| `429` | Too many requests — back off and retry.                                |

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.dojah.io/api/v1/webhook/delete" \
    -H "Authorization: {{secret_key}}" \
    -H "AppId: {{app_id}}" \
    -H "Content-Type: application/json" \
    -d '{
      "service": "kyc_widget"
    }'
  ```

  ```js Node.js theme={null}
  const res = await fetch("https://api.dojah.io/api/v1/webhook/delete", {
    method: "DELETE",
    headers: {
      Authorization: process.env.DOJAH_SECRET_KEY,
      AppId: process.env.DOJAH_APP_ID,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      service: "kyc_widget",
    }),
  });
  const data = await res.json();
  ```

  ```python Python theme={null}
  import os, requests

  res = requests.delete(
      "https://api.dojah.io/api/v1/webhook/delete",
      headers={
          "Authorization": os.environ["DOJAH_SECRET_KEY"],
          "AppId": os.environ["DOJAH_APP_ID"],
          "Content-Type": "application/json",
      },
      json={
          "service": "kyc_widget",
      },
  )
  data = res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json DELETE /api/v1/webhook/delete theme={null}
  {
    "entity": "webhook deleted successfully"
  }
  ```
</ResponseExample>
