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.

  1. Subscribe to event records via im.v2.Event.subscribe.
  2. Periodically retrieve new events via im.v2.Event.get.
  3. Pass offset to confirm already processed events.
  4. 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

Overview of Methods

Scope: im

Who can execute the methods: user or application with access to the messenger

Events

Method

Description

im.v2.Event.subscribe

Subscribes to event records

im.v2.Event.unsubscribe

Stops event recording

im.v2.Event.get

Returns events in polling mode

im.v2 Events

Description of event formats and payload structure

Files

Method

Description

im.v2.File.upload

Uploads a file to the chat

im.v2.File.download

Returns a link for downloading the file

Continue Your Learning