For AI agents: markdown of this page — /docs-content-en/telephony/lines/search.md documentation index — /llms.txt

Search application lines

POST /v1/telephony-lines/search

Returns the external lines added by the application, taking its input from the request body instead of the query string. The whole collection of lines arrives in a single page.

The same set of lines is returned by GET /v1/telephony-lines.

Request fields (body)

Field Type Required Default Description
limit number no 50 Number of records, up to 5000
select string[] no — Field selection in camelCase: ["number", "name"]

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/telephony-lines/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "limit": 3 }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/telephony-lines/search" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "limit": 3 }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/telephony-lines/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ limit: 3 }),
})

const { success, data, meta } = await res.json()
console.log(`Found ${meta.total} lines`)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/telephony-lines/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ limit: 3 }),
})

const { success, data, meta } = await res.json()

Response fields

Field Type Description
success boolean Always true on success
data array Array of application lines
data[].number string Line identifier set at creation
data[].name string | null Display name. null if it was not set at creation
data[].crmAutoCreate boolean Auto-create a CRM entity on an outbound call through this line: true — create, false — do not create
meta.total number Number of application lines
meta.hasMore boolean Whether more records exist beyond limit
meta.durationMs number Request duration in milliseconds

Response example

JSON
{
  "success": true,
  "data": [],
  "meta": {
    "total": 0,
    "hasMore": false,
    "durationMs": 600
  }
}

The data array is empty when the application has not yet added any external lines via POST /v1/telephony-lines. A response with a non-empty selection is shown in List application lines — the record has the same shape there.

Error response example

400 — a non-zero offset was passed:

JSON
{
  "success": false,
  "error": {
    "code": "UNSUPPORTED_OFFSET",
    "message": "Entity 'telephony-lines' does not support offset — B24 method \"telephony.externalLine.get\" has no pagination and returns the full collection in one page. Remove offset and window the result on your side; limit still applies."
  }
}

Errors

HTTP Code Description
400 UNSUPPORTED_OFFSET A non-zero offset was passed — application lines have no page-by-page traversal
400 UNSUPPORTED_FILTER A filter was passed — filtering by line fields is not supported
400 INVALID_SORT_FIELD A sort or order was passed — sorting is not supported
401 MISSING_API_KEY The X-Api-Key header was not provided
401 INVALID_API_KEY The key is not recognized — no such key exists on the platform
401 TOKEN_MISSING The API key has no configured tokens
401 KEY_INACTIVE The API key is inactive or revoked
403 SCOPE_DENIED The API key lacks the telephony scope
429 RATE_LIMITED Request rate limit exceeded
502 BITRIX_UNAVAILABLE Bitrix24 is temporarily unavailable — retry the request later

Full list of common API errors — Errors.

Known specifics

Switching to POST adds no filtering criteria. The body of this request takes the same minimum as the query string of the list endpoint. Find the line you need in the returned array by number on your side.

The record key is number; a line has no id field. Even when number is not named in select, it stays in every record of the response: without it a record cannot be told apart from its neighbour, nor addressed in a PATCH /v1/telephony-lines/:number call.

See also