Open Channels: Common Scenarios
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
A scenario is a sequence of requests for a single task in Open Channels. Scenarios help connect external channels, pass customer Salutations to Bitrix24, and return operator responses to the same channel.
An Open Channel defines the rules for processing a Salutation within Bitrix24: operator queues, routing, CRM mode, and other dialog configurations. A connector links an Open Channel to an external channel, such as a website chat or another service.
Quick links: Scenario and Methods
User Documentation: Create and configure Open Channels
Connection with Other Objects
A scenario with an external chat is built around a connector, an external chat, and an application handler.
- Connector. The connector links an external channel to an Open Channel. An application registers it using the imconnector.register method, after which Bitrix24 displays the connector in the Contact Center settings. When registering, set the connector code in the
IDparameter, then pass this value in the parameterCONNECTOR. - External Chat. An external website or service stores the public part of the conversation: the chat interface, the visitor identifier, and the message history. A customer message is passed to Bitrix24 using the imconnector.send.messages method. In the
MESSAGESarray, the application passes customer data, messages, and chat information. - Application Handler. The handler receives events from Bitrix24. When an operator responds from an Open Channel, the application receives the OnImConnectorMessageAdd event, sends the response to the external chat, and confirms delivery using the imconnector.send.status.delivery method. In imconnector.register, pass
PLACEMENT_HANDLERfor the connector configuration interface, and in event.bind, passhandlerfor the event.
Getting Started
- Define the external channel: a website chat, a contact form, or another service where the customer starts a conversation.
- Create a Bitrix24 application and prepare public HTTPS URLs: one for the connector configuration interface and one for the event handler.
- Register the connector using the imconnector.register method.
- Subscribe the application to the OnImConnectorMessageAdd event using the event.bind method.
- Connect the connector to the required Open Channel in Bitrix24. In the application configuration handler, call imconnector.activate and pass
ACTIVE=1. - Pass customer messages using the imconnector.send.messages method.
- Receive operator responses in the event handler and confirm delivery using the imconnector.send.status.delivery method.
Key Considerations
- The connector operates through an application. Webhooks are not suitable: the application must register the connector, receive events, and work with Open Channel configurations.
- To use connector methods and subscribe to the OnImConnectorMessageAdd event, the application requires the
imopenlinesscope. - Use the same connector code during registration, activation, message sending, and event handling.
How to Select a Scenario
|
If necessary |
Open |
|
Create an online chat on the website and pass messages to an operator in Bitrix24 |
|
|
Clarify method parameters, events, and the connector data structure |
|
|
Configure lines, sessions, operators, messages, and chatbots |