---
title: "Delete a webhook"
method: POST
path: "/delete-webhook"
tags: ["Chatbot Operations"]
---

# Delete a webhook

`POST /delete-webhook`

## Request

- Base URL: `https://api.chat-data.com/api/v2`
- URL: `https://api.chat-data.com/api/v2/delete-webhook`
- Auth: HTTP bearer

Delete the webhook registered with the given URL, together with all of its event subscriptions. The response lists the chatbot's remaining webhooks. If no webhook matches `url`, nothing is deleted and the response is still 200 with the unchanged list.

## Request body

- DeleteWebhookReq: The webhook endpoint with the given URL is deleted, together with all of its event subscriptions.
  - `chatbotId` string, required: The ID of the chatbot the webhook belongs to.
  - `url` string, required: The URL endpoint that the chatbot delivers events to.

## Response `200`

Successful response.

- object
  - `status` 'success', required
  - `webhooks` WebhookPayload[]: The chatbot's webhooks after the change.
    - `endpoint` string, required: The URL endpoint that the chatbot delivers events to.
    - `events` string[], required: An array of events that the webhook subscribes to. See [Webhooks](/api-reference/webhooks) for the event bodies.
    - `secret` string, required: The secret used to sign deliveries. The `x-chat-data-hmac-sha256` header carries the Base64 HMAC-SHA256 of the raw request body, keyed with this secret.
    - `enable` boolean, required: Indicates whether the webhook is turned on.
    - `contentType` 'text/plain' | 'application/json': The `Content-Type` of the deliveries.

## Other responses

- `400`: `url` is missing or not a valid URL (`Please provide a valid url.`), `chatbotId` is missing, or an unexpected error occurred while saving.
- `401`: Authentication failed: the `Authorization` header is missing or not in the `Bearer <key>` format, the API key does not exist, its workspace is unavailable or has no owner, or the workspace's plan does not include API access. `message` says which.
- `403`: The API key cannot access the requested chatbot. A chatbot-scoped key used with another chatbot's ID gets `Access denied to this chatbot`. A workspace key gets `Chatbot <id> was not found in this API key's workspace. It may have been deleted or moved to another workspace.` when the chatbot does not exist or belongs to another workspace.
- `429`: The workspace sent more than 600 API requests in the last minute. Wait the number of seconds given in the `Retry-After` header (and in `message`) before retrying.

---

[API](https://skmtc.dev/chat-data/apis/chat-data-api-schema-guide.md) · [All operations](https://skmtc.dev/chat-data/apis/chat-data-api-schema-guide/llms.txt) · [OpenAPI document](https://skmtc.dev/chat-data/apis/chat-data-api-schema-guide/revisions/72871007f7f0?raw)
