Get Chat Data im.dialog.get

Scope: im

Who can execute the method: any user — chat participant

The method im.dialog.get retrieves information about a chat.

Method Parameters

Required parameters are marked with *

Name
type

Description

DIALOG_ID*
string

Chat identifier in the format:

  • chatXXX — chat
  • sgXXX — group or project chat
  • XXX — personal chat user identifier

Examples: chat1435, sg103

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"DIALOG_ID":"chat1435"}' \
          https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/im.dialog.get
        
curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"DIALOG_ID":"chat1435","auth":"**put_access_token_here**"}' \
          https://**put_your_bitrix24_address**/rest/im.dialog.get
        
try
        {
            const response = await $b24.callMethod(
                'im.dialog.get',
                {
                    DIALOG_ID: 'chat1435'
                }
            );
        
            console.log(response.getData().result);
        }
        catch (error)
        {
            console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'im.dialog.get',
                    [
                        'DIALOG_ID' => 'chat1435',
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'im.dialog.get',
            {
                DIALOG_ID: 'chat1435'
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'im.dialog.get',
            [
                'DIALOG_ID' => 'chat1435',
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        

Response Handling

HTTP Status: 200

{
            "result": {
                "id": 1439,
                "parent_chat_id": 0,
                "parent_message_id": 0,
                "name": "Deal Chat",
                "description": "Discussion about the deal",
                "owner": 503,
                "extranet": false,
                "avatar": "",
                "color": "#f76187",
                "type": "crm",
                "counter": 0,
                "user_counter": 3,
                "message_count": 3,
                "unread_id": 0,
                "restrictions": {
                    "avatar": false,
                    "rename": false,
                    "extend": true,
                    "call": true,
                    "mute": true,
                    "leave": true,
                    "leave_owner": false,
                    "send": true,
                    "user_list": true,
                    "path": "",
                    "path_title": ""
                },
                "last_message_id": 84477,
                "last_id": 84477,
                "marked_id": 0,
                "disk_folder_id": 0,
                "entity_type": "CRM",
                "entity_id": "DEAL|1663",
                "entity_data_1": "",
                "entity_data_2": "",
                "entity_data_3": "",
                "mute_list": [],
                "date_create": "2026-02-25T16:50:58+01:00",
                "message_type": "C",
                "public": "",
                "role": "owner",
                "entity_link": {
                    "type": "DEAL",
                    "url": "/crm/deal/details/1663/",
                    "id": "DEAL|1663"
                },
                "text_field_enabled": true,
                "background_id": null,
                "permissions": {
                    "manage_users_add": "member",
                    "manage_users_delete": "manager",
                    "manage_ui": "member",
                    "manage_settings": "owner",
                    "manage_messages": "member",
                    "can_post": "member"
                },
                "is_new": false,
                "readed_list": [
                    {
                        "user_id": 103,
                        "user_name": "John Smith",
                        "message_id": 0,
                        "date": null
                    },
                    {
                        "user_id": 547,
                        "user_name": "Peter Johnson",
                        "message_id": 0,
                        "date": null
                    }
                ],
                "manager_list": [
                    503
                ],
                "last_message_views": {
                    "message_id": 84477,
                    "first_viewers": [],
                    "count_of_viewers": 0
                },
                "dialog_id": "chat1439"
            },
            "time": {
                "start": 1772030091,
                "finish": 1772030091.165223,
                "duration": 0.1652228832244873,
                "processing": 0,
                "date_start": "2026-02-25T17:34:51+01:00",
                "date_finish": "2026-02-25T17:34:51+01:00",
                "operating_reset_at": 1772030691,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object

Root object containing chat data (detailed description)

time
time

Information about the request execution time

Object result-item

Name
type

Description

id
integer

Chat identifier

parent_chat_id
integer

Parent chat identifier

parent_message_id
integer

Parent message identifier

name
string

Chat name

description
string

Chat description

owner
integer

Chat owner identifier

extranet
boolean

Indicator of external extranet user participation

avatar
string

Link to the chat avatar

color
string

Chat color in HEX format

type
string

Chat type

counter
integer

Unread message counter

user_counter
integer

Number of chat participants

message_count
integer

Number of messages in the chat

unread_id
integer

Identifier of the first unread message

restrictions
object

Restrictions on actions in the chat (detailed description)

last_message_id
integer

Identifier of the last message

last_id
integer

Identifier of the last read message

marked_id
integer

Identifier of the marked message

disk_folder_id
integer

Identifier of the chat folder on Drive

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

date_create
datetime

Chat creation date in ATOM format

message_type
string

Type of chat messages

public
string

Indicator of chat public status

role
string

Current user's role in the chat

entity_link
object

Link to the related object (detailed description)

text_field_enabled
boolean

Availability of the message input field

background_id
integer

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

permissions
object

Permissions for actions in the chat (detailed description)

is_new
boolean

Indicator of a new dialog

readed_list
array

List of users and read statuses (detailed description)

manager_list
array

List of chat manager identifiers

last_message_views
object

Information about views of the last message (detailed description)

dialog_id
string

Identifier of the dialog passed in the DIALOG_ID parameter

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 owner leaving the chat

send
boolean

Availability of message sending

user_list
boolean

Availability of viewing the participant list

path
string

Link to the chat

path_title
string

Text of the link to the chat

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 readed_list

Name
type

Description

user_id
integer

User identifier

user_name
string

User name

message_id
integer

Identifier of the last read message

date
datetime

Read date. If not specified, the value is null

Object last_message_views

Name
type

Description

message_id
integer

Identifier of the message

first_viewers
array

List of first viewers

count_of_viewers
integer

Number of views

Error Handling

HTTP Status: 400

{
            "error": "DIALOG_ID_EMPTY",
            "error_description": "Dialog ID can't be empty"
        }
        

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

Possible Error Codes

Status

Code

Description

Value

400

DIALOG_ID_EMPTY

Dialog ID can't be empty

Required parameter DIALOG_ID not provided

403

ACCESS_ERROR

You do not have access to the specified dialog

Insufficient rights to view the dialog

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