Get a Shortened List of Recent Chats im.recent.get
Scope:
imWho can execute the method: any user
The method im.recent.get retrieves a list of the user's recent chats.
Method Parameters
|
Name |
Description |
|
SKIP_OPENLINES |
Skip chats from Open Channels. Possible values:
|
|
SKIP_CHAT |
Skip group chats. Possible values:
|
|
SKIP_DIALOG |
Skip one-on-one dialogs. Possible values:
|
|
LAST_UPDATE |
Retrieve data from the specified date in ATOM (ISO-8601) format |
|
ONLY_OPENLINES |
Select only chats from Open Channels. Possible values:
|
|
LAST_SYNC_DATE |
Date of the previous retrieval in ATOM (ISO-8601) format to load changes that occurred in the list since the specified date. The retrieval returns data no older than 7 days |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"SKIP_OPENLINES":"Y","LAST_UPDATE":"2026-02-25T18:30:00+01:00"}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/im.recent.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"SKIP_OPENLINES":"Y","LAST_UPDATE":"2026-02-25T18:30:00+01:00","auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/im.recent.get
try
{
const response = await $b24.callMethod(
'im.recent.get',
{
SKIP_OPENLINES: 'Y',
LAST_UPDATE: '2026-02-25T18:30:00+01:00'
}
);
console.log(response.getData().result);
}
catch (error)
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'im.recent.get',
[
'SKIP_OPENLINES' => 'Y',
'LAST_UPDATE' => '2026-02-25T18:30:00+01:00',
]
);
$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.get',
{
SKIP_OPENLINES: 'Y',
LAST_UPDATE: '2026-02-25T18:30:00+01:00'
},
function(result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'im.recent.get',
[
'SKIP_OPENLINES' => 'Y',
'LAST_UPDATE' => '2026-02-25T18:30:00+01:00',
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": [
{
"id": "chat1451",
"chat_id": 1451,
"type": "chat",
"avatar": {
"url": "",
"color": "#df532d"
},
"title": "Maximally Complete Task Template",
"message": {
"id": 84501,
"text": "John Doe created a task [Attachment]",
"file": false,
"author_id": 0,
"attach": true,
"sticker": null,
"date": "2026-02-26T00:01:26+03:00",
"status": "received",
"uuid": null
},
"counter": 0,
"last_id": 84501,
"pinned": false,
"unread": false,
"has_reminder": false,
"date_update": "2026-02-26T00:01:26+03:00",
"date_last_activity": "2026-02-26T00:01:26+03:00",
"chat": {
"id": 1451,
"parent_chat_id": 0,
"parent_message_id": 0,
"name": "Maximally Complete Task Template",
"owner": 503,
"extranet": false,
"contains_collaber": false,
"avatar": "",
"color": "#df532d",
"type": "tasksTask",
"entity_type": "TASKS_TASK",
"entity_id": "8293",
"entity_data_1": "",
"entity_data_2": "",
"entity_data_3": "",
"mute_list": [],
"manager_list": [
503
],
"date_create": "2026-02-26T00:01:26+03:00",
"message_type": "X",
"user_counter": 4,
"restrictions": {
"avatar": true,
"rename": true,
"extend": true,
"call": true,
"mute": true,
"leave": true,
"leave_owner": true,
"send": true,
"user_list": true
},
"role": "OWNER",
"text_field_enabled": true,
"background_id": null,
"entity_link": {
"type": "TASKS",
"url": "/company/personal/user/503/tasks/task/view/8293/?ta_sec=chat_tasks&ta_el=view_button",
"id": "8293"
},
"permissions": {
"manage_users_add": "member",
"manage_users_delete": "manager",
"manage_ui": "member",
"manage_settings": "owner",
"manage_messages": "member",
"can_post": "member"
},
"public": ""
},
"user": {
"id": 0
},
"options": []
},
{
"id": "chat1449",
"chat_id": 1449,
"type": "chat",
"avatar": {
"url": "",
"color": "#ab7761"
},
"title": "Maximally Complete Task Template",
"message": {
"id": 84499,
"text": "John Doe created a task [Attachment]",
"file": false,
"author_id": 0,
"attach": true,
"sticker": null,
"date": "2026-02-26T00:01:25+03:00",
"status": "received",
"uuid": null
},
"counter": 0,
"last_id": 84499,
"pinned": false,
"unread": false,
"has_reminder": false,
"date_update": "2026-02-26T00:01:25+03:00",
"date_last_activity": "2026-02-26T00:01:25+03:00",
"chat": {
"id": 1449,
"parent_chat_id": 0,
"parent_message_id": 0,
"name": "Maximally Complete Task Template",
"owner": 503,
"extranet": false,
"contains_collaber": false,
"avatar": "",
"color": "#ab7761",
"type": "tasksTask",
"entity_type": "TASKS_TASK",
"entity_id": "8291",
"entity_data_1": "",
"entity_data_2": "",
"entity_data_3": "",
"mute_list": [],
"manager_list": [
503
],
"date_create": "2026-02-26T00:01:25+03:00",
"message_type": "X",
"user_counter": 4,
"restrictions": {
"avatar": true,
"rename": true,
"extend": true,
"call": true,
"mute": true,
"leave": true,
"leave_owner": true,
"send": true,
"user_list": true
},
"role": "OWNER",
"text_field_enabled": true,
"background_id": null,
"entity_link": {
"type": "TASKS",
"url": "/company/personal/user/503/tasks/task/view/8291/?ta_sec=chat_tasks&ta_el=view_button",
"id": "8291"
},
"permissions": {
"manage_users_add": "member",
"manage_users_delete": "manager",
"manage_ui": "member",
"manage_settings": "owner",
"manage_messages": "member",
"can_post": "member"
},
"public": ""
},
"user": {
"id": 0
},
"options": []
}
],
"time": {
"start": 1772086038,
"finish": 1772086038.652287,
"duration": 0.6522870063781738,
"processing": 0,
"date_start": "2026-02-26T09:07:18+03:00",
"date_finish": "2026-02-26T09:07:18+03:00",
"operating_reset_at": 1772086638,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
List of recent dialogs (detailed description) |
|
time |
Information about the request execution time |
Object result-item
|
Name |
Description |
|
id |
Identifier of the dialog: number for user, |
|
type |
Type of record: |
|
avatar |
Object describing the avatar of the record (detailed description) |
|
title |
Title of the record: first and last name for user, chat name for chat |
|
message |
Object describing the last message (detailed description) |
|
counter |
Unread message counter |
|
chat_id |
Chat identifier |
|
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 record update in the recent list in ATOM format |
|
date_last_activity |
Date of the last activity in the dialog in ATOM format |
|
user |
Object describing the user. Not available for records of type |
|
chat |
Object describing the chat. Not available for records of type |
|
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 without BB codes and line breaks |
|
file |
Indicator of the presence of files |
|
attach |
Indicator of the presence of attachments |
|
author_id |
Identifier of the message author |
|
date |
Date of the message in ATOM format |
|
sticker |
Identifier of the sticker. If there is no sticker, the value is |
|
status |
Delivery status of the message |
|
uuid |
External identifier of the message. If not set, the value is |
Object user
|
Name |
Description |
|
id |
Identifier of the user |
|
name |
User's full name |
|
first_name |
User's first name |
|
last_name |
User's last name |
|
work_position |
User's job title |
|
color |
User's color in HEX format |
|
avatar |
Link to the avatar. If empty, the avatar is not set |
|
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 a user from Open Channels |
|
external_auth_id |
External authorization code |
|
status |
Selected status of the user |
|
idle |
Date when the user stepped away from the computer, in ATOM format. If not set, |
|
last_activity_date |
Date of the user's last action in ATOM format |
|
mobile_last_date |
Date of the last action in the mobile application in ATOM format. If not set, |
|
absent |
Date until which the user is on vacation, in ATOM format. If not set, |
Object chat
|
Name |
Description |
|
id |
Identifier of the chat |
|
title |
Title of the chat |
|
name |
Name of the chat (field from the response) |
|
owner |
Identifier of the chat owner |
|
extranet |
Indicator of the participation of an external extranet user in the chat |
|
parent_chat_id |
Identifier of the parent chat |
|
parent_message_id |
Identifier of the parent message |
|
contains_collaber |
Indicator of the participation of collaborator users |
|
color |
Color of the chat in HEX format |
|
avatar |
Link to the avatar. If empty, the avatar is not set |
|
type |
Type of chat: group, call, open line, etc. |
|
entity_type |
External code for the chat: type |
|
entity_id |
External code for the chat: identifier |
|
entity_data_1 |
External data for the chat |
|
entity_data_2 |
External data for the chat |
|
entity_data_3 |
External data for the chat |
|
date_create |
Date of chat creation in ATOM format |
|
message_type |
Type of chat messages |
|
mute_list |
List of users who have disabled notifications |
|
manager_list |
List of chat manager identifiers |
|
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 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 notification disabling |
|
leave |
Availability of leaving the chat |
|
leave_owner |
Availability of the owner leaving the chat |
|
send |
Availability of sending messages |
|
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 |
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 allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks 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 account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |