Add Open Channel imopenlines.config.add

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

The method imopenlines.config.add adds a new open channel.

To allow users to write to the open channel, set the connector settings using the method imconnector.connector.data.set.

Method Parameters

Name
type

Description

PARAMS
object

Object with open channel settings (detailed description)

PARAMS Parameter

Name
type

Description

LINE_NAME
string

Name of the open channel

ACTIVE
char

Channel activity. Possible values:

  • Y — channel is active
  • N — channel is inactive

QUEUE
array

Queue of operators. An array of objects with fields ENTITY_TYPE and ENTITY_ID.

Possible values:

  • ENTITY_TYPE — user user or department department
  • ENTITY_ID — identifier of the selected type object. For user, specify the ID of the user, for department — the ID of the department

Example:

[
            {
                "ENTITY_TYPE":"user",
                "ENTITY_ID":"1"
            },
            {
                "ENTITY_TYPE":"department",
                "ENTITY_ID":"10"
            }
        ]
        

QUEUE_TYPE
string

Request distribution mode. Possible values:

  • evenly — distribute requests evenly among operators
  • strictly — direct requests strictly in queue order
  • all — direct requests to all operators in the queue

QUEUE_TIME
integer

Time in seconds before the request is passed to the next operator

NO_ANSWER_TIME
integer

Time in seconds before the no-answer scenario is triggered

WELCOME_MESSAGE
char

Send a welcome message. Possible values:

  • Y — yes
  • N — no

WELCOME_MESSAGE_TEXT
string

Text of the welcome message

WORKTIME_ENABLE
char

Consider the channel's working hours. Possible values:

  • Y — yes
  • N — no

WORKTIME_FROM
string

Start of working hours in HH:MM format

WORKTIME_TO
string

End of working hours in HH:MM format

WORKTIME_TIMEZONE
string

Time zone, for example Europe/Berlin

CRM
char

Search for the client in CRM. Possible values:

  • Y — yes
  • N — no

CRM_CREATE
string

What to create in CRM for a new client

VOTE_MESSAGE
char

Request service quality rating. Possible values:

  • Y — yes
  • N — no

LANGUAGE_ID
string

Language of the channel, for example de

CRM_CREATE_SECOND
string

Additional mode for creating a CRM object

CRM_CREATE_THIRD
char

Create a third CRM object. Possible values:

  • Y — yes
  • N — no

CRM_CHAT_TRACKER
char

Enable chat tracker for CRM. Possible values:

  • Y — yes
  • N — no

CRM_FORWARD
char

Forward the request to the responsible person in CRM. Possible values:

  • Y — yes
  • N — no

CRM_TRANSFER_CHANGE
char

Change the responsible person in CRM when transferring the dialogue. Possible values:

  • Y — yes
  • N — no

CRM_SOURCE
string

Source for the created CRM object

MAX_CHAT
integer

Maximum number of simultaneous dialogues for the operator

TYPE_MAX_CHAT
string

Type of MAX_CHAT restriction. Possible values:

  • answered — consider only dialogues where the operator has already responded
  • answered_new — consider dialogues with a response and new dialogues
  • closed — consider closed dialogues

CATEGORY_ENABLE
char

Enable categories. Possible values:

  • Y — yes
  • N — no

CATEGORY_ID
integer

Identifier of the category

SESSION_PRIORITY
integer

Session priority in the queue

WELCOME_BOT_ENABLE
char

Enable welcome chatbot. Possible values:

  • Y — yes
  • N — no

WELCOME_BOT_JOIN
string

When to connect the bot. Possible values:

  • first — connect the bot only at the beginning of the dialogue
  • always — connect the bot in every dialogue

WELCOME_BOT_ID
integer

Identifier of the chatbot

WELCOME_BOT_TIME
integer

After how many seconds to transfer the dialogue from the bot to the queue

WELCOME_BOT_LEFT
string

When to disconnect the bot. Possible values:

  • queue — disconnect the bot when transferring to the operators' queue
  • close — disconnect the bot when closing the dialogue

CHECK_AVAILABLE
char

Check the availability of the operator during distribution. Possible values:

  • Y — yes
  • N — no

WATCH_TYPING
char

Show typing indicator. Possible values:

  • Y — yes
  • N — no

SEND_WELCOME_EACH_SESSION
char

Send a greeting in each session. Possible values:

  • Y — yes
  • N — no

OPERATOR_DATA
string

Format of operator data. Possible values:

  • profile — show operator profile
  • queue — show operator data from the queue
  • hide — hide operator data

DEFAULT_OPERATOR_DATA
object

Default operator data. Possible fields:

  • NAME — operator's name
  • AVATAR — link to the operator's avatar
  • AVATAR_ID — identifier of the avatar file

NO_ANSWER_RULE
string

Scenario if the operator did not respond. Possible values:

  • none — do not execute the scenario
  • text — send a text message

NO_ANSWER_FORM_ID
integer

Identifier of the CRM form for the no-answer scenario

NO_ANSWER_BOT_ID
integer

Identifier of the chatbot for the no-answer scenario

NO_ANSWER_TEXT
string

Text for the no-answer scenario

WORKTIME_DAYOFF
array

Days off. Possible values of elements:

  • MO — Monday
  • TU — Tuesday
  • WE — Wednesday
  • TH — Thursday
  • FR — Friday
  • SA — Saturday
  • SU — Sunday

WORKTIME_HOLIDAYS
string

Holidays in string format, listed as DD.MM,DD.MM

WORKTIME_DAYOFF_RULE
string

Scenario during non-working hours. Possible values:

  • none — do not execute the scenario
  • text — send a text message

WORKTIME_DAYOFF_FORM_ID
integer

Identifier of the CRM form for non-working hours

WORKTIME_DAYOFF_BOT_ID
integer

Identifier of the chatbot for non-working hours

WORKTIME_DAYOFF_TEXT
string

Text message during non-working hours

CLOSE_RULE
string

Scenario upon closure. Possible values:

  • none — do not execute the scenario
  • text — send a text message

CLOSE_FORM_ID
integer

Identifier of the CRM form upon closure

CLOSE_BOT_ID
integer

Identifier of the chatbot upon closure

CLOSE_TEXT
string

Text message upon closure

VOTE_TIME_LIMIT
integer

Time limit for voting

VOTE_CLOSING_DELAY
char

Close the session immediately after rating. Possible values:

  • Y — yes
  • N — no

VOTE_BEFORE_FINISH
char

Request rating before completion. Possible values:

  • Y — yes
  • N — no

VOTE_MESSAGE_1_TEXT
string

Text for rating request in the widget

VOTE_MESSAGE_1_LIKE
string

Text after positive rating in the widget

VOTE_MESSAGE_1_DISLIKE
string

Text after negative rating in the widget

VOTE_MESSAGE_2_TEXT
string

Text for rating request in external channels

VOTE_MESSAGE_2_LIKE
string

Text after positive rating in external channels

VOTE_MESSAGE_2_DISLIKE
string

Text after negative rating in external channels

AUTO_CLOSE_RULE
string

Auto-closing scenario. Possible values:

  • none — do not execute the scenario
  • text — send a text message

FULL_CLOSE_TIME
integer

Time for full closure after manual closure

AUTO_CLOSE_TIME
integer

Time until auto-closure

AUTO_CLOSE_FORM_ID
integer

Identifier of the CRM form for auto-closure

AUTO_CLOSE_BOT_ID
integer

Identifier of the chatbot for auto-closure

AUTO_CLOSE_TEXT
string

Text upon auto-closure

AUTO_EXPIRE_TIME
integer

Lifetime of automatically closed session

TEMPORARY
char

Create a temporary channel. Possible values:

  • Y — create a temporary channel
  • N — create a permanent channel

QUICK_ANSWERS_IBLOCK_ID
integer

Identifier of the quick answers info block

KPI_FIRST_ANSWER_TIME
integer

Control of the first response time

KPI_FIRST_ANSWER_ALERT
char

Enable notification for the first response. Possible values:

  • Y — yes
  • N — no

KPI_FIRST_ANSWER_LIST
array

List of recipients for the first response notification

KPI_FIRST_ANSWER_TEXT
string

Text of the first response notification

KPI_FURTHER_ANSWER_TIME
integer

Control of subsequent response times

KPI_FURTHER_ANSWER_ALERT
char

Enable notification for subsequent responses. Possible values:

  • Y — yes
  • N — no

KPI_FURTHER_ANSWER_LIST
array

List of recipients for subsequent response notifications

KPI_FURTHER_ANSWER_TEXT
string

Text of the subsequent response notification

KPI_CHECK_OPERATOR_ACTIVITY
char

Monitor operator activity. Possible values:

  • Y — yes
  • N — no

USE_WELCOME_FORM
char

Use welcome CRM form. Possible values:

  • Y — yes
  • N — no

WELCOME_FORM_ID
integer

Identifier of the welcome CRM form

WELCOME_FORM_DELAY
char

Show the form with a delay. Possible values:

  • Y — yes
  • N — no

CONFIRM_CLOSE
char

Request confirmation for closure. Possible values:

  • Y — yes
  • N — no

IGNORE_WELCOME_FORM_RESPONSIBLE
char

Ignore the responsible person in the welcome form. Possible values:

  • Y — yes
  • N — no

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{
            "PARAMS": {
              "LINE_NAME": "Online Store Support Line",
              "QUEUE": [
                {
                  "ENTITY_TYPE": "user",
                  "ENTITY_ID": "1"
                },
                {
                  "ENTITY_TYPE": "user",
                  "ENTITY_ID": "15"
                },
                {
                  "ENTITY_TYPE": "user",
                  "ENTITY_ID": "23"
                }
              ],
              "QUEUE_TYPE": "strictly",
              "QUEUE_TIME": 45,
              "NO_ANSWER_TIME": 120,
              "WELCOME_MESSAGE": "Y",
              "WELCOME_MESSAGE_TEXT": "Hello! We will respond within a couple of minutes",
              "CRM": "Y",
              "CRM_CREATE": "deal",
              "CRM_SOURCE": "openline_web",
              "CRM_FORWARD": "Y",
              "MAX_CHAT": 4,
              "TYPE_MAX_CHAT": "answered_new",
              "WORKTIME_ENABLE": "Y",
              "WORKTIME_FROM": "09:00",
              "WORKTIME_TO": "21:00",
              "WORKTIME_TIMEZONE": "Europe/Berlin",
              "WORKTIME_DAYOFF": [
                "SA",
                "SU"
              ],
              "WORKTIME_DAYOFF_RULE": "text",
              "WORKTIME_DAYOFF_TEXT": "The line is currently closed. Please write, and we will respond during working hours"
            }
          }' \
          https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/imopenlines.config.add
        
curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{
            "PARAMS": {
              "LINE_NAME": "Online Store Support Line",
              "QUEUE": [
                {
                  "ENTITY_TYPE": "user",
                  "ENTITY_ID": "1"
                },
                {
                  "ENTITY_TYPE": "user",
                  "ENTITY_ID": "15"
                },
                {
                  "ENTITY_TYPE": "user",
                  "ENTITY_ID": "23"
                }
              ],
              "QUEUE_TYPE": "strictly",
              "QUEUE_TIME": 45,
              "NO_ANSWER_TIME": 120,
              "WELCOME_MESSAGE": "Y",
              "WELCOME_MESSAGE_TEXT": "Hello! We will respond within a couple of minutes",
              "CRM": "Y",
              "CRM_CREATE": "deal",
              "CRM_SOURCE": "openline_web",
              "CRM_FORWARD": "Y",
              "MAX_CHAT": 4,
              "TYPE_MAX_CHAT": "answered_new",
              "WORKTIME_ENABLE": "Y",
              "WORKTIME_FROM": "09:00",
              "WORKTIME_TO": "21:00",
              "WORKTIME_TIMEZONE": "Europe/Berlin",
              "WORKTIME_DAYOFF": [
                "SA",
                "SU"
              ],
              "WORKTIME_DAYOFF_RULE": "text",
              "WORKTIME_DAYOFF_TEXT": "The line is currently closed. Please write, and we will respond during working hours"
            },
            "auth": "**put_access_token_here**"
          }' \
          https://**put_your_bitrix24_address**/rest/imopenlines.config.add
        
// 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 } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        try {
          const response = await $b24.actions.v2.call.make<number>({
            method: 'imopenlines.config.add',
            params: {
              PARAMS: {
                LINE_NAME: 'Online store support line',
                QUEUE: [
                  { ENTITY_TYPE: 'user', ENTITY_ID: '1' },
                  { ENTITY_TYPE: 'user', ENTITY_ID: '15' },
                  { ENTITY_TYPE: 'user', ENTITY_ID: '23' },
                ],
                QUEUE_TYPE: 'strictly',
                QUEUE_TIME: 45,
                NO_ANSWER_TIME: 120,
                WELCOME_MESSAGE: 'Y',
                WELCOME_MESSAGE_TEXT: 'Hello! We will respond within a couple of minutes',
                CRM: 'Y',
                CRM_CREATE: 'deal',
                CRM_SOURCE: 'openline_web',
                CRM_FORWARD: 'Y',
                MAX_CHAT: 4,
                TYPE_MAX_CHAT: 'answered_new',
                WORKTIME_ENABLE: 'Y',
                WORKTIME_FROM: '09:00',
                WORKTIME_TO: '21:00',
                WORKTIME_TIMEZONE: 'Europe/Berlin',
                WORKTIME_DAYOFF: ['SA', 'SU'],
                WORKTIME_DAYOFF_RULE: 'text',
                WORKTIME_DAYOFF_TEXT: 'The line is currently unavailable. Write to us and we will respond during business hours',
              },
            },
            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('Created open line ID:', result)
          }
        } 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 addOpenlinesConfig() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'imopenlines.config.add',
                params: {
                  PARAMS: {
                    LINE_NAME: 'Online store support line',
                    QUEUE: [
                      { ENTITY_TYPE: 'user', ENTITY_ID: '1' },
                      { ENTITY_TYPE: 'user', ENTITY_ID: '15' },
                      { ENTITY_TYPE: 'user', ENTITY_ID: '23' },
                    ],
                    QUEUE_TYPE: 'strictly',
                    QUEUE_TIME: 45,
                    NO_ANSWER_TIME: 120,
                    WELCOME_MESSAGE: 'Y',
                    WELCOME_MESSAGE_TEXT: 'Hello! We will respond within a couple of minutes',
                    CRM: 'Y',
                    CRM_CREATE: 'deal',
                    CRM_SOURCE: 'openline_web',
                    CRM_FORWARD: 'Y',
                    MAX_CHAT: 4,
                    TYPE_MAX_CHAT: 'answered_new',
                    WORKTIME_ENABLE: 'Y',
                    WORKTIME_FROM: '09:00',
                    WORKTIME_TO: '21:00',
                    WORKTIME_TIMEZONE: 'Europe/Berlin',
                    WORKTIME_DAYOFF: ['SA', 'SU'],
                    WORKTIME_DAYOFF_RULE: 'text',
                    WORKTIME_DAYOFF_TEXT: 'The line is currently unavailable. Write to us and we will respond during business hours',
                  },
                },
                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('Created open line ID:', result)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', addOpenlinesConfig)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.imopenlines.config.add(
                params={
                    "LINE_NAME": "Online store support line",
                    "QUEUE": [
                        {
                            "ENTITY_TYPE": "user",
                            "ENTITY_ID": "1",
                        },
                        {
                            "ENTITY_TYPE": "user",
                            "ENTITY_ID": "15",
                        },
                        {
                            "ENTITY_TYPE": "user",
                            "ENTITY_ID": "23",
                        },
                    ],
                    "QUEUE_TYPE": "strictly",
                    "QUEUE_TIME": 45,
                    "NO_ANSWER_TIME": 120,
                    "WELCOME_MESSAGE": "Y",
                    "WELCOME_MESSAGE_TEXT": "Hello! We will respond within a couple of minutes",
                    "CRM": "Y",
                    "CRM_CREATE": "deal",
                    "CRM_SOURCE": "openline_web",
                    "CRM_FORWARD": "Y",
                    "MAX_CHAT": 4,
                    "TYPE_MAX_CHAT": "answered_new",
                    "WORKTIME_ENABLE": "Y",
                    "WORKTIME_FROM": "09:00",
                    "WORKTIME_TO": "21:00",
                    "WORKTIME_TIMEZONE": "Europe/Berlin",
                    "WORKTIME_DAYOFF": [
                        "SA",
                        "SU",
                    ],
                    "WORKTIME_DAYOFF_RULE": "text",
                    "WORKTIME_DAYOFF_TEXT": "The line is currently unavailable. Write to us and we will respond during business hours",
                },
            ).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.config.add',
                    [
                        'PARAMS' => [
                            'LINE_NAME' => 'Online Store Support Line',
                            'QUEUE' => [
                                [
                                    'ENTITY_TYPE' => 'user',
                                    'ENTITY_ID' => '1',
                                ],
                                [
                                    'ENTITY_TYPE' => 'user',
                                    'ENTITY_ID' => '15',
                                ],
                                [
                                    'ENTITY_TYPE' => 'user',
                                    'ENTITY_ID' => '23',
                                ],
                            ],
                            'QUEUE_TYPE' => 'strictly',
                            'QUEUE_TIME' => 45,
                            'NO_ANSWER_TIME' => 120,
                            'WELCOME_MESSAGE' => 'Y',
                            'WELCOME_MESSAGE_TEXT' => 'Hello! We will respond within a couple of minutes',
                            'CRM' => 'Y',
                            'CRM_CREATE' => 'deal',
                            'CRM_SOURCE' => 'openline_web',
                            'CRM_FORWARD' => 'Y',
                            'MAX_CHAT' => 4,
                            'TYPE_MAX_CHAT' => 'answered_new',
                            'WORKTIME_ENABLE' => 'Y',
                            'WORKTIME_FROM' => '09:00',
                            'WORKTIME_TO' => '21:00',
                            'WORKTIME_TIMEZONE' => 'Europe/Berlin',
                            'WORKTIME_DAYOFF' => ['SA', 'SU'],
                            'WORKTIME_DAYOFF_RULE' => 'text',
                            'WORKTIME_DAYOFF_TEXT' => 'The line is currently closed. Please write, and we will respond during working hours',
                        ],
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            print_r($result);
        } catch (Throwable $e) {
            echo $e->getMessage();
        }
        
BX24.callMethod(
            'imopenlines.config.add',
            {
                PARAMS: {
                    LINE_NAME: 'Online Store Support Line',
                    QUEUE: [
                        {
                            ENTITY_TYPE: 'user',
                            ENTITY_ID: '1'
                        },
                        {
                            ENTITY_TYPE: 'user',
                            ENTITY_ID: '15'
                        },
                        {
                            ENTITY_TYPE: 'user',
                            ENTITY_ID: '23'
                        }
                    ],
                    QUEUE_TYPE: 'strictly',
                    QUEUE_TIME: 45,
                    NO_ANSWER_TIME: 120,
                    WELCOME_MESSAGE: 'Y',
                    WELCOME_MESSAGE_TEXT: 'Hello! We will respond within a couple of minutes',
                    CRM: 'Y',
                    CRM_CREATE: 'deal',
                    CRM_SOURCE: 'openline_web',
                    CRM_FORWARD: 'Y',
                    MAX_CHAT: 4,
                    TYPE_MAX_CHAT: 'answered_new',
                    WORKTIME_ENABLE: 'Y',
                    WORKTIME_FROM: '09:00',
                    WORKTIME_TO: '21:00',
                    WORKTIME_TIMEZONE: 'Europe/Berlin',
                    WORKTIME_DAYOFF: ['SA', 'SU'],
                    WORKTIME_DAYOFF_RULE: 'text',
                    WORKTIME_DAYOFF_TEXT: 'The line is currently closed. Please write, and we will respond during working hours'
                }
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'imopenlines.config.add',
            [
                'PARAMS' => [
                    'LINE_NAME' => 'Online Store Support Line',
                    'QUEUE' => [
                        [
                            'ENTITY_TYPE' => 'user',
                            'ENTITY_ID' => '1',
                        ],
                        [
                            'ENTITY_TYPE' => 'user',
                            'ENTITY_ID' => '15',
                        ],
                        [
                            'ENTITY_TYPE' => 'user',
                            'ENTITY_ID' => '23',
                        ],
                    ],
                    'QUEUE_TYPE' => 'strictly',
                    'QUEUE_TIME' => 45,
                    'NO_ANSWER_TIME' => 120,
                    'WELCOME_MESSAGE' => 'Y',
                    'WELCOME_MESSAGE_TEXT' => 'Hello! We will respond within a couple of minutes',
                    'CRM' => 'Y',
                    'CRM_CREATE' => 'deal',
                    'CRM_SOURCE' => 'openline_web',
                    'CRM_FORWARD' => 'Y',
                    'MAX_CHAT' => 4,
                    'TYPE_MAX_CHAT' => 'answered_new',
                    'WORKTIME_ENABLE' => 'Y',
                    'WORKTIME_FROM' => '09:00',
                    'WORKTIME_TO' => '21:00',
                    'WORKTIME_TIMEZONE' => 'Europe/Berlin',
                    'WORKTIME_DAYOFF' => ['SA', 'SU'],
                    'WORKTIME_DAYOFF_RULE' => 'text',
                    'WORKTIME_DAYOFF_TEXT' => 'The line is currently closed. Please write, and we will respond during working hours',
                ],
            ]
        );
        
        print_r($result);
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "imopenlines.config.add", b24.Params{
        	"PARAMS": b24.Params{
        		"LINE_NAME": "Online Store Support Line",
        		"QUEUE": []b24.Params{
        			{
        				"ENTITY_TYPE": "user",
        				"ENTITY_ID":   "1",
        			},
        			{
        				"ENTITY_TYPE": "user",
        				"ENTITY_ID":   "15",
        			},
        			{
        				"ENTITY_TYPE": "user",
        				"ENTITY_ID":   "23",
        			},
        		},
        		"QUEUE_TYPE":           "strictly",
        		"QUEUE_TIME":           45,
        		"NO_ANSWER_TIME":       120,
        		"WELCOME_MESSAGE":      "Y",
        		"WELCOME_MESSAGE_TEXT": "Hello! We will respond within a couple of minutes",
        		"CRM":                  "Y",
        		"CRM_CREATE":           "deal",
        		"CRM_SOURCE":           "openline_web",
        		"CRM_FORWARD":          "Y",
        		"MAX_CHAT":             4,
        		"TYPE_MAX_CHAT":        "answered_new",
        		"WORKTIME_ENABLE":      "Y",
        		"WORKTIME_FROM":        "09:00",
        		"WORKTIME_TO":          "21:00",
        		"WORKTIME_TIMEZONE":    "Europe/Berlin",
        		"WORKTIME_DAYOFF":      []string{"SA", "SU"},
        		"WORKTIME_DAYOFF_RULE": "text",
        		"WORKTIME_DAYOFF_TEXT": "The line is currently closed. Please write, and we will respond during working hours",
        	},
        })
        if err != nil {
        	return fmt.Errorf("imopenlines.config.add: %w", err)
        }
        
        var newID b24.ID
        if err := json.Unmarshal(res.Result, &newID); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println("id:", newID)
        

Response Handling

HTTP Status: 200

{
            "result": 15,
            "time": {
                "start": 1741688359.737944,
                "finish": 1741688360.028349,
                "duration": 0.2904050350189209,
                "processing": 0.16270899772644043,
                "date_start": "2025-03-11T10:25:59+01:00",
                "date_finish": "2025-03-11T10:26:00+01:00",
                "operating_reset_at": 1741688960,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
integer

Identifier of the created open channel

time
time

Information about the request execution time

Error Handling

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

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