bitrix24_im_chat_messages
Read messages from Bitrix24 IM chats including task, group, and 1-on-1 dialogs. Returns text, attachments, and inline images for a clear view.
Instructions
Read messages from a Bitrix24 IM chat. Use for reading task chats, group chats, or 1-on-1 dialogs. For task chats, the DIALOG_ID is 'chatNNN' where NNN is the task's chatId field. Messages with attachments carry a 'files' array (fileId, name, type, dimensions); image attachments are inlined as viewable images by default so you see what a human reading the chat sees. Non-image files and over-sized images are listed by metadata — fetch them with bitrix24_im_file_get. ⚠️ TEXT FIELDS: 'text' is the display-rendered form with BBCode/HTML stripped — it is LOSSY. A message containing [URL=https://…]#146426[/URL] comes back as bare '#146426', and [USER=…] mentions and [B]bold[/B] are flattened the same way. When the original markup exists, the message also carries 'textRaw' with it intact. NEVER rebuild a message for bitrix24_im_message_update from 'text' — you will silently destroy every link, mention and format in it (caught 2026-07-24: an edited ads report lost all 8 CRM deep links). Edit from 'textRaw', or re-author the BBCode explicitly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max messages to return (default: 20) | |
| firstId | No | Message ID to start from (for pagination — pass the smallest ID from previous response to go further back in history) | |
| dialogId | Yes | Dialog ID: 'chatNNN' for group/task chats, or user ID as string for 1-on-1 | |
| maxImages | No | Cap on inlined images per read (default: 20). | |
| includeImages | No | Inline image attachments as viewable images (default: true). Set false for a text-only, lower-token read. |