# Delete Webhook - Remove Event Notification Endpoint

> Remove a webhook registration from your Telegram or Discord subscription bot project and understand pending deliveries.

Source: https://docs.botsubscription.com/api/integrations/delete-webhook/

Remove an outbound webhook registration from your Telegram or Discord subscription bot project. Already-prepared deliveries can still reach the old URL after deletion.

<ApiEndpoint method="DELETE" endpoint="/v2/projects/{project_id}/integrations/webhooks/{webhook_id}" />

<ApiAuthorization type="Bearer API Key" />

**API key scope:** `webhooks:delete` (required for restricted keys).

Success returns `200` with `data: null`. The endpoint secret is not rotatable in place—to rotate it, delete the webhook and create a new one, then capture the freshly generated secret. Pending deliveries retain their original signatures, so old and new signatures can overlap. See [webhook deletion and secret rotation](https://docs.botsubscription.com/webhooks/delivery-retries/#endpoint-deletion-and-secret-rotation).

<ApiSection title="Path Parameters">
  <ApiParameter name="project_id" type="string" required description="The unique identifier of the project." />
  <ApiParameter name="webhook_id" type="string" required description="The unique identifier of the webhook to delete." />
</ApiSection>

<ApiSamplePane>

<ApiRequestSample title="Request">

```bash
curl -X DELETE "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/integrations/webhooks/WEBHOOK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```javascript
const project_id = 'YOUR_PROJECT_ID';
const webhook_id = 'WEBHOOK_ID';
const response = await fetch(`https://api.botsubscription.com/v2/projects/${project_id}/integrations/webhooks/${webhook_id}`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});
```

```python
import requests

project_id = 'YOUR_PROJECT_ID'
webhook_id = 'WEBHOOK_ID'
response = requests.delete(
    f'https://api.botsubscription.com/v2/projects/{project_id}/integrations/webhooks/{webhook_id}',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
```

```php
$project_id = 'YOUR_PROJECT_ID';
$webhook_id = 'WEBHOOK_ID';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.botsubscription.com/v2/projects/{$project_id}/integrations/webhooks/{$webhook_id}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
```

</ApiRequestSample>

<ApiResponseTabs>
  <ApiResponse status={200} description="Webhook registration deleted">

```json
{
  "ok": true,
  "request_id": "44444444-4444-4444-8444-444444444444",
  "method": "DELETE",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/integrations/webhooks/22222222-2222-4222-8222-222222222222",
  "code": 200,
  "message": "Webhook deleted successfully",
  "data": null
}
```

  </ApiResponse>
  <ApiResponse status={422} description="Invalid webhook ID">

```json
{
  "ok": false,
  "request_id": "44444444-4444-4444-8444-444444444444",
  "method": "DELETE",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/integrations/webhooks/not-a-uuid",
  "code": 422,
  "errors": [
    {
      "message": "params: webhook_id Invalid UUID",
      "error_code": "VALIDATION_ERROR"
    }
  ]
}
```

  </ApiResponse>
  <ApiResponse status={404} description="Webhook not found">

```json
{
  "ok": false,
  "request_id": "44444444-4444-4444-8444-444444444444",
  "method": "DELETE",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/integrations/webhooks/22222222-2222-4222-8222-222222222222",
  "code": 404,
  "error": {
    "error_code": "NOT_FOUND",
    "message": "Webhook not found."
  }
}
```

  </ApiResponse>
  <ApiResponse status={401} description="Invalid or expired API key">

```json
{
  "ok": false,
  "request_id": "44444444-4444-4444-8444-444444444444",
  "method": "DELETE",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/integrations/webhooks/22222222-2222-4222-8222-222222222222",
  "code": 401,
  "error": {
    "message": "Invalid or expired authentication token.",
    "error_code": "UNAUTHORIZED"
  }
}
```

  </ApiResponse>
</ApiResponseTabs>

</ApiSamplePane>
