Get the List of Chats im.recent.list

Scope: im

Who 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
type

Description

SKIP_OPENLINES
string

Skip open channel chats.

Possible values:

  • Y — yes
  • N — no

SKIP_DIALOG
string

Skip one-on-one dialogs.

Possible values:

  • Y — yes
  • N — no

SKIP_CHAT
string

Skip group chats.

Possible values:

  • Y — yes
  • N — no

LAST_MESSAGE_DATE
datetime

Date of the last item from the previous selection in ATOM (ISO-8601) format

UNREAD_ONLY
string

Return only dialogs with unread messages.

Possible values:

  • Y — yes
  • N — no

PARSE_TEXT
string

Parse the text of the last message.

Possible values:

  • Y — yes
  • N — no

GET_ORIGINAL_TEXT
string

Return the original text of the message without transformations.

Possible values:

  • Y — yes
  • N — no

SKIP_UNDISTRIBUTED_OPENLINES
string

Skip undistributed open channel chats.

Possible values:

  • Y — yes
  • N — no

ONLY_COPILOT
string

Return only BitrixGPT chats.

Possible values:

  • Y — yes
  • N — no

ONLY_CHANNEL
string

Return only channels.

Possible values:

  • Y — yes
  • N — no

CAN_MANAGE_MESSAGES
string

Return only chats with message management rights.

Possible values:

  • Y — yes
  • N — no

OFFSET
integer

Offset for pagination. Default: 0

LIMIT
integer

Number of items per page. Default: 50. Maximum value: 200

Pagination Recommendations

  • To move to the next page, increase OFFSET by the value of LIMIT (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 of 200.

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
type

Description

result
object

Root object of the result (detailed description)

total
integer

Total number of items. In the current implementation, usually -1

time
time

Information about the request execution time

Object result-item

Name
type

Description

items
array

List of recent dialogs (detailed description)

hasMorePages
boolean

Deprecated alias for the field hasMore

hasMore
boolean

Indicator of the presence of the next page of the selection

copilot
object

Additional data for BitrixGPT elements (detailed description)

messagesAutoDeleteConfigs
array

Auto-deletion settings for messages by chats

Object items

Name
type

Description

id
string

Identifier of the dialog: number for user, chatXXX for chat

chat_id
integer

Identifier of the chat

type
string

Type of record: user or chat

avatar
object

Avatar object (detailed description)

title
string

Title of the record: user's name or chat name

message
object

Last message in the dialog (detailed description)

counter
integer

Counter of unread messages

last_id
integer

Identifier of the last read message

pinned
boolean

Indicator of a pinned dialog

unread
boolean

Indicator of a manual "unread" mark

has_reminder
boolean

Indicator of a set reminder

date_update
datetime

Date of the last change in the dialog in ISO 8601 format

date_last_activity
datetime

Date of the last activity in the dialog in ISO 8601 format

user
object

User data (detailed description)

chat
object

Chat data (detailed description)

lines
object

Open line data (detailed description)

options
array

Additional parameters of the record

Object avatar

Name
type

Description

url
string

Link to the avatar. If empty, the avatar is not set

color
string

Color of the dialog in HEX format

Object message

Name
type

Description

id
integer

Identifier of the message

text
string

Text of the message

file
boolean

Indicator of the presence of files

author_id
integer

Identifier of the message author

attach
boolean

Indicator of the presence of attachments

date
datetime

Date of the message in ATOM format

status
string

Status of message delivery

sticker
integer

Identifier of the sticker. If there is no sticker, the value is null

uuid
string

External identifier of the message. If not set, the value is null

Object user

Name
type

Description

id
integer

Identifier of the user

active
boolean

Indicator of an active user

name
string

User's full name

first_name
string

User's first name

last_name
string

User's last name

work_position
string

User's position

color
string

User's color in HEX format

avatar
string

Link to the avatar

avatar_hr
string

Link to high-resolution avatar

gender
string

User's gender

birthday
string

Birthday in DD-MM format or empty string

extranet
boolean

Indicator of an external extranet user

network
boolean

Indicator of a Bitrix24.Network user

bot
boolean

Indicator of a bot

connector
boolean

Indicator of an open line user

external_auth_id
string

External authorization code

status
string

User's status

idle
datetime

Date when the user stepped away from the computer. If not set, false

last_activity_date
datetime

Date of the user's last activity

mobile_last_date
datetime

Date of the last activity in the mobile application. If not set, false

desktop_last_date
datetime

Date of the last activity in the desktop application. If not set, false

absent
datetime

Date of the user's vacation. If not set, false

departments
array

List of user department identifiers

phones
object

User contact phones. Can be false

bot_data
object

Bot data. For a regular user, it can be null

type
string

Type of user

website
string

User's website

email
string

User's email

Object chat

Name
type

Description

id
integer

Identifier of the chat

parent_chat_id
integer

Identifier of the parent chat

parent_message_id
integer

Identifier of the parent message

name
string

Name of the chat

owner
integer

Identifier of the chat owner

extranet
boolean

Indicator of the participation of an external extranet user

contains_collaber
boolean

Indicator of the participation of collab users

avatar
string

Link to the avatar. If empty, the avatar is not set

color
string

Color of the chat in HEX format

type
string

Type of chat

entity_type
string

External code of the chat: type

entity_id
string

External code of the chat: identifier

entity_data_1
string

External data 1 for the chat

entity_data_2
string

External data 2 for the chat

entity_data_3
string

External data 3 for the chat

mute_list
array

List of users with notifications disabled

manager_list
array

List of chat manager identifiers

date_create
datetime

Date of chat creation in ATOM format

message_type
string

Type of chat messages

user_counter
integer

Number of chat participants

restrictions
object

Restrictions on actions in the chat (detailed description)

role
string

Current user's role in the chat

text_field_enabled
boolean

Availability of the message input field

background_id
integer

Identifier of the chat background. If not set, the value is null

entity_link
object

Link to the related object (detailed description)

permissions
object

Permissions for actions in the chat (detailed description)

public
string

Indicator of the chat's public status

Object lines

Name
type

Description

id
integer

Identifier of the open line

status
integer

Status of the open line

date_create
datetime

Date of open line creation in ATOM format

Object restrictions

Name
type

Description

avatar
boolean

Availability of avatar change

rename
boolean

Availability of name change

extend
boolean

Availability of chat extension

call
boolean

Availability of calls

mute
boolean

Availability of notifications mute

leave
boolean

Availability of leaving the chat

leave_owner
boolean

Availability of the owner leaving the chat

send
boolean

Availability of message sending

user_list
boolean

Availability of viewing the list of participants

Name
type

Description

type
string

Type of the related object

url
string

Link to the related object

id
string

Identifier of the related object

Object permissions

Name
type

Description

manage_users_add
string

Permission to add participants

manage_users_delete
string

Permission to remove participants

manage_ui
string

Permission to manage the chat interface

manage_settings
string

Permission to manage chat settings

manage_messages
string

Permission to manage messages

can_post
string

Permission to send messages

Object copilot

Name
type

Description

chats
object

Data for BitrixGPT chats. Can be null

messages
object

Data for BitrixGPT messages. Can be null

roles
object

Description of available BitrixGPT roles

recommendedRoles
array

List of recommended BitrixGPT roles

Error Handling

Name
type

Description

error
string

String error code. It may consist of digits, Latin letters, and underscores

error_description
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
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

405

ERROR_BATCH_METHOD_NOT_ALLOWED
Method is not allowed for batch usage

The current method is not allowed to be called using batch

400

ERROR_BATCH_LENGTH_EXCEEDED
Max batch length exceeded

The maximum length of parameters passed to the batch method has been exceeded

401

NO_AUTH_FOUND
Wrong authorization data

Invalid access token or webhook code

400

INVALID_REQUEST
Https required

The methods must be called using the HTTPS protocol

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is available only on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user whose access token or webhook was used to call the method lacks permissions

404

ERROR_MANIFEST_IS_NOT_AVAILABLE
Manifest is not available

The manifest is not available

403

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires higher privileges than those provided by the webhook token

401

expired_token
The access token provided has expired

The provided access token has expired

403

user_access_error
The user does not have access to the application

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

500

PORTAL_DELETED
Portal was deleted

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

Continue Learning