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

# Delete Webhook

Deletes a webhook configuration.

## Overview

Permanently delete a webhook configuration. Pending deliveries will not be sent after deletion.

<Warning>
  This action is irreversible. All pending deliveries for this webhook will be
  cancelled and not sent.
</Warning>

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token with `write:webhooks` scope
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The webhook configuration ID (UUID v4)
</ParamField>

## Response

Returns `204 No Content` on successful deletion.

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.instaview.sk/webhooks/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer sk_your_key_here"
  ```

  ```javascript Node.js theme={null}
  const webhookId = '550e8400-e29b-41d4-a716-446655440000';

  const response = await fetch(
    `https://api.instaview.sk/webhooks/${webhookId}`,
    {
      method: 'DELETE',
      headers: {
        'Authorization': `Bearer ${process.env.INSTAVIEW_API_KEY}`
      }
    }
  );

  if (response.status === 204) {
    console.log('Webhook deleted successfully');
  }
  ```

  ```python Python theme={null}
  webhook_id = '550e8400-e29b-41d4-a716-446655440000'

  response = requests.delete(
      f'https://api.instaview.sk/webhooks/{webhook_id}',
      headers={
          'Authorization': f'Bearer {os.environ["INSTAVIEW_API_KEY"]}'
      }
  )

  if response.status_code == 204:
      print('Webhook deleted successfully')
  ```
</CodeGroup>

## Error Responses

<AccordionGroup>
  <Accordion title="404 - Webhook Not Found">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": "RESOURCE_NOT_FOUND",
        "message": "Webhook configuration not found"
      }
    }
    ```
  </Accordion>

  <Accordion title="403 - Access Denied">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": "RESOURCE_ACCESS_DENIED",
        "message": "Access denied to this webhook configuration"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Best Practices

Before deleting a webhook:

1. **Disable first** - Set `isActive: false` to test impact
2. **Monitor for issues** - Ensure no critical integrations depend on it
3. **Update dependent systems** - Notify systems expecting webhook deliveries

## Alternative: Disable Instead of Delete

If you might need the webhook later, consider disabling it instead:

```javascript theme={null}
// Disable instead of delete
await fetch(`https://api.instaview.sk/webhooks/${webhookId}`, {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    isActive: false
  })
});
```

## Related

<CardGroup cols={2}>
  <Card title="List Webhooks" icon="list" href="/api-reference/webhooks/list-webhooks">
    List all webhook configurations
  </Card>

  <Card title="Create Webhook" icon="plus" href="/api-reference/webhooks/create-webhook">
    Create a new webhook
  </Card>
</CardGroup>
