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

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

Dialog metadata

POST /v1/openlines/dialogs/lookup

Finds an Open Channel dialog by a chat or session identifier and returns its card together with the Open Channel identifier. The method does not return the conversation; it is available through the session history.

Request fields (body)

Pass exactly one of the three fields.

Field Type Required Description
FieldchatId Typenumber | string Requiredno DescriptionOpen Channel chat identifier: the number 2043 or the string chat2043. Source: sessions[].chatId in the POST /v1/openlines/sessions/search response, or GET /v1/openlines/crm/chats for a CRM card
FielddialogId Typestring Requiredno DescriptionThe same chat, only in the chat2043 form. A number in this field is rejected with 400 INVALID_PARAMS
FieldsessionId Typenumber | string Requiredno DescriptionOpen Channel session identifier — a positive integer; a string of digits is also accepted. Source: sessions[].id in the POST /v1/openlines/sessions/search response

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/dialogs/lookup" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "chatId": 2043 }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/dialogs/lookup" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "chatId": 2043 }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/dialogs/lookup', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ chatId: 2043 }),
})
const { data } = await res.json()
console.log(data.lineId)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/dialogs/lookup', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ chatId: 2043 }),
})
const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on a successful request
Fielddata.id Typenumber DescriptionChat identifier of the dialog
Fielddata.dialogId Typestring DescriptionDialog identifier in the chat<N> form
Fielddata.name Typestring DescriptionDialog name
Fielddata.description Typestring | null DescriptionDialog description
Fielddata.type Typestring DescriptionChat type, lines for an Open Channel
Fielddata.entityType Typestring DescriptionChat entity type, LINES for an Open Channel
Fielddata.messageCount Typenumber DescriptionNumber of messages in the dialog
Fielddata.lastMessageId Typenumber DescriptionIdentifier of the last message
Fielddata.dateCreate Typestring DescriptionDialog creation date, ISO 8601
Fielddata.textFieldEnabled Typeboolean DescriptionWhether the message input field is available
Fielddata.isNew Typeboolean DescriptionNew dialog flag
Fielddata.lineId Typenumber | null DescriptionOpen Channel identifier. Full Open Channel configuration — GET /v1/openline-configs/:id. null if the Open Channel could not be determined

Response example

JSON
{
  "success": true,
  "data": {
    "id": 2043,
    "dialogId": "chat2043",
    "name": "Telegram: John",
    "description": null,
    "type": "lines",
    "entityType": "LINES",
    "messageCount": 36,
    "lastMessageId": 2109,
    "dateCreate": "2026-08-14T10:12:30+00:00",
    "textFieldEnabled": true,
    "isNew": false,
    "lineId": 1
  }
}

Error response example

403 — there is no dialog with this identifier, or the key's user has no access to it:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ACCESS_DENIED",
    "message": "You do not have access to this Open Line dialog",
    "hint": "Bitrix24 refused imopenlines.dialog.get with ACCESS_ERROR. Two possible causes: (1) the Open Line dialog does not exist, or (2) the Bitrix24 user this call runs as has no access to it. The cause is not determined; check the dialog identifier and whether that user can open this dialog in Bitrix24.",
    "cause": "unknown",
    "method": "imopenlines.dialog.get",
    "fix": { "action": "none" }
  }
}

Errors

HTTP Code Description
HTTP400 CodeMISSING_PARAMS DescriptionNone of the identifiers chatId, dialogId, sessionId was passed
HTTP400 CodeINVALID_PARAMS DescriptionA chat identifier and sessionId were passed at the same time
HTTP400 CodeINVALID_PARAMS DescriptionThe identifier value is invalid: chatId or sessionId is not a positive integer, dialogId is not in the chat<N> form
HTTP400 CodeINVALID_PARAMS DescriptionThe request body is not a JSON object
HTTP400 CodeINVALID_JSON_BODY DescriptionThe request body did not parse as JSON
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no configured Bitrix24 tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe key has no imopenlines scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe dialog does not exist, the chat does not belong to an Open Channel, or the key's user has no access to the dialog. The response does not distinguish the cause; the hint field names both causes
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 returned an empty result instead of the dialog card
HTTP429 CodeRATE_LIMITED DescriptionThe method's own limit was exceeded: the platform ceiling of 300 requests per minute applies per portal, not per key, and is split across replicas. The effective value comes in the x-ratelimit-limit header
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 returned a response of an unexpected shape

Full list of common API errors — Errors.

See also