[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-voximplant-lines":3,"docs-tabs-voximplant-lines":6},{"content":4,"lastmod":5},"# Telephony lines\n\nOutgoing lines of the Bitrix24 account: the list of available lines and the default line for the entire account.\n\n**Scope:** `telephony` | **Base URL:** `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1` | **Authorization:** `X-Api-Key`\n\n[Voximplant lines](\u002Fdocs\u002Ftelephony\u002Flines\u002Fvoximplant) returns line identifiers through `GET \u002Fv1\u002Fvoximplant-lines`.\n\nYou can [get the default outgoing line](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault) and [set it](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault-set) for the entire Bitrix24 account. When setting the line, use an identifier from the list of available lines.\n\n## Quick start\n\nThe current default outgoing line:\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fvoximplant-lines\u002Fdefault\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\nThe response carries the line ID in `data.lineId`. The response fields are described on the [Get default outgoing line](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault) page.\n\n## Full example\n\nGet 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.\n\n```javascript\nconst BASE = 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1'\nconst API_KEY = 'YOUR_API_KEY'\n\nasync function call(method, path, body) {\n  const headers = { 'X-Api-Key': API_KEY }\n  if (body) headers['Content-Type'] = 'application\u002Fjson'\n  const res = await fetch(BASE + path, { method, headers, body: body && JSON.stringify(body) })\n  const json = await res.json()\n  if (!json.success) throw new Error(`${json.error.code}: ${json.error.message}`)\n  return json.data\n}\n\n\u002F\u002F 1. Account lines: [{ id, name }, ...]\nconst lines = await call('GET', '\u002Fvoximplant-lines')\nconsole.log('Lines:', lines.map(line => `${line.id} — ${line.name}`))\n\n\u002F\u002F 2. Current default line\nconst current = await call('GET', '\u002Fvoximplant-lines\u002Fdefault')\nconsole.log('Current default:', current.lineId)\n\n\u002F\u002F 3. Set the first line from the list that differs from the current one\nconst next = lines.find(line => line.id !== current.lineId)\nif (next) {\n  const saved = await call('PUT', '\u002Fvoximplant-lines\u002Fdefault', { lineId: next.id })\n  console.log('Set:', saved.lineId)\n}\n```\n\n## Endpoint reference\n\n| Method | Path | Bitrix24 method | Description |\n|-------|------|---------------|----------|\n| GET | [`\u002Fv1\u002Fvoximplant-lines`](\u002Fdocs\u002Ftelephony\u002Flines\u002Fvoximplant) | voximplant.line.get | List of outgoing lines of the account |\n| GET | [`\u002Fv1\u002Fvoximplant-lines\u002Fdefault`](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault) | voximplant.line.outgoing.get | Current default outgoing line |\n| PUT | [`\u002Fv1\u002Fvoximplant-lines\u002Fdefault`](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault-set) | voximplant.line.outgoing.set | Set the default outgoing line |\n\n## Error codes\n\n| HTTP | Code | When |\n|------|-----|-------|\n| 400 | `MISSING_REQUIRED_FIELDS` | When changing the line, the body has no `lineId`, or `lineId` is an empty string or not a string |\n| 400 | `INVALID_PARAMS` | When changing the line, `lineId` is not in the `GET \u002Fv1\u002Fvoximplant-lines` list |\n| 400 | `UNSUPPORTED_FILTER` | The `filter` parameter was passed to the line list request |\n| 403 | `SCOPE_DENIED` | The key does not have the `telephony` scope |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request or did not confirm the line change; the reason is in `error.message` |\n\nOther error codes for this section's methods are in the `## Errors` tables on the [Voximplant lines](\u002Fdocs\u002Ftelephony\u002Flines\u002Fvoximplant), [Get default outgoing line](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault) and [Set default outgoing line](\u002Fdocs\u002Fvoximplant-lines\u002Fdefault-set) pages. For the full list of common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [SIP connections](\u002Fdocs\u002Fvoximplant-sip)\n- [Calls](\u002Fdocs\u002Fcalls)\n- [Telephony](\u002Fdocs\u002Ftelephony)\n","2026-10-20",{},1795415158303]