# Open Channel sessions

A session is one client inquiry in an Open Channel chat, from the first message until it is closed. One chat goes through several sessions. The methods in this section search sessions, read their metrics, reassignment history and message history, open a client chat and connect an operator to a dialog.

Bitrix24 API: `imopenlines.v2.Session.*`, `imopenlines.session.*`
Scope: `imopenlines`

## Method availability

Session search, per-session metrics and reassignment history ship in the `imopenlines 26.700.0` update. Until the update reaches the Bitrix24 account, they return `422 METHOD_NOT_YET_AVAILABLE`. The other methods of this section work on any Bitrix24 account. Session history is being enabled gradually by the Vibecode platform and returns `403 OPENLINES_HISTORY_DISABLED` until it is enabled.

## Identifiers

The methods of this section take two different identifiers:

| Identifier | What it is | Where to get it |
|---|---|---|
| `sessionId` | One client inquiry | The `sessions[].id` field in the [`POST /v1/openlines/sessions/search`](./sessions/search.md) response |
| `chatId` | Open Channel chat shared by all sessions of a client | The `sessions[].chatId` field in the [`POST /v1/openlines/sessions/search`](./sessions/search.md) response, [`GET /v1/openlines/crm/chats`](/docs/openlines/crm-chats) by CRM card, or [`POST /v1/openlines/sessions/open`](./sessions/open.md) by client code |

Starting a session, intercepting a dialog and joining it work only on behalf of the employee the key is bound to — the same rule as for [operator actions](/docs/openlines/operator).

## Operations

- [Session search](./sessions/search.md) — `POST /v1/openlines/sessions/search`
- [Per-session metrics](./sessions/stats.md) — `POST /v1/openlines/sessions/stats`
- [Reassignment history](./sessions/transfers.md) — `POST /v1/openlines/sessions/transfers`
- [Session history](./history.md) — `POST /v1/openlines/sessions/history`
- [Open a client chat](./sessions/open.md) — `POST /v1/openlines/sessions/open`
- [Start a session](./sessions/start.md) — `POST /v1/openlines/sessions/start`
- [Intercept a dialog](./sessions/intercept.md) — `POST /v1/openlines/sessions/intercept`
- [Join a dialog](./sessions/join.md) — `POST /v1/openlines/sessions/join`

## Typical scenario

1. Find sessions for a period: [`POST /v1/openlines/sessions/search`](./sessions/search.md).
2. Get metrics and reassignments for the found `sessionId` values: [`POST /v1/openlines/sessions/stats`](./sessions/stats.md), [`POST /v1/openlines/sessions/transfers`](./sessions/transfers.md).
3. Connect to the client dialog by `chatId`: [`POST /v1/openlines/sessions/intercept`](./sessions/intercept.md) or [`POST /v1/openlines/sessions/join`](./sessions/join.md).

## See also

- [Chats by CRM card](/docs/openlines/crm-chats)
- [Operator actions and my pause](/docs/openlines/operator)
- [Open Channels](/docs/openlines)

- [Send a CRM form](./send-form.md) — `POST /v1/openlines/sessions/send-form`
