Files in Chats: 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.

Currently, the basic scenario for working with files in chats has become simpler: there is no need to separately obtain the chat folder, upload the file through Drive methods, and then link it to the message.

For new integrations, use the im.v2 methods:

Quick navigation: new methods | legacy methods

How to Work with Files Now

Typical scenario:

  1. Upload the file to the chat using im.v2.File.upload.
  2. Use the obtained result in the application logic or chat interface.
  3. When you need to provide the file to the user again, obtain the link via im.v2.File.download.

The im.v2.File.* methods belong to the new generation of the messenger API. They are recommended for use in new scenarios instead of the chain of calls to im.disk.* and Drive methods.

What Has Changed Compared to the Old Scenario

Previously, uploading a file often required a chain of several actions:

  • obtain the chat file storage folder
  • upload the file via Drive methods
  • link the uploaded file to the chat

Now, for most scenarios, direct methods are sufficient:

New Methods

Scope: im

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

Method

Description

im.v2.File.upload

Uploads a file to the chat

im.v2.File.download

Returns a link for downloading the file

Legacy Methods

If the integration is already built on the old scenario, you can use the im.disk.* methods:

Method

Description

im.disk.file.commit

Adds a file to the chat

im.disk.file.save

Saves a file to your Drive

im.disk.file.delete

Deletes a file from the chat folder

im.disk.folder.get

Obtains the chat file storage folder

Continue Learning