لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/openlines.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Open Channels

Bitrix24 Open Channels receive client inquiries from messengers and social networks and route them to operators. The methods in this section configure channels, run dialogs on behalf of an operator, link dialogs to CRM cards, and read contact-center statistics.

Scope: imopenlines | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key

Quick start | Full example | Endpoint reference | Error codes

Documentation sections

Identifiers

Identifier What it is Where to get it
IdentifierconfigId, lineId What it isOpen Channel Where to get itThe data[].id field in the GET /v1/openline-configs response
IdentifiersessionId What it isA single client inquiry Where to get itThe sessions[].id field in the POST /v1/openlines/sessions/search response
IdentifierchatId What it isOpen Channel chat, shared by all sessions of a client Where to get itThe sessions[].chatId field in the POST /v1/openlines/sessions/search response, the data[].chatId field in the GET /v1/openlines/crm/chats response for a CRM card, or POST /v1/openlines/sessions/open by client code

Dialog actions run on behalf of the employee the key is bound to. They have no "employee" parameter — details in Operator actions and my pause.

Statistics (dashboard)

The statistics methods ship in the imopenlines 26.700.0 update and are not yet available on all Bitrix24 accounts. If the update has not reached your Bitrix24 account yet, the API returns 422 METHOD_NOT_YET_AVAILABLE — a sign that the method is not yet released on the account, not an integration error.

Six methods only read data: channel summary metrics, real-time operators, sessions with filters, metrics of selected sessions, client ratings and reassignment history. Data is limited to the permissions of the employee the key is bound to. If that employee has no access to any channel, the method returns an empty list or zero metrics rather than an error. The methods require the Open Channels statistics permission report_open_lines; without it, the request returns 403 B24_TARIFF_RESTRICTION.

Endpoint Purpose
EndpointPOST /v1/openlines/stats PurposeChannel aggregates for a period
EndpointGET /v1/openlines/operators PurposeOperator status and load
EndpointPOST /v1/openlines/sessions/search PurposeSession search with filters
EndpointPOST /v1/openlines/sessions/stats PurposeMetrics of selected sessions, up to 100 per call
EndpointPOST /v1/openlines/ratings/search PurposeSessions with a client rating for a period
EndpointPOST /v1/openlines/sessions/transfers PurposeReassignment history, up to 50 sessions per call

The other methods in the section work on any Bitrix24 account. The exception is Session history: the Vibecode platform enables it gradually, and until it is enabled the call returns 403 OPENLINES_HISTORY_DISABLED. Session history requires neither the report_open_lines permission nor the imopenlines 26.700.0 update.

Common scenarios

Scenario Endpoints
ScenarioReport on inquiries for a period EndpointsPOST /v1/openlines/stats, POST /v1/openlines/sessions/search
ScenarioQueue and operator load monitor EndpointsGET /v1/openlines/operators
ScenarioClient rating dashboard (CSAT) EndpointsPOST /v1/openlines/ratings/search, POST /v1/openlines/stats
ScenarioInvestigating a complaint about one session EndpointsPOST /v1/openlines/sessions/stats, POST /v1/openlines/sessions/history
ScenarioAnalyzing reassignments between operators EndpointsPOST /v1/openlines/sessions/transfers
ScenarioConnect to a client dialog from a CRM card EndpointsGET /v1/openlines/crm/chats, POST /v1/openlines/sessions/intercept or POST /v1/openlines/sessions/join
ScenarioMessage the client in a CRM card dialog EndpointsGET /v1/openlines/crm/chats, POST /v1/openlines/crm/messages
ScenarioTake a dialog and transfer it to a colleague EndpointsPOST /v1/openlines/sessions/start, POST /v1/openlines/operator/transfer

Recommendations

Quick start

Get a channel ID and that channel's summary metrics for a period.

1. Find the channel

Terminal
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://vibecode.bitrix24.com/v1/openline-configs"

In the response, data is the array of channels on the Bitrix24 account. The data[].id field is the channel ID, data[].name is its name.

2. Request the channel's summary metrics

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/stats" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dateFrom": "2026-09-01T00:00:00+00:00",
    "dateTo": "2026-09-30T23:59:59+00:00",
    "configId": 3
  }'

Response:

JSON
{
  "success": true,
  "data": {
    "totalSessions": 3,
    "closedSessions": 2,
    "spamSessions": 0,
    "avgWaitAnswer": 25,
    "avgSessionDuration": 17.3333,
    "likeCount": 0,
    "dislikeCount": 0,
    "votedSessions": 0,
    "positiveRate": 0,
    "kpiFirstAnswerOk": 0,
    "kpiFirstAnswerFail": 0,
    "sessionsBySource": [{ "source": "livechat", "count": 2 }, { "source": "telegrambot", "count": 1 }],
    "sessionsByHour": [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],
    "sessionsByOperator": [{ "operatorId": 42, "count": 2, "avgWaitAnswer": 25, "positiveRate": 0 }]
  }
}

Response fields are on the Channel aggregates for a period page.

Full example

A report on a channel's inquiries for a period: summary metrics, sessions linked to CRM, their metrics, and all dialogs of the first session's CRM card. All calls only read data.

javascript
const VIBE_KEY = process.env.VIBE_KEY
const BASE = 'https://vibecode.bitrix24.com/v1'

async function api(method, path, body = null) {
  const opts = { method, headers: { 'X-Api-Key': VIBE_KEY } }
  if (body) {
    opts.headers['Content-Type'] = 'application/json'
    opts.body = JSON.stringify(body)
  }
  const res = await fetch(`${BASE}${path}`, opts)
  return res.json()
}

// 1. Channels on the account: take the ID of the first channel
const lines = await api('GET', '/openline-configs')
const configId = lines.data[0].id
console.log('Channel:', configId)

// 2. Channel summary metrics for the period
const period = { dateFrom: '2026-10-01T00:00:00+00:00', dateTo: '2026-10-19T23:59:59+00:00' }
const stats = await api('POST', '/openlines/stats', { ...period, configId })
console.log('Inquiries:', stats.data.totalSessions, 'closed:', stats.data.closedSessions)

// 3. Sessions of the same period linked to CRM
const found = await api('POST', '/openlines/sessions/search', {
  configId,
  dateCreateFrom: period.dateFrom,
  dateCreateTo: period.dateTo,
  hasCrm: 'Y',
  limit: 50,
})
const sessions = found.data.sessions
console.log('Sessions on page:', sessions.length, 'more:', found.data.hasNextPage)

if (sessions.length > 0) {
  // 4. Metrics of the sessions found, up to 100 per call
  const metrics = await api('POST', '/openlines/sessions/stats', {
    sessionId: sessions.map((s) => s.id),
  })
  for (const m of metrics.data.sessions) console.log('Session', m.sessionId, 'messages:', m.messagesCount)

  // 5. All dialogs of the CRM card the first session is linked to
  const { crmEntityType, crmEntityId } = sessions[0]
  const chats = await api('GET', `/openlines/crm/chats?crmEntityType=${crmEntityType}&crmEntityId=${crmEntityId}&activeOnly=false`)
  for (const c of chats.data) console.log('Chat', c.chatId, 'channel:', c.connectorTitle)
}

How to get the next pages of sessions is described in the "Pagination" paragraph on the Session search page. The chatId found in step 5 is accepted by dialog interception, joining a dialog and a message to the client.

Endpoint reference

All 38 endpoints in the section:

Method Path Bitrix24 method Description
MethodPOST Path/v1/openline-configs Bitrix24 methodimopenlines.config.add DescriptionCreate a channel configuration
MethodGET Path/v1/openline-configs Bitrix24 methodimopenlines.config.list.get DescriptionList configurations
MethodGET Path/v1/openline-configs/:id Bitrix24 methodimopenlines.config.get DescriptionConfiguration by ID, with the operator queue
MethodPATCH Path/v1/openline-configs/:id Bitrix24 methodimopenlines.config.update DescriptionUpdate a configuration
MethodDELETE Path/v1/openline-configs/:id Bitrix24 methodimopenlines.config.delete DescriptionDelete a configuration
MethodPOST Path/v1/openline-configs/search Bitrix24 methodimopenlines.config.list.get DescriptionSearch configurations by filter
MethodGET Path/v1/openline-configs/fields Bitrix24 method— DescriptionConfiguration field schema
MethodPOST Path/v1/openline-configs/aggregate Bitrix24 methodimopenlines.config.list.get DescriptionAggregation over configurations
MethodPOST Path/v1/openlines/operator/answer Bitrix24 methodimopenlines.operator.answer DescriptionAccept a dialog as an operator
MethodPOST Path/v1/openlines/operator/finish Bitrix24 methodimopenlines.operator.finish DescriptionFinish a dialog as an operator
MethodGET Path/v1/openline-configs/:lineId/quick-replies Bitrix24 methodimopenlines.v2.QuickReply.list DescriptionList the channel's quick replies and sections
MethodPOST Path/v1/openline-configs/:lineId/quick-replies Bitrix24 methodimopenlines.v2.QuickReply.save DescriptionCreate a quick reply
MethodPATCH Path/v1/openline-configs/:lineId/quick-replies/:id Bitrix24 methodimopenlines.v2.QuickReply.save DescriptionUpdate a quick reply
MethodDELETE Path/v1/openline-configs/:lineId/quick-replies/:id Bitrix24 methodimopenlines.v2.QuickReply.delete DescriptionDelete a quick reply
MethodPOST Path/v1/openlines/sessions/search Bitrix24 methodimopenlines.v2.Session.list DescriptionSession search with filters
MethodPOST Path/v1/openlines/sessions/stats Bitrix24 methodimopenlines.v2.Session.Stat.get DescriptionMetrics of selected sessions, up to 100 per call
MethodPOST Path/v1/openlines/sessions/transfers Bitrix24 methodimopenlines.v2.Session.Transfer.list DescriptionReassignment history, up to 50 sessions per call
MethodPOST Path/v1/openlines/sessions/history Bitrix24 methodimopenlines.session.history.get DescriptionCorrespondence of the chat's latest session by chatId
MethodPOST Path/v1/openlines/sessions/open Bitrix24 methodimopenlines.session.open DescriptionOpen a client chat by its code in the connector
MethodPOST Path/v1/openlines/sessions/start Bitrix24 methodimopenlines.session.start DescriptionStart a session: the employee becomes the chat operator
MethodPOST Path/v1/openlines/sessions/intercept Bitrix24 methodimopenlines.session.intercept DescriptionIntercept a dialog for the current operator
MethodPOST Path/v1/openlines/sessions/join Bitrix24 methodimopenlines.session.join DescriptionJoin a dialog as an additional participant
MethodGET Path/v1/openlines/crm/chats Bitrix24 methodimopenlines.crm.chat.get DescriptionChannel chats linked to a CRM card
MethodPOST Path/v1/openlines/crm/chats/users Bitrix24 methodimopenlines.crm.chat.user.add DescriptionAdd an employee to a CRM chat
MethodDELETE Path/v1/openlines/crm/chats/users Bitrix24 methodimopenlines.crm.chat.user.delete DescriptionRemove an employee from a CRM chat
MethodPOST Path/v1/openlines/crm/messages Bitrix24 methodimopenlines.crm.message.add DescriptionSend a message to the client
MethodPOST Path/v1/openlines/dialogs/:chatId/lead Bitrix24 methodimopenlines.crm.lead.create DescriptionCreate a lead from an inquiry
MethodPOST Path/v1/openlines/dialogs/lookup Bitrix24 methodimopenlines.dialog.get DescriptionDialog metadata and channel ID by chatId, dialogId or sessionId
MethodPOST Path/v1/openlines/operator/skip Bitrix24 methodimopenlines.operator.skip DescriptionSkip a dialog
MethodPOST Path/v1/openlines/operator/spam Bitrix24 methodimopenlines.operator.spam DescriptionMark the client as spam and close the dialog
MethodPOST Path/v1/openlines/operator/transfer Bitrix24 methodimopenlines.operator.transfer DescriptionTransfer a dialog to an employee or to the channel queue
MethodPOST Path/v1/openlines/operator/finish-another Bitrix24 methodimopenlines.operator.another.finish DescriptionFinish another operator's dialog
MethodGET Path/v1/openlines/operator/pause Bitrix24 methodimopenlines.operator.pause.get DescriptionRead your own operator pause
MethodPOST Path/v1/openlines/operator/pause Bitrix24 methodimopenlines.operator.pause.start DescriptionStart your own operator pause
MethodDELETE Path/v1/openlines/operator/pause Bitrix24 methodimopenlines.operator.pause.stop DescriptionStop your own operator pause
MethodPOST Path/v1/openlines/stats Bitrix24 methodimopenlines.v2.Stat.get DescriptionChannel aggregates for a period
MethodGET Path/v1/openlines/operators Bitrix24 methodimopenlines.v2.Operator.list DescriptionOperator status and load
MethodPOST Path/v1/openlines/ratings/search Bitrix24 methodimopenlines.v2.Session.Rating.list DescriptionSessions with a client rating for a period

Accepting and finishing a dialog as an operator are described on the Open Channel configurations page. The six statistics methods ship in the imopenlines 26.700.0 update, see Statistics (dashboard). GET /v1/openline-configs/fields makes no Bitrix24 call — Vibecode returns the field schema itself.

Error codes

Open Channels errors

HTTP Code When
HTTP400 CodeINVALID_JSON_BODY WhenThe request body did not parse as JSON. The check runs before field validation, so the response says nothing about missing parameters. This is the response of the statistics, session history, dialog metadata, CRM chat, interception and joining, and quick reply methods. Creating, updating and searching channel configurations, operator actions, the operator pause, and opening and starting a session respond to such a body with 400 FST_ERR_CTP_INVALID_JSON_BODY
HTTP400 CodeMISSING_PARAMS WhenRequired parameters are missing, for example the period for stats and ratings/search, sessionId for sessions/stats and sessions/transfers
HTTP400 CodeINVALID_PARAMS WhenThe request body is not an object, or a value is invalid where a number or a value from a list is expected
HTTP400 CodeBATCH_LIMIT_EXCEEDED WhenThe sessionId array exceeds the method limit: 100 for sessions/stats, 50 for sessions/transfers
HTTP403 CodeB24_TARIFF_RESTRICTION WhenThe portal's plan does not include Open Channels statistics — the report_open_lines permission
HTTP403 CodeOPENLINES_HISTORY_DISABLED WhenSession history is not yet enabled on the Vibecode platform
HTTP422 CodeMETHOD_NOT_YET_AVAILABLE WhenThe imopenlines 26.700.0 update has not reached the portal yet. The response contains an error.release field set to imopenlines 26.700.0 — code details. If the plan does not include statistics, the code changes to 403 B24_TARIFF_RESTRICTION once the update arrives
HTTP502 CodeOPENLINE_OPERATOR_FAILED WhenBitrix24 did not confirm the action or returned a response of an unexpected shape. This is the response of accepting and finishing a dialog as an operator, operator actions and the operator pause, opening and starting a session, CRM chat operations and quick replies. The condition for a specific method is in the ## Errors table on its page

When Bitrix24 rejects a request, the response comes as 422 BITRIX_ERROR, and the Bitrix24 code is duplicated in the error.b24Code field:

error.b24Code When
error.b24CodePERIOD_TOO_LARGE WhenThe period exceeds 1 year
error.b24CodeINVALID_FILTER WhenInvalid filter value or date format
error.b24CodeOFFSET_TOO_LARGE Whenoffset exceeds the maximum — narrow the period or the filters

The codes of a specific method are in the ## Errors table on its page.

System errors

Common codes (SCOPE_DENIED, TOKEN_MISSING, WRITE_BLOCKED_READONLY_KEY, RATE_LIMITED and others) are on the API errors page.

See also