Para agentes de IA: markdown desta página — /docs-content-en/voximplant-lines/default-set.md índice da documentação — /llms.txt

Os artigos da documentação estão disponíveis atualmente em inglês.

Set default outgoing line

PUT /v1/voximplant-lines/default

Sets the outgoing telephony line that the Bitrix24 account uses by default and returns the value stored on the account after the write. The setting is shared across the entire account. To read the current line, use GET /v1/voximplant-lines/default.

Scope: telephony | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key

Request fields (body)

Field Type Required Description
FieldlineId Typestring Requiredyes DescriptionLine ID from GET /v1/voximplant-lines

Examples

curl — personal key

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/voximplant-lines/default" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lineId": "reg151083"}'

curl — OAuth application

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/voximplant-lines/default" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"lineId": "reg151083"}'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/voximplant-lines/default', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ lineId: 'reg151083' }),
})
const { data } = await res.json()
console.log('Set:', data.lineId)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/voximplant-lines/default', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ lineId: 'reg151083' }),
})
const { data } = await res.json()
console.log('Set:', data.lineId)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typeobject DescriptionLine setting
Fielddata.lineId Typestring | null DescriptionID of the default outgoing line, read from the Bitrix24 account after the write

Response example

JSON
{
  "success": true,
  "data": {
    "lineId": "reg151083"
  }
}

Error response example

400 — lineId is not in the account's line list:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "lineId must come from GET /v1/voximplant-lines"
  }
}

Errors

HTTP Code Description
HTTP400 CodeMISSING_REQUIRED_FIELDS DescriptionThe body has no lineId, or lineId is an empty string or not a string
HTTP400 CodeINVALID_PARAMS DescriptionlineId is not in the GET /v1/voximplant-lines list. The setting does not change
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not passed
HTTP401 CodeINVALID_API_KEY DescriptionThe platform does not recognize the key string: a typo, a truncated value or a deleted key
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no access to the Bitrix24 account: a personal key has no account webhook, or an application key was sent without Authorization: Bearer with a session token
HTTP403 CodeSCOPE_DENIED DescriptionThe key does not have the telephony scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionA read-only key attempts to change the line
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access — causes
HTTP403 CodeB24_TARIFF_RESTRICTION DescriptionThe operation is not available on the Bitrix24 account plan
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 did not confirm the line change
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the request; the reason is in error.message
HTTP429 CodeRATE_LIMITED DescriptionRequest rate exceeded
HTTP429 CodeQUEUE_OVERFLOW DescriptionThe account request queue is full, so the request is rejected without waiting. The Retry-After header suggests the delay
HTTP429 CodeQUEUE_TIMEOUT DescriptionThe request did not get through the account queue in time and was not sent to Bitrix24. The Retry-After header suggests the delay
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond in time
HTTP503 Codeuser_self_deletion_pending DescriptionThe key owner is deleting their Bitrix24 user account. The Retry-After header equals 604800 — the length of the deletion grace period

Full list of common API errors — Errors.

See also