Get the List of Chats im.recent.list
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.
Scope:
imWho can execute the method: any user
The method im.recent.list retrieves a list of the user's recent conversations with pagination support.
Method Parameters
|
Name |
Description |
|
SKIP_OPENLINES |
Skip open channel chats. Possible values:
|
|
SKIP_DIALOG |
Skip one-on-one dialogs. Possible values:
|
|
SKIP_CHAT |
Skip group chats. Possible values:
|
|
LAST_MESSAGE_DATE |
Date of the last item from the previous selection in ATOM (ISO-8601) format |
|
UNREAD_ONLY |
Return only dialogs with unread messages. Possible values:
|
|
PARSE_TEXT |
Parse the text of the last message. Possible values:
|
|
GET_ORIGINAL_TEXT |
Return the original text of the message without transformations. Possible values:
|
|
SKIP_UNDISTRIBUTED_OPENLINES |
Skip undistributed open channel chats. Possible values:
|
|
ONLY_COPILOT |
Return only BitrixGPT chats. Possible values:
|
|
ONLY_CHANNEL |
Return only channels. Possible values:
|
|
CAN_MANAGE_MESSAGES |
Return only chats with message management rights. Possible values:
|
|
OFFSET |
Offset for pagination. Default: |
|
LIMIT |
Number of items per page. Default: |
Pagination Recommendations
-
To move to the next page, increase
OFFSETby the value ofLIMIT(0,50,100), not by the number of items in the response. -
The same dialogs may repeat between pages because the selection is initially built on internal records and then collapsed into unique dialogs. As a result, page boundaries may overlap.
-
If open channel chats are not needed, pass
SKIP_OPENLINES = Y— this reduces the likelihood of overlaps between pages. -
If the list is small, request it in a single call with an increased
LIMIT, with a maximum value of200.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"LAST_MESSAGE_DATE":"2026-02-25T18:30:00+01:00","SKIP_OPENLINES":"N","SKIP_DIALOG":"N","SKIP_CHAT":"N","UNREAD_ONLY":"Y","PARSE_TEXT":"Y","GET_ORIGINAL_TEXT":"N","SKIP_UNDISTRIBUTED_OPENLINES":"Y","ONLY_COPILOT":"N","ONLY_CHANNEL":"N","CAN_MANAGE_MESSAGES":"Y","OFFSET":0,"LIMIT":20}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/im.recent.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"LAST_MESSAGE_DATE":"2026-02-25T18:30:00+01:00","SKIP_OPENLINES":"N","SKIP_DIALOG":"N","SKIP_CHAT":"N","UNREAD_ONLY":"Y","PARSE_TEXT":"Y","GET_ORIGINAL_TEXT":"N","SKIP_UNDISTRIBUTED_OPENLINES":"Y","ONLY_COPILOT":"N","ONLY_CHANNEL":"N","CAN_MANAGE_MESSAGES":"Y","OFFSET":0,"LIMIT":20,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/im.recent.list
try
{
const response = await $b24.callMethod(
'im.recent.list',
{
LAST_MESSAGE_DATE: '2026-02-25T18:30:00+01:00',
SKIP_OPENLINES: 'N',
SKIP_DIALOG: 'N',
SKIP_CHAT: 'N',
UNREAD_ONLY: 'Y',
PARSE_TEXT: 'Y',
GET_ORIGINAL_TEXT: 'N',
SKIP_UNDISTRIBUTED_OPENLINES: 'Y',
ONLY_COPILOT: 'N',
ONLY_CHANNEL: 'N',
CAN_MANAGE_MESSAGES: 'Y',
OFFSET: 0,
LIMIT: 20
}
);
console.log(response.getData().result);
}
catch (error)
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'im.recent.list',
[
'LAST_MESSAGE_DATE' => '2026-02-25T18:30:00+01:00',
'SKIP_OPENLINES' => 'N',
'SKIP_DIALOG' => 'N',
'SKIP_CHAT' => 'N',
'UNREAD_ONLY' => 'Y',
'PARSE_TEXT' => 'Y',
'GET_ORIGINAL_TEXT' => 'N',
'SKIP_UNDISTRIBUTED_OPENLINES' => 'Y',
'ONLY_COPILOT' => 'N',
'ONLY_CHANNEL' => 'N',
'CAN_MANAGE_MESSAGES' => 'Y',
'OFFSET' => 0,
'LIMIT' => 20,
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
BX24.callMethod(
'im.recent.list',
{
LAST_MESSAGE_DATE: '2026-02-25T18:30:00+01:00',
SKIP_OPENLINES: 'N',
SKIP_DIALOG: 'N',
SKIP_CHAT: 'N',
UNREAD_ONLY: 'Y',
PARSE_TEXT: 'Y',
GET_ORIGINAL_TEXT: 'N',
SKIP_UNDISTRIBUTED_OPENLINES: 'Y',
ONLY_COPILOT: 'N',
ONLY_CHANNEL: 'N',
CAN_MANAGE_MESSAGES: 'Y',
OFFSET: 0,
LIMIT: 20
},
function(result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'im.recent.list',
[
'LAST_MESSAGE_DATE' => '2026-02-25T18:30:00+01:00',
'SKIP_OPENLINES' => 'N',
'SKIP_DIALOG' => 'N',
'SKIP_CHAT' => 'N',
'UNREAD_ONLY' => 'Y',
'PARSE_TEXT' => 'Y',
'GET_ORIGINAL_TEXT' => 'N',
'SKIP_UNDISTRIBUTED_OPENLINES' => 'Y',
'ONLY_COPILOT' => 'N',
'ONLY_CHANNEL' => 'N',
'CAN_MANAGE_MESSAGES' => 'Y',
'OFFSET' => 0,
'LIMIT' => 20,
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": {
"items": [
{
"id": 547,
"chat_id": 1231,
"type": "user",
"avatar": {
"url": "",
"color": "#1eb4aa"
},
"title": "John Doe",
"message": {
"id": 84415,
"text": "ntcn",
"file": false,
"author_id": 547,
"attach": false,
"sticker": null,
"date": "2026-02-25T12:07:10+01:00",
"status": "received",
"uuid": "0c3c5ad6-a1b8-4d4d-9234-f137ef862a77"
},
"counter": 1,
"last_id": 82363,
"pinned": false,
"unread": false,
"has_reminder": false,
"date_update": "2026-02-25T12:07:10+01:00",
"date_last_activity": "2026-02-25T12:07:10+01:00",
"user": {
"id": 547,
"active": true,
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"work_position": "Tester",
"color": "#1eb4aa",
"avatar": "",
"avatar_hr": "/bitrix/js/im/images/blank.gif",
"gender": "M",
"birthday": "",
"extranet": false,
"network": false,
"bot": false,
"connector": false,
"external_auth_id": "socservices",
"status": "online",
"idle": false,
"last_activity_date": "2026-02-25T17:42:27+01:00",
"mobile_last_date": false,
"desktop_last_date": false,
"absent": false,
"departments": [
1,
667
],
"phones": false,
"bot_data": null,
"type": "user",
"website": "",
"email": "john.doe@mysite.com"
},
"chat": {
"text_field_enabled": true,
"background_id": null,
"mute_list": []
},
"options": []
},
{
"id": "chat1317",
"chat_id": 1317,
"type": "chat",
"avatar": {
"url": "https://cdn.com.bitrix24.com/b17053/resize_cache/54309/ff58db95aecdfa09ae61b51b5fd8f63f/im/553/5539ce72ef842ca40efd35b54322d828/7qd8lz4rsqwubjru086fst8tx6uhkxa9",
"color": "#4ba984"
},
"title": "I want a green chat",
"message": {
"id": 84413,
"text": "ntcn",
"file": false,
"author_id": 547,
"attach": false,
"sticker": null,
"date": "2026-02-25T12:07:05+01:00",
"status": "received",
"uuid": "f4721d3d-68c6-473e-a899-3b96b0ee18db"
},
"counter": 1,
"last_id": 82447,
"pinned": false,
"unread": false,
"has_reminder": false,
"date_update": "2026-02-25T12:07:05+01:00",
"date_last_activity": "2026-02-25T12:07:05+01:00",
"chat": {
"id": 1317,
"parent_chat_id": 0,
"parent_message_id": 0,
"name": "I want a green chat",
"owner": 547,
"extranet": false,
"contains_collaber": false,
"avatar": "https://cdn.com.bitrix24.com/b17053/resize_cache/54309/ff58db95aecdfa09ae61b51b5fd8f63f/im/553/5539ce72ef842ca40efd35b54322d828/7qd8lz4rsqwubjru086fst8tx6uhkxa9",
"color": "#4ba984",
"type": "chat",
"entity_type": "",
"entity_id": "",
"entity_data_1": "",
"entity_data_2": "",
"entity_data_3": "",
"mute_list": {
"503": true
},
"manager_list": [],
"date_create": "2025-08-12T16:14:00+01:00",
"message_type": "C",
"user_counter": 2,
"restrictions": {
"avatar": true,
"rename": true,
"extend": true,
"call": true,
"mute": true,
"leave": true,
"leave_owner": true,
"send": true,
"user_list": true
},
"role": "MEMBER",
"text_field_enabled": true,
"background_id": null,
"entity_link": {
"type": "",
"url": "",
"id": ""
},
"permissions": {
"manage_users_add": "member",
"manage_users_delete": "manager",
"manage_ui": "member",
"manage_settings": "owner",
"manage_messages": "member",
"can_post": "member"
},
"public": ""
},
"user": {
"id": 547,
"active": true,
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"work_position": "Tester",
"color": "#1eb4aa",
"avatar": "",
"avatar_hr": "/bitrix/js/im/images/blank.gif",
"gender": "M",
"birthday": "",
"extranet": false,
"network": false,
"bot": false,
"connector": false,
"external_auth_id": "socservices",
"status": "online",
"idle": false,
"last_activity_date": "2026-02-25T17:42:27+01:00",
"mobile_last_date": false,
"desktop_last_date": false,
"absent": false,
"departments": [
1,
667
],
"phones": false,
"bot_data": null,
"type": "user",
"website": "",
"email": "john.doe@mysite.com"
},
"options": []
}
],
"hasMorePages": false,
"hasMore": false,
"copilot": {
"chats": null,
"messages": null,
"roles": {
"copilot_assistant": {
"code": "copilot_assistant",
"name": "BitrixGPT",
"desc": "Ready to answer all questions in a general format",
"avatar": {
"small": "https://preview.bitrix24.site/upload/ai/avatars/5f72dd53304450356e0eaf09c0fcda7b_64x64.png",
"medium": "https://preview.bitrix24.site/upload/ai/avatars/f62609ab98ede5b3d4bff7675cc9f1f5_128x128.png",
"large": "https://preview.bitrix24.site/upload/ai/avatars/0a89c642ed5f1c2a292f7c3a1eab99d3_256x256.png"
},
"default": true,
"prompts": [
{
"code": "universal_how_to_properly_write_a_business_letter",
"promptType": "default",
"title": "How to properly write a business letter?",
"text": "How to properly write a business letter?",
"isNew": false
},
{
"code": "universal_effective_methods_to_combat_procrastination_in_the_workplace",
"promptType": "default",
"title": "How to combat procrastination?",
"text": "Tell me about effective methods to combat procrastination in the workplace",
"isNew": false
},
{
"code": "universal_ideas_on_how_to_make_meetings_more_concise_and_substantive",
"promptType": "default",
"title": "Ideas for meetings",
"text": "Do you have ideas on how to make meetings more concise and substantive?",
"isNew": false
},
{
"code": "universal_ideas_for_short_breaks_for_physical_exercises",
"promptType": "default",
"title": "Ideas for short breaks",
"text": "Suggest ideas for short breaks for physical exercises in the office",
"isNew": false
}
]
},
... // description of other roles
},
"recommendedRoles": [
"copilot_assistant",
"smm_manager",
"seo_copywriter",
"prompt_generator",
"marketing_specialist"
]
},
"messagesAutoDeleteConfigs": []
},
"total": -1,
"time": {
"start": 1772089843,
"finish": 1772089843.789026,
"duration": 0.7890260219573975,
"processing": 0,
"date_start": "2026-02-26T10:10:43+01:00",
"date_finish": "2026-02-26T10:10:43+01:00",
"operating_reset_at": 1772090443,
"operating": 0.2634410858154297
}
}
Returned Data
|
Name |
Description |
|
result |
Root object of the result (detailed description) |
|
total |
Total number of items. In the current implementation, usually |
|
time |
Information about the request execution time |
Object result-item
|
Name |
Description |
|
items |
List of recent dialogs (detailed description) |
|
hasMorePages |
Deprecated alias for the field |
|
hasMore |
Indicator of the presence of the next page of the selection |
|
copilot |
Additional data for BitrixGPT elements (detailed description) |
|
messagesAutoDeleteConfigs |
Auto-deletion settings for messages by chats |
Object items
|
Name |
Description |
|
id |
Identifier of the dialog: number for user, |
|
chat_id |
Identifier of the chat |
|
type |
Type of record: |
|
avatar |
Avatar object (detailed description) |
|
title |
Title of the record: user's name or chat name |
|
message |
Last message in the dialog (detailed description) |
|
counter |
Counter of unread messages |
|
last_id |
Identifier of the last read message |
|
pinned |
Indicator of a pinned dialog |
|
unread |
Indicator of a manual "unread" mark |
|
has_reminder |
Indicator of a set reminder |
|
date_update |
Date of the last change in the dialog in ISO 8601 format |
|
date_last_activity |
Date of the last activity in the dialog in ISO 8601 format |
|
user |
User data (detailed description) |
|
chat |
Chat data (detailed description) |
|
lines |
Open line data (detailed description) |
|
options |
Additional parameters of the record |
Object avatar
|
Name |
Description |
|
url |
Link to the avatar. If empty, the avatar is not set |
|
color |
Color of the dialog in HEX format |
Object message
|
Name |
Description |
|
id |
Identifier of the message |
|
text |
Text of the message |
|
file |
Indicator of the presence of files |
|
author_id |
Identifier of the message author |
|
attach |
Indicator of the presence of attachments |
|
date |
Date of the message in ATOM format |
|
status |
Status of message delivery |
|
sticker |
Identifier of the sticker. If there is no sticker, the value is |
|
uuid |
External identifier of the message. If not set, the value is |
Object user
|
Name |
Description |
|
id |
Identifier of the user |
|
active |
Indicator of an active user |
|
name |
User's full name |
|
first_name |
User's first name |
|
last_name |
User's last name |
|
work_position |
User's position |
|
color |
User's color in HEX format |
|
avatar |
Link to the avatar |
|
avatar_hr |
Link to high-resolution avatar |
|
gender |
User's gender |
|
birthday |
Birthday in |
|
extranet |
Indicator of an external extranet user |
|
network |
Indicator of a Bitrix24.Network user |
|
bot |
Indicator of a bot |
|
connector |
Indicator of an open line user |
|
external_auth_id |
External authorization code |
|
status |
User's status |
|
idle |
Date when the user stepped away from the computer. If not set, |
|
last_activity_date |
Date of the user's last activity |
|
mobile_last_date |
Date of the last activity in the mobile application. If not set, |
|
desktop_last_date |
Date of the last activity in the desktop application. If not set, |
|
absent |
Date of the user's vacation. If not set, |
|
departments |
List of user department identifiers |
|
phones |
User contact phones. Can be |
|
bot_data |
Bot data. For a regular user, it can be |
|
type |
Type of user |
|
website |
User's website |
|
email |
User's email |
Object chat
|
Name |
Description |
|
id |
Identifier of the chat |
|
parent_chat_id |
Identifier of the parent chat |
|
parent_message_id |
Identifier of the parent message |
|
name |
Name of the chat |
|
owner |
Identifier of the chat owner |
|
extranet |
Indicator of the participation of an external extranet user |
|
contains_collaber |
Indicator of the participation of collab users |
|
avatar |
Link to the avatar. If empty, the avatar is not set |
|
color |
Color of the chat in HEX format |
|
type |
Type of chat |
|
entity_type |
External code of the chat: type |
|
entity_id |
External code of the chat: identifier |
|
entity_data_1 |
External data 1 for the chat |
|
entity_data_2 |
External data 2 for the chat |
|
entity_data_3 |
External data 3 for the chat |
|
mute_list |
List of users with notifications disabled |
|
manager_list |
List of chat manager identifiers |
|
date_create |
Date of chat creation in ATOM format |
|
message_type |
Type of chat messages |
|
user_counter |
Number of chat participants |
|
restrictions |
Restrictions on actions in the chat (detailed description) |
|
role |
Current user's role in the chat |
|
text_field_enabled |
Availability of the message input field |
|
background_id |
Identifier of the chat background. If not set, the value is |
|
entity_link |
Link to the related object (detailed description) |
|
permissions |
Permissions for actions in the chat (detailed description) |
|
public |
Indicator of the chat's public status |
Object lines
|
Name |
Description |
|
id |
Identifier of the open line |
|
status |
Status of the open line |
|
date_create |
Date of open line creation in ATOM format |
Object restrictions
|
Name |
Description |
|
avatar |
Availability of avatar change |
|
rename |
Availability of name change |
|
extend |
Availability of chat extension |
|
call |
Availability of calls |
|
mute |
Availability of notifications mute |
|
leave |
Availability of leaving the chat |
|
leave_owner |
Availability of the owner leaving the chat |
|
send |
Availability of message sending |
|
user_list |
Availability of viewing the list of participants |
Object entity_link
|
Name |
Description |
|
type |
Type of the related object |
|
url |
Link to the related object |
|
id |
Identifier of the related object |
Object permissions
|
Name |
Description |
|
manage_users_add |
Permission to add participants |
|
manage_users_delete |
Permission to remove participants |
|
manage_ui |
Permission to manage the chat interface |
|
manage_settings |
Permission to manage chat settings |
|
manage_messages |
Permission to manage messages |
|
can_post |
Permission to send messages |
Object copilot
|
Name |
Description |
|
chats |
Data for BitrixGPT chats. Can be |
|
messages |
Data for BitrixGPT messages. Can be |
|
roles |
Description of available BitrixGPT roles |
|
recommendedRoles |
List of recommended BitrixGPT roles |
Error Handling
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not permitted for calls using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The HTTPS protocol is required for method calls |
|
|
|
The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it |
|
|
|
The REST API is only available on commercial plans |
|
|
|
The user associated with the access token or webhook used to call the method lacks the necessary permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the portal administrator has restricted access to this application to specific users only |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Get a Shortened List of Recent Chats im.recent.get
- Get Chat Data im.dialog.get
- Get Counters im.counters.get