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

# Delete Webhook

> Permanently delete a webhook endpoint and stop all future deliveries

## Request

### Path Parameters

<ParamField path="id" type="string" required>
  The webhook's unique ID (UUID)
</ParamField>

### Headers

```
Authorization: Bearer wbk_your_api_key_here
```

<Note>
  Requires an API key with the `webhooks:write` permission.
</Note>

<Warning>
  Deletion is **permanent** and cannot be undone. The signing secret is immediately invalidated and any in-flight retries will be cancelled. Historical delivery logs remain available for 30 days via the audit log.
</Warning>

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="deleted" type="boolean">
      Always `true` on success
    </ResponseField>

    <ResponseField name="id" type="string">
      ID of the deleted webhook
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://data.leadlex.com/functions/v1/api-gateway/v1/webhooks/7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d \
    -H "Authorization: Bearer wbk_your_api_key_here"
  ```

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

  API_KEY = "wbk_your_api_key_here"
  BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
  WEBHOOK_ID = "7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d"

  response = requests.delete(
      f"{BASE_URL}/v1/webhooks/{WEBHOOK_ID}",
      headers={"Authorization": f"Bearer {API_KEY}"},
  )
  assert response.json()["data"]["deleted"] is True
  ```

  ```javascript JavaScript theme={null}
  const WEBHOOK_ID = '7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d';

  const response = await fetch(
    `https://data.leadlex.com/functions/v1/api-gateway/v1/webhooks/${WEBHOOK_ID}`,
    {
      method: 'DELETE',
      headers: { 'Authorization': 'Bearer wbk_your_api_key_here' },
    }
  );
  const { data } = await response.json();
  console.log(data.deleted); // true
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "data": {
    "deleted": true,
    "id": "7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d"
  }
}
```

<Tip>
  To rotate a compromised signing secret, delete the webhook and create a new one with the same URL and events.
</Tip>

## Errors

| Status | Code                       | Description                               |
| ------ | -------------------------- | ----------------------------------------- |
| 401    | `invalid_key`              | Invalid or expired API key                |
| 403    | `insufficient_permissions` | Missing `webhooks:write` permission       |
| 404    | `webhook_not_found`        | No webhook with this ID in your workspace |
| 429    | `rate_limited`             | Rate limit exceeded                       |
