Get Information About the Operator's Dialog imopenlines.dialog.get

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: imopenlines

Who can execute the method: any user with access permission to the dialog

The method imopenlines.dialog.get returns data from the open line chat. You only need to provide one of the parameters.

Method Parameters

Required parameters are marked with *

Name
type

Description

CHAT_ID
integer

Identifier of the open line chat.

The identifier can be obtained using the imopenlines.session.open or imopenlines.session.history.get methods.

DIALOG_ID
string

Identifier of the dialog in the format chat<ID>, where <ID> is the identifier of the open line chat.

SESSION_ID
integer

Identifier of the session.

The identifier can be obtained using the imopenlines.session.history.get method in the sessionId field.

USER_CODE
string

String code of the user for the external system channel.

Code format: <connector>|<LINE_ID>|<CONNECTOR_CHAT_ID>|<CONNECTOR_USER_ID>, where:

  • <connector> — identifier of the connector: livechat, telegram, and others
  • <LINE_ID> — identifier of the open line
  • <CONNECTOR_CHAT_ID> — identifier of the chat in the channel
  • <CONNECTOR_USER_ID> — identifier of the user in the channel

The value can be obtained using the imopenlines.session.history.get method from result.chat.<chatId>.entityId.

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"USER_CODE":"livechat|1|1373|211"}' \
          https://your-domain.bitrix24.com/rest/1/webhook_key/imopenlines.dialog.get.json
        
curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"USER_CODE":"livechat|1|1373|211","auth":"<access_token>"}' \
          https://your-domain.bitrix24.com/rest/imopenlines.dialog.get.json
        
// This snippet is an ES module: top-level await requires type="module" or a bundler.
        // $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
        import { Text } from '@bitrix24/b24jssdk'
        import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type DialogGetResult = {
          id: number
          parent_chat_id: number
          parent_message_id: number
          name: string
          description: string | null
          owner: number
          extranet: boolean
          avatar: string
          color: string
          type: string
          counter: number
          user_counter: number
          message_count: number
          unread_id: number
          restrictions: Record<string, boolean>
          last_message_id: number
          last_id: number
          marked_id: number
          disk_folder_id: number
          entity_type: string
          entity_id: string
          entity_data_1: string
          entity_data_2: string
          entity_data_3: string
          mute_list: number[]
          date_create: ISODate
          message_type: string
          public: string
          role: string
          entity_link: { type: string; url: string; id: string }
          text_field_enabled: boolean
          background_id: number | null
          permissions: Record<string, string>
          is_new: boolean
          readed_list: Array<{ user_id: number; user_name: string; message_id: number; date: ISODate | null }>
          manager_list: number[]
          last_message_views: {
            message_id: number
            first_viewers: Array<{ user_id: number; user_name: string; date: ISODate }>
            count_of_viewers: number
          }
          dialog_id: string
        }
        
        try {
          const response = await $b24.actions.v2.call.make<DialogGetResult>({
            method: 'imopenlines.dialog.get',
            params: {
              USER_CODE: 'livechat|1|1373|211',
            },
            requestId: Text.getUuidRfc4122()
          })
        
          // The payload is available only on a successful response
          if (!response.isSuccess) {
            console.error(response.getErrorMessages().join('; '))
          } else {
            const result = response.getData()!.result
            console.info(result.id, result.name, result.dialog_id)
          }
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
        
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
        <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
        <script>
          async function getDialog() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'imopenlines.dialog.get',
                params: {
                  USER_CODE: 'livechat|1|1373|211',
                },
                requestId: B24Js.Text.getUuidRfc4122()
              })
        
              // The payload is available only on a successful response
              if (!response.isSuccess) {
                console.error(response.getErrorMessages().join('; '))
                return
              }
        
              const result = response.getData().result
              console.info(result.id, result.name, result.dialog_id)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', getDialog)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.imopenlines.dialog.get(
                user_code="livechat|1|1373|211",
            ).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'imopenlines.dialog.get',
                    [
                        'USER_CODE' => 'livechat|1|1373|211',
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                echo 'Error: ' . $result->error();
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        } catch (Throwable $exception) {
            error_log($exception->getMessage());
            echo 'Error getting dialog: ' . $exception->getMessage();
        }
        
BX24.callMethod(
            'imopenlines.dialog.get',
            {
                USER_CODE: 'livechat|1|1373|211',
            },
            function(result) {
                if (result.error()) {
                    console.error(result.error().ex);
                } else {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'imopenlines.dialog.get',
            [
                'USER_CODE' => 'livechat|1|1373|211',
            ]
        );
        
        if (!empty($result['error'])) {
            echo 'Error: ' . $result['error_description'];
        } else {
            echo 'Success: ' . print_r($result['result'], true);
        }
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "imopenlines.dialog.get", b24.Params{
        	"USER_CODE": "livechat|1|1373|211",
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("imopenlines.dialog.get: %w", err)
        }
        
        var item struct {
        	ID              b24.ID `json:"id"`
        	ParentChatID    int    `json:"parent_chat_id"`
        	ParentMessageID int    `json:"parent_message_id"`
        	Name            string `json:"name"`
        	Owner           int    `json:"owner"`
        	Extranet        bool   `json:"extranet"`
        }
        if err := json.Unmarshal(res.Result, &item); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println(item.ID, item.ParentChatID)
        

Response Handling

HTTP Status: 200

{
            "result": {
                "id": 1777,
                "parent_chat_id": 0,
                "parent_message_id": 0,
                "name": "Green Guest #17 - Bitrix24 Documentation",
                "description": null,
                "owner": 27,
                "extranet": false,
                "avatar": "",
                "color": "#58cc47",
                "type": "lines",
                "counter": 0,
                "user_counter": 2,
                "message_count": 104,
                "unread_id": 0,
                "restrictions": {
                    "avatar": true,
                    "rename": true,
                    "extend": true,
                    "call": true,
                    "mute": true,
                    "leave": true,
                    "leave_owner": true,
                    "send": true,
                    "user_list": true
                },
                "last_message_id": 86313,
                "last_id": 86313,
                "marked_id": 0,
                "disk_folder_id": 0,
                "entity_type": "LINES",
                "entity_id": "livechat|22|1775|599",
                "entity_data_1": "Y|LEAD|1209|N|N|343|1773682918|0|0|0",
                "entity_data_2": "LEAD|1209|COMPANY|0|CONTACT|0|DEAL|0",
                "entity_data_3": "N",
                "mute_list": [],
                "date_create": "2026-03-13T16:50:15+01:00",
                "message_type": "L",
                "public": "",
                "role": "owner",
                "entity_link": {
                    "type": "LINES",
                    "url": "",
                    "id": "livechat|22|1775|599"
                },
                "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": 599,
                        "user_name": "Guest",
                        "message_id": 86101,
                        "date": null
                    }
                ],
                "manager_list": [27],
                "last_message_views": {
                    "message_id": 86313,
                    "first_viewers": [
                        {
                            "user_id": 27,
                            "user_name": "Samantha Johnson",
                            "date": "2026-03-16T20:50:37+01:00"
                        }
                    ],
                    "count_of_viewers": 0
                },
                "dialog_id": "chat1777"
            },
            "time": {
                "start": 1773683678,
                "finish": 1773683678.423382,
                "duration": 0.423382043838501,
                "processing": 0,
                "date_start": "2026-03-16T20:54:38+01:00",
                "date_finish": "2026-03-16T20:54:38+01:00",
                "operating_reset_at": 1773684278,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object

Chat data object (detailed description)

time
time

Information about the request execution time

Result Object

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

description
string

Description of the chat or null

owner
integer

Identifier of the chat owner

extranet
boolean

Indicator of an extranet chat

avatar
string

URL of the chat avatar or an empty string

color
string

Color of the chat in HEX format

dialog_id
string

Identifier of the dialog in the format chat<ID>

type
string

Type of the chat, for open lines the value is lines

counter
integer

Number of unread messages for the current user

user_counter
integer

Number of participants with unread messages

message_count
integer

Total number of messages in the chat

unread_id
integer

Identifier of the first unread message or 0

restrictions
object

Permissions for actions with the chat (detailed description)

last_message_id
integer

Identifier of the last message

last_id
integer

Service identifier of the last message

marked_id
integer

Identifier of the marked message or 0

disk_folder_id
integer

Identifier of the Drive folder for chat files

entity_type
string

Type of the chat channel, for open lines the value is LINES

entity_id
string

User code of the open line in the format <connector>|<LINE_ID>|<CONNECTOR_CHAT_ID>|<CONNECTOR_USER_ID>, where:

  • <connector> — identifier of the connector: livechat, telegram, and others
  • <LINE_ID> — identifier of the open line
  • <CONNECTOR_CHAT_ID> — identifier of the chat in the channel
  • <CONNECTOR_USER_ID> — identifier of the user in the channel

entity_data_1
string

String with session data of the open line

entity_data_2
string

String with CRM bindings

entity_data_3
string

Additional service flag

mute_list
array

List of user IDs with notifications turned off

date_create
datetime

Date and time of chat creation in ISO 8601 format (RFC3339)

message_type
string

Type of messages in the chat

public
string

Public flag of the chat

role
string

Role of the current user in the chat

entity_link
object

Link to the external system channel (detailed description)

text_field_enabled
boolean

Whether the message input field is available

background_id
integer

Identifier of the chat background or null

permissions
object

Permissions of the current user in the chat (detailed description)

is_new
boolean

Indicator of a new chat

readed_list
array

List of data about message readings (detailed description)

manager_list
array

List of identifiers of operators assigned as managers

last_message_views
object

Data about the views of the last message (detailed description)

Restrictions Object

Name
type

Description

avatar
boolean

Permission to change the chat avatar

rename
boolean

Permission to change the chat name

extend
boolean

Permission to extend chat settings

call
boolean

Permission for calls in the chat

mute
boolean

Permission to turn off notifications

leave
boolean

Permission to leave the chat

leave_owner
boolean

Permission for the chat owner to leave

send
boolean

Permission to send messages

user_list
boolean

Permission to view the list of participants

Name
type

Description

type
string

Type of the channel, for open lines the value is LINES

url
string

Link to the external object of the channel or an empty string

id
string

External identifier of the dialog in the channel

Permissions Object

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

Readed List Item Object

Name
type

Description

user_id
integer

Identifier of the user

user_name
string

Name of the user

message_id
integer

Identifier of the last read message

date
datetime

Date and time of reading in ISO 8601 format (RFC3339) or null

Last Message Views Object

Name
type

Description

message_id
integer

Identifier of the message for which view statistics are collected

first_viewers
array

List of users who viewed the message first (detailed description)

count_of_viewers
integer

Number of other users who viewed the message

First Viewer Item Object

Name
type

Description

user_id
integer

Identifier of the user

user_name
string

Name of the user

date
datetime

Date and time of viewing in ISO 8601 format (RFC3339)

Error Handling

HTTP Status: 400

{
            "error": "ACCESS_ERROR",
            "error_description": "You do not have access to the specified dialog"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Status

Code

Description

Value

400

IM_NOT_INSTALLED

Messenger is not installed.

The im module is not installed

400

ACCESS_ERROR

You do not have access to the specified dialog

Dialog not found or no access to it

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

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

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open it 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