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:
- im.v2.File.upload — uploads a file to the chat
- im.v2.File.download — returns a link to download the file
Quick navigation: new methods | legacy methods
How to Work with Files Now
Typical scenario:
- Upload the file to the chat using im.v2.File.upload.
- Use the obtained result in the application logic or chat interface.
- 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:
imWho can execute the methods: user or application with access to the messenger
|
Method |
Description |
|
Uploads a file to the chat |
|
|
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 |
|
Adds a file to the chat |
|
|
Saves a file to your Drive |
|
|
Deletes a file from the chat folder |
|
|
Obtains the chat file storage folder |