Chat Search: 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.search.* method group finds group chats, departments, and employees by a search phrase. The subsection is part of the Chats in Bitrix24 section.
Quick navigation: all methods
User documentation: Chats in Bitrix24: Design and features
What to Search For and With Which Method
|
What You Need to Find |
Method |
How It Searches |
|
A group chat |
By the beginning of words in the chat title and in the names of participants. The separate |
|
|
A company department |
By the beginning of words in the full name of the department, including the names of the parent departments |
|
|
An employee |
By the beginning of words in the first name, last name, position, and department |
|
|
A message inside a chat |
By the message text within one chat. A method of the Messages subsection |
|
|
A notification in the history |
By the text, type, date, and tag of the notification. A method of the Notifications subsection |
|
|
A chat in the recent list |
Without a search phrase: the method returns the whole list of recent chats |
Limits and Response Format
The rules below apply to the three search methods — im.search.chat.list, im.search.department.list, and im.search.user.list. The search history methods im.search.last.* have neither a search phrase nor pagination.
- the search runs against the beginning of words, not an arbitrary substring: "Proj" finds "Project Chat", while "roject" does not
- im.search.chat.list and im.search.user.list require at least two characters: for a shorter phrase they return the
FIND_SHORTerror - im.search.department.list behaves differently: it returns the
FIND_SHORTerror only if theFINDparameter is not provided at all. An empty or very short phrase switches the filter off, and the method returns the whole list of departments — check the phrase length on your side - when both
FINDandFIND_LINESare provided, im.search.chat.list gives priority toFINDand does not search Open Channels - the selection is paginated: the offset is set by
OFFSET, and the page size byLIMIT. The response containstotal, andnextif there is a next page - the response fields are returned in
snake_case - the response shapes differ: im.search.chat.list and im.search.department.list return
resultas an array, while im.search.user.list returns an object where the key of each element equals the user identifier. For all three, an empty selection comes back as an empty array
Relationship with Other Objects
Chat. The search method returns the id of a chat. Substitute it into DIALOG_ID in the chatXXX format to send a message with the im.message.add method, or into CHAT_ID of the methods of the Chat Participants subsection. The data of the found chat is returned by im.dialog.get.
User. The found id of an employee is suitable for a private dialogue: pass it into DIALOG_ID as a number. The same identifier is accepted by the methods of the Users in Chats subsection and by the USERS parameter of the im.chat.user.add method.
Department. The found id of a department is accepted by the methods of the Departments subsection — they return the managers and employees of the department. The identifier is passed as an array: ID: [107].
Overview of Methods
Scope:
im
Who can execute the method: any user
Current Methods
The methods are recommended for new development.
|
Method |
Description |
|
Searches for chats by names |
|
|
Searches for departments |
|
|
Searches for users |
Deprecated Methods
The im.search.last.* methods store the history of a user's search queries. They are deprecated: designed for the previous version of the chat and kept only to support existing integrations. In the current M1 chat version, the methods work, but the results are not displayed in the interface — more about the current version in the article Bitrix24 Chat: new messenger. There is no replacement for them.
|
Method |
Description |
|
Adds search to history |
|
|
Retrieves search history |
|
|
Deletes search from history |