Working with Chat: 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 im.v2 methods allow you to receive user events while working with chats and manage files in chats without registering a separate chat bot.
The im.v2 section contains next-generation methods for working with chats. Currently, there are fewer methods than in the main section, but they will gradually replace the existing implementations.
If you need the already existing messenger methods, use the section Chats with User.
Quick navigation: all methods
Working with Events
User events in im.v2 do not support webhook mode, unlike chat bot events. Events in this section are only available through polling: the application periodically retrieves the accumulated queue after subscribing to event records via the im.v2.Event.* methods.
- Subscribe to event records via im.v2.Event.subscribe.
- Periodically retrieve new events via im.v2.Event.get.
- Pass
offsetto confirm already processed events. - To stop recording, use im.v2.Event.unsubscribe.
What is polling mode
Polling is an event retrieval mode where the application periodically requests accumulated events from the server. The server does not know the application's address and does not send anything on its own—it only accumulates the queue and delivers it upon request.
This distinguishes polling from webhook: in webhook mode, Bitrix24 calls the application's URL with each new event. Polling is convenient if the application does not have a permanent HTTP server or public URL.
Working with Files
- Upload a file to the chat via im.v2.File.upload
- Get a download link for the uploaded file via im.v2.File.download
Overview of Methods
Scope:
imWho can execute the methods: user or application with access to the messenger
Events
|
Method |
Description |
|
Subscribes to event records |
|
|
Stops event recording |
|
|
Returns events in polling mode |
|
|
Description of event formats and payload structure |
Files
|
Method |
Description |
|
Uploads a file to the chat |
|
|
Returns a link for downloading the file |