Para agentes de IA: markdown desta página — /docs-content-en/openlines.md índice da documentação — /llms.txt

Os artigos da documentação estão disponíveis atualmente em inglês.

Open Channels

Bitrix24 Open Channels (the imopenlines module) — inbound inquiries from messengers and social networks, routing to operators, CRM integration, and service-quality ratings. The section covers two facets of the module: managing channel settings and the contact-center manager's dashboard statistics.

  • Base URL: https://vibecode.bitrix24.com
  • Authentication: the X-Api-Key header (personal key) or X-Api-Key + Authorization: Bearer (OAuth application)
  • Key scope: imopenlines

Quick start | Full example | Endpoint reference | Error codes

What the section covers

Facet Purpose Documentation
Open Channel configuration CRUD for channel settings: operator queue, working hours, CRM integration, welcome message, ratings Open Channel configuration
Statistics (dashboard) Read-only: aggregates, sessions, operators, CSAT, transfers below in this section

Identifiers

Identifier What it is Where to get it
configId Open Channel GET /v1/openline-configs
sessionId Open Channel session (dialog) POST /v1/openlines/sessions/search
chatId IM chat bound to the session the chatId field in the sessions/search response

Open Channel configuration

Managing Open Channel settings — create, list, get, update, delete, search. Generally available, no rollout required. Two operator actions on a dialog live here as well: accepting it for handling (answer) and finishing it (finish).

Full documentation: Open Channel configuration.

Statistics (dashboard)

The statistics methods are being rolled out — they ship in the imopenlines 26.700.0 update. They are not available on all Bitrix24 accounts yet. If the methods are not yet available on your Bitrix24 account, the API returns 422 METHOD_NOT_YET_AVAILABLE — this is not an integration error but a sign that the update has not reached the account yet.

A list of inquiries with metrics, real-time operator load, channel aggregates, customer ratings (CSAT), and transfer history. All methods are read-only. Data is scoped to the permissions of the user the key acts on behalf of: if that user has no access to any channel, the method returns an empty result (or zero aggregates) rather than an error. These methods require access to Open Channels statistics — the report_open_lines permission. Without it, a request returns 403 B24_TARIFF_RESTRICTION.

Endpoint Purpose
POST /v1/openlines/stats Channel aggregates for a period
GET /v1/openlines/operators Operators: status and load in real time
POST /v1/openlines/sessions/search Session list with filters
POST /v1/openlines/sessions/stats Metrics for specific sessions, up to 100 per call
POST /v1/openlines/ratings/search Sessions with a customer rating for a period
POST /v1/openlines/sessions/transfers Transfer history, up to 50 sessions per call

All six methods ship in the imopenlines 26.700.0 update. The Bitrix24 method names for cross-referencing with the Bitrix24 documentation are in the Endpoint reference.

Session correspondence

A standalone generally-available method (no rollout required): the transcript of a chat's latest Open Channel session by its identifier — messages, participants and file metadata in one response.

Endpoint Purpose
POST /v1/openlines/sessions/history Transcript of a chat's latest session by chatId (messages, participants, files)

The endpoint is enabled gradually by the Vibecode platform: while it is off, the call answers 403 OPENLINES_HISTORY_DISABLED. The report_open_lines permission and the 26.700.0 update are NOT required for this method. Full documentation: Session history.

Common scenarios

Scenario Endpoints
Historical report on inquiries for a period POST /v1/openlines/sessions/search
Real-time monitor of the queue and operator load GET /v1/openlines/operators
Dashboard with customer ratings (CSAT) POST /v1/openlines/ratings/search, POST /v1/openlines/stats
Summary KPI for a channel (by hour and source) POST /v1/openlines/stats
Session card for complaint review POST /v1/openlines/sessions/stats
Full session correspondence for case review POST /v1/openlines/sessions/history
Analysis of transfers between operators POST /v1/openlines/sessions/transfers

Recommendations

  • For summary metrics, use stats — it computes aggregates on the Bitrix24 side. Do not assemble the same figures with client-side aggregation over sessions/search: that runs into the Bitrix24 REST request limit.
  • operators returns near-real-time data (status and the active-chat counter are read separately). For a monitoring widget, poll the method no more than once every 30 seconds.
  • stats is a heavy method: request it no more than once every 30–60 seconds and cache the result on your side.
  • Call statistics live on a separate endpoint — GET /v1/calls/statistics. Open Channels statistics use POST requests because they carry rich filters.

Quick start

Channel aggregates for June:

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-06-01T00:00:00+00:00",
    "dateTo": "2026-06-30T23:59:59+00:00",
    "configId": 3
  }'
JSON
{
  "success": true,
  "data": {
    "totalSessions": 340,
    "closedSessions": 318,
    "spamSessions": 4,
    "avgWaitAnswer": 42.7,
    "avgSessionDuration": 612.3,
    "likeCount": 210,
    "dislikeCount": 15,
    "votedSessions": 225,
    "positiveRate": 0.9333,
    "kpiFirstAnswerOk": 300,
    "kpiFirstAnswerFail": 18,
    "sessionsBySource": [{ "source": "livechat", "count": 200 }, { "source": "whatsapp", "count": 140 }],
    "sessionsByHour": [0,0,0,0,0,0,2,10,25,40,38,30,28,22,20,25,30,20,15,10,8,5,3,1],
    "sessionsByOperator": [{ "operatorId": 42, "count": 120, "avgWaitAnswer": 38.1, "positiveRate": 0.95 }]
  }
}

Full example

Report "inquiries for the month with a review of problem sessions":

  1. POST /v1/openlines/stats with dateFrom/dateTo — summary metrics for the channel.
  2. POST /v1/openlines/sessions/search with the same period and limit: 50 — the first page of the session list. Pagination: increase offset by limit while data.hasNextPage equals true.
  3. POST /v1/openlines/sessions/stats with an array of sessionId (up to 100) — detailed metrics for the selected sessions.

For a stable page-by-page export, pin the upper bound of the period: set dateCreateTo to the moment the export starts. Without a fixed bound, new sessions arriving during paging shift the pages, and records at the boundaries may be duplicated or lost.

Endpoint reference

All 18 endpoints of the section:

Method Path Bitrix24 method Description
POST /v1/openline-configs imopenlines.config.add Create a channel configuration
GET /v1/openline-configs imopenlines.config.list.get List configurations
GET /v1/openline-configs/:id imopenlines.config.get Configuration by identifier, with the operator queue
PATCH /v1/openline-configs/:id imopenlines.config.update Update a configuration
DELETE /v1/openline-configs/:id imopenlines.config.delete Delete a configuration
POST /v1/openline-configs/search imopenlines.config.list.get Search configurations by filter
GET /v1/openline-configs/fields Configuration field schema
POST /v1/openline-configs/aggregate imopenlines.config.list.get Aggregate over configurations
POST /v1/openlines/operator/answer imopenlines.operator.answer Accept a dialog as the operator
POST /v1/openlines/operator/finish imopenlines.operator.finish Finish a dialog as the operator
POST /v1/openlines/dialogs/lookup imopenlines.dialog.get Dialog metadata by chatId/dialogId/sessionId + derived lineId
POST /v1/openlines/stats imopenlines.v2.Stat.get Channel aggregates for a period
GET /v1/openlines/operators imopenlines.v2.Operator.list Operators: status and load in real time
POST /v1/openlines/sessions/search imopenlines.v2.Session.list Session list with filters
POST /v1/openlines/sessions/stats imopenlines.v2.Session.Stat.get Metrics for selected sessions, up to 100 per call
POST /v1/openlines/ratings/search imopenlines.v2.Session.Rating.list Sessions with a customer rating for a period
POST /v1/openlines/sessions/transfers imopenlines.v2.Session.Transfer.list Transfer history, up to 50 sessions per call
POST /v1/openlines/sessions/history imopenlines.session.history.get Transcript of a chat's latest session by chatId

Open Channel configuration and operator actions work on any Bitrix24 account. The six statistics methods ship in the imopenlines 26.700.0 update — until it reaches the account, they return 422, 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
403 B24_TARIFF_RESTRICTION The Bitrix24 plan of this portal does not include Open Channels statistics (the report_open_lines permission)
422 METHOD_NOT_YET_AVAILABLE The imopenlines 26.700.0 update has not reached this portal yet. The response contains an error.release field set to imopenlines 26.700.0code details. Once the update arrives, the method starts working. If the plan does not include statistics, the call then returns 403 B24_TARIFF_RESTRICTION instead
400 INVALID_JSON_BODY The request body did not parse as JSON. It is returned by all five methods that take a body — stats, sessions/search, ratings/search, sessions/stats, sessions/transfers. The check runs before field validation, so the response says nothing about missing parameters
400 MISSING_PARAMS Required parameters are missing (the period for stats/ratings, sessionId for the batch methods)
400 INVALID_PARAMS The request body is not an object, or contains non-numeric/invalid values where numbers are expected
400 BATCH_LIMIT_EXCEEDED The sessionId array exceeds the method limit (100 for sessions/stats, 50 for sessions/transfers)

When Bitrix24 rejects the call, the response arrives as 422 BITRIX_ERROR, and the raw Bitrix24 code is duplicated in the error.b24Code field:

error.b24Code When
PERIOD_REQUIRED Bitrix24 did not recognize the period (for example, a date in an unknown format)
PERIOD_TOO_LARGE The period exceeds 1 year
INVALID_FILTER An invalid filter value or date format
OFFSET_TOO_LARGE offset exceeds the maximum — narrow the period or filters

System errors

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

See also