لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/voximplant-lines.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Telephony lines
Outgoing lines of the Bitrix24 account: the list of available lines and the default line for the entire account.
Scope: telephony | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key
Voximplant lines returns line identifiers through GET /v1/voximplant-lines.
You can get the default outgoing line and set it for the entire Bitrix24 account. When setting the line, use an identifier from the list of available lines.
Quick start
The current default outgoing line:
curl "https://vibecode.bitrix24.com/v1/voximplant-lines/default" \
-H "X-Api-Key: YOUR_API_KEY"
The response carries the line ID in data.lineId. The response fields are described on the Get default outgoing line page.
Full example
Get the list of lines, read the current default line and set another one. The script runs in Node.js 18+ from a file with the .mjs extension. Changing the line affects the entire Bitrix24 account.
const BASE = 'https://vibecode.bitrix24.com/v1'
const API_KEY = 'YOUR_API_KEY'
async function call(method, path, body) {
const headers = { 'X-Api-Key': API_KEY }
if (body) headers['Content-Type'] = 'application/json'
const res = await fetch(BASE + path, { method, headers, body: body && JSON.stringify(body) })
const json = await res.json()
if (!json.success) throw new Error(`${json.error.code}: ${json.error.message}`)
return json.data
}
// 1. Account lines: [{ id, name }, ...]
const lines = await call('GET', '/voximplant-lines')
console.log('Lines:', lines.map(line => `${line.id} — ${line.name}`))
// 2. Current default line
const current = await call('GET', '/voximplant-lines/default')
console.log('Current default:', current.lineId)
// 3. Set the first line from the list that differs from the current one
const next = lines.find(line => line.id !== current.lineId)
if (next) {
const saved = await call('PUT', '/voximplant-lines/default', { lineId: next.id })
console.log('Set:', saved.lineId)
}
Endpoint reference
| Method | Path | Bitrix24 method | Description |
|---|---|---|---|
| MethodGET | Path/v1/voximplant-lines |
Bitrix24 methodvoximplant.line.get | DescriptionList of outgoing lines of the account |
| MethodGET | Path/v1/voximplant-lines/default |
Bitrix24 methodvoximplant.line.outgoing.get | DescriptionCurrent default outgoing line |
| MethodPUT | Path/v1/voximplant-lines/default |
Bitrix24 methodvoximplant.line.outgoing.set | DescriptionSet the default outgoing line |
Error codes
| HTTP | Code | When |
|---|---|---|
| HTTP400 | CodeMISSING_REQUIRED_FIELDS |
WhenWhen changing the line, the body has no lineId, or lineId is an empty string or not a string |
| HTTP400 | CodeINVALID_PARAMS |
WhenWhen changing the line, lineId is not in the GET /v1/voximplant-lines list |
| HTTP400 | CodeUNSUPPORTED_FILTER |
WhenThe filter parameter was passed to the line list request |
| HTTP403 | CodeSCOPE_DENIED |
WhenThe key does not have the telephony scope |
| HTTP422 | CodeBITRIX_ERROR |
WhenBitrix24 rejected the request or did not confirm the line change; the reason is in error.message |
Other error codes for this section's methods are in the ## Errors tables on the Voximplant lines, Get default outgoing line and Set default outgoing line pages. For the full list of common API errors, see Errors.