---
title: "Turn a messaging integration on or off"
method: POST
path: "/toggle-bot-activation"
tags: ["Chatbot Operations"]
---

# Turn a messaging integration on or off

`POST /toggle-bot-activation`

## Request

- Base URL: `https://api.chat-data.com/api/v2`
- URL: `https://api.chat-data.com/api/v2/toggle-bot-activation`
- Auth: HTTP bearer

Toggle or set the activation status of a WhatsApp, Messenger, Instagram or LINE integration for a specific chatbot. `Telegram` and `WhatsappWebAPI` cannot be toggled: the call returns `active: null` and changes nothing.

## Request body

- object
  - `chatbotId` string, required: The unique identifier of the chatbot.
  - `type` 'Whatsapp' | 'WhatsappWebAPI' | 'Telegram' | 'Messenger' | 'Instagram' | 'Line', required: The type of third-party messaging platform.
  - `id` string, required: The ID of the integration to toggle — the phone number ID for WhatsApp, the page ID for Messenger/Instagram, or the integration's own ID for LINE. For WhatsApp, Messenger and Instagram, you can find it in the ID column of the integration modal.
  - `active` boolean: If provided, sets the activation status to this value. If omitted, the current status is toggled.

## Response `200`

Successful response.

- object
  - `status` 'success', required
  - `active` boolean, nullable, required: The updated activation status. `null` when the chatbot's integration of this `type` has no phone number or page with this `id`; nothing is changed then.

## Other responses

- `400`: `chatbotId` or `id` is missing, `type` is not a supported platform, or `active` is not a boolean.
- `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.
- `404`: The chatbot has no integration of this `type` (for `Line`, no LINE integration with this `id`).
- `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)
