For AI agents: markdown of this page — /docs-content-en/openlines/sessions/start.md documentation index — /llms.txt
Start a session
POST /v1/openlines/sessions/start
Starts a session in an Open Line chat. If a session is already active, joins the operator to it.
Scope: imopenlines. A write-enabled key is required.
Request body fields
| Field | Type | Required | Description |
|---|---|---|---|
chatId |
number | string | Yes | Positive safe integer. Open Line chat object id from session search or client chat open. Numeric strings are accepted. |
Examples
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/sessions/start" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chatId":123}'
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/sessions/start" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"chatId":123}'
const response = await fetch('https://vibecode.bitrix24.com/v1/openlines/sessions/start', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"chatId":123}),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error.message);
console.log(result.data);
const response = await fetch('https://vibecode.bitrix24.com/v1/openlines/sessions/start', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
Authorization: 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({"chatId":123}),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error.message);
console.log(result.data);
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | true |
data |
object | Operation result |
data.chatId |
number | Open Line chat id |
data.started |
boolean | Action accepted |
Response example
{
"success": true,
"data": {
"chatId": 123,
"started": true
}
}
Error response example
403: the calling employee has no access.
{
"success": false,
"error": {
"code": "BITRIX_ACCESS_DENIED",
"message": "Access denied"
}
}
Errors
| HTTP | Code | Condition |
|---|---|---|
| 400 | INVALID_CHAT_ID |
Invalid chat id |
| 403 | SCOPE_DENIED |
Missing imopenlines scope |
| 403 | BITRIX_ACCESS_DENIED |
No access in Bitrix24 |
| 403 | WRITE_BLOCKED_READONLY_KEY |
Key forbids writes |
| 404 | ENTITY_NOT_FOUND |
Bitrix24 identifies an absent chat |
| 422 | BITRIX_ERROR |
Business refusal; message is preserved |
| 502 | OPENLINE_OPERATOR_FAILED |
Unexpected result or unapplied pause state |
Known details
The CHAT_ID alias is accepted. Bitrix24 checks permissions.