Chats in Bitrix24: Overview of Methods
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.
The chat feature in Bitrix24 helps to:
- communicate one-on-one
- discuss tasks in groups
- manage notifications, files, and messages within a single messenger interface
To work with chats, use the methods im.*. This section includes methods for managing chats and subsections for specific scenarios: participants, messages, notifications, search, files, and special operations.
For new developments, keep in mind that some scenarios have already been migrated to im.v2. This is particularly important for working with files and messenger events.
Quick navigation: all methods and events
User documentation: Chats in Bitrix24: interface and capabilities
Main Components of Chat
A chat in Bitrix24 can be viewed as an object composed of several blocks:
- dialog type and identifiers
- chat settings and design
- participants and roles
- messages and history
- files
- notifications and special actions
Dialog Type and Identifiers
Group chats and personal dialogs differ by the identifier DIALOG_ID:
XXX— personal chat with a user, whereXXXis the user identifierchatXXX— group chatsgXXX— chat for a group or project
Group chats are created using the method im.chat.add. In the TYPE parameter, you can choose:
CHAT— closed chatOPEN— open chat
If you need to find an existing chat associated with an external object, use im.chat.get. For chats linked to CRM, tasks, calendars, open channels, and other objects, use the parameters ENTITY_TYPE and ENTITY_ID.
Chat Settings and Design
When creating a chat, you can specify the name, description, color, avatar, and initial message through im.chat.add.
If you do not provide a TITLE when creating the chat, the system will generate a name automatically. In working scenarios, assign a clear name and, if necessary, link the chat to an external object.
After creating the chat, you can modify its design and owner using methods from the Chat Update section.
Participants and Roles
The chat owner is automatically assigned upon chat creation. The user who invoked im.chat.add is added to the chat as the owner.
The owner identifier, the role of the current user, the list of managers, and action restrictions in the chat are returned by the methods im.dialog.get, im.recent.get, and im.recent.list.
To work with participants, use the methods from the Chat Participants section:
- im.chat.user.add — add participants
- im.chat.user.delete — remove participants
- im.chat.user.list — get participant identifiers
- im.dialog.users.list — get detailed participant list
You can transfer ownership to another participant using the method im.chat.setOwner.
Messages and History
The primary workflow for messaging begins with methods from the Messages section.
To send messages, use im.message.add, to read history — im.dialog.messages.get, and to search through history — im.dialog.messages.search.
The read status and service actions for messaging are managed by the methods im.dialog.read, im.dialog.unread, and im.dialog.writing.
Files
You can send files in the chat. To work with files in new integrations, use the methods from the im.v2 section of Files.
Use the methods from the group im.disk.* only for existing integrations with the old scenario.
Notifications and Special Actions
A notification in the messenger is a message containing information from the system or a user. Notifications are handled by the group of methods im.notify.*.
Methods for service actions with chats and recent dialog lists can be found in the Special Operations section. You can pin a chat, mark it as read, and hide it from the recent list.
How to Get Started
- Create a chat using the method im.chat.add or obtain an existing identifier through im.chat.get.
- Retrieve basic dialog data using the method im.dialog.get and, if necessary, the list of recent chats through im.recent.list.
- Add participants to the chat using the method im.chat.user.add.
- Configure the chat as needed: change the name, color, avatar, or owner using methods from the Chat Update section.
- Send a message using im.message.add or a notification using im.notify.
Interaction with Other Objects
User. Most methods operate on behalf of the current user or use identifiers USER_ID, USERS. You can obtain a user identifier using the method user.get. You can work with users using methods from the Users section.
Company Departments. Methods for searching and working with departments use the department identifier ID. You can obtain a department identifier using the get department list method or the search departments by name method.
Files. Old file upload scenarios use methods im.disk.*, while new scenarios have been moved to im.v2. Details are collected in the Files section.
Current API Version
For new integrations, use the current sections im.* and new methods im.v2, if the scenario has already been migrated to the new generation of the API.
- For files, use im.v2.File.upload and im.v2.File.download.
- For user events in the messenger, use the section im.v2: events.
- Methods from the sections Files, Search, and Users contain notes about scenarios from the previous version of the chat, which operate with limitations in the M1 interface.
Widgets
You can embed an application into the chat interface. By embedding, you can add an action next to the input field, a separate item in the chat sidebar, or an action in the context menu of a message.
- Item in the panel above the input field
IM_TEXTAREA - Item in the chat sidebar
IM_SIDEBAR - Item in the context menu of a message
IM_CONTEXT_MENU
To register an embedding point, use the method placement.bind and pass the required code in the PLACEMENT parameter.
Overview of Methods and Events
Scope:
imWho can execute the method: depending on the method
Main Chat Methods
|
Method |
Description |
|
Creates a chat |
|
|
Retrieves the chat identifier |
|
|
Retrieves chat data |
|
|
Retrieves a shortened list of recent chats |
|
|
Retrieves a list of chats |
|
|
Retrieves message and notification counters |
|
|
Retrieves API revisions for the IM module |
Chat Update
|
Method |
Description |
|
Changes the chat owner |
|
|
Changes the chat avatar |
|
|
Changes the chat color |
|
|
Changes the chat title |
Chat Participants
|
Method |
Description |
|
Adds participants to the chat |
|
|
Retrieves participant identifiers of the chat |
|
|
Retrieves the list of participants |
|
|
Removes participants from the chat |
|
|
Allows the current user to leave the chat |
Messages
|
Method |
Description |
|
Adds a message |
|
|
Modifies a sent message |
|
|
Deletes a message |
|
|
Changes the "like" status of a message |
|
|
Creates an object based on a message |
|
|
Executes a chat-bot command |
|
|
Retrieves the list of recent messages |
|
|
Searches for messages in the chat |
|
|
Marks messages as "read" |
|
|
Marks messages as "unread" |
|
|
Sends the "User is typing" status |
Notifications
|
Method |
Description |
|
Sends a notification |
|
|
Sends a personal notification |
|
|
Sends a system notification |
|
|
Returns user notifications |
|
|
Returns the schema of notification types |
|
|
Marks a list of notifications as read |
|
|
Marks a notification as read or returns it to unread |
|
|
Marks all notifications as read |
|
|
Responds to a notification with a quick reply |
|
|
Interacts with notification buttons |
|
|
Deletes notifications |
|
|
Searches through notification history |
Search
|
Method |
Description |
|
Searches chats by name |
|
|
Searches departments |
|
|
Searches users |
|
|
Adds search to history |
|
|
Retrieves search history |
|
|
Deletes search from history |
Departments
|
Method |
Description |
|
Retrieves information about a department |
|
|
Retrieves a list of department managers |
|
|
Retrieves a list of department employees |
|
|
Retrieves a list of colleagues of the current user |
Users
|
Method |
Description |
|
Retrieves user data |
|
|
Retrieves data about a list of users |
|
|
Sets the user's status in the chat |
|
|
Retrieves the user's set status |
|
|
Sets the automatic status "Away" |
|
|
Disables the automatic status "Away" |
Special Operations
|
Method |
Description |
|
Pins the chat at the top of the list |
|
|
Sets or removes the "read" status for the chat |
|
|
Marks all chats of the user as "read" |
|
|
Disables notifications from the chat |
|
|
Removes the chat from the recent list |
Files
|
Method |
Description |
|
Uploads a file to the chat |
|
|
Returns a link to download the file |
|
|
Adds a file to the chat |
|
|
Saves a file to your drive |
|
|
Deletes a file from the chat folder |
|
|
Retrieves the folder for storing chat files |
New API Events
|
Method |
Description |
|
Subscribes the current user to event logging |
|
|
Returns accumulated events |
|
|
Stops event logging |