For AI agents: markdown of this page — /docs-content-en/openlines/operator/transfer.md documentation index — /llms.txt

Transfer a dialog

POST /v1/openlines/operator/transfer

Transfers the dialog to an operator or line queue.

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.
userId number | string One target Employee from the user list.
queueId number | string One target Line from the config list.
transferId number | string One target Employee id or queue<id>.

Pass exactly one target. Zero or multiple targets return 400 INVALID_PARAMS. Self-transfer is refused with 422 BITRIX_ERROR.

Examples

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/operator/transfer" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chatId":123,"queueId":3}'
Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/operator/transfer" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"chatId":123,"queueId":3}'
javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/openlines/operator/transfer', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"chatId":123,"queueId":3}),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error.message);
console.log(result.data);
javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/openlines/operator/transfer', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    Authorization: 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"chatId":123,"queueId":3}),
});
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.transferred boolean Action accepted

Response example

JSON
{
  "success": true,
  "data": {
    "chatId": 123,
    "transferred": true
  }
}

Error response example

403: the calling employee has no access.

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ACCESS_DENIED",
    "message": "Access denied"
  }
}

Errors

HTTP Code Condition
400 INVALID_CHAT_ID Invalid chat id
400 INVALID_PARAMS Missing, multiple or malformed targets
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

System errors.

Known details

The CHAT_ID alias is accepted. In transfer requests USER_ID, QUEUE_ID and TRANSFER_ID are accepted too. OPERATOR_WRONG can also mean an absent chat and remains a 422 refusal.

See also