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

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

SIP connections

Manage SIP connections of office and cloud PBXs through which the Bitrix24 account receives and places calls.

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

What to know before you start

  1. Two PBX types. cloud is a cloud PBX, office is an office PBX. The type is set on creation, defaults to cloud, and cannot be changed afterwards. For an office PBX, Bitrix24 issues an address and a login for incoming calls on creation — the incomingServer and incomingLogin fields.
  2. Passwords are write-only. password is passed on create and update but never comes back in a response: responses carry the hasPassword and hasIncomingPassword flags instead of passwords. The list cannot be filtered or sorted by these flags.
  3. Five fields can be set through the API: type, title, server, login, password. All other connection fields are read-only, and an extra field in the request body returns 400 READONLY_FIELD.
  4. Only your own application's connections are visible. The methods in this section work with connections created by the same Bitrix24 application as the key: an application key works with its own application's connections; a personal key works with connections created through the Bitrix24 account's webhooks. Another application's connection does not appear in the list, and the methods return 404 ENTITY_NOT_FOUND for its configId.
  5. The type of configId depends on the method. List, get, create and update responses return it as a string; the delete response returns it as a number. In the path the ID is passed as a number: /v1/voximplant-sip/17.

Quick start

List the SIP connections available to the key:

Terminal
curl "https://vibecode.bitrix24.com/v1/voximplant-sip" \
  -H "X-Api-Key: YOUR_API_KEY"

The response contains an array of connections in data and their count in meta.total. Connection fields are described on the List connections page.

Full example

An office PBX connection from creation to deletion: create it, read it, change the login and password, delete it. Run the script in Node.js 18+ from a file with the .mjs extension.

javascript
const BASE = 'https://vibecode.bitrix24.com/v1/voximplant-sip'
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. Create an office PBX connection
const created = await call('POST', '', {
  type: 'office',
  title: 'Office PBX',
  server: 'sip.example.com',
  login: 'office-line',
  password: 'EXAMPLE_SIP_PASSWORD',
})
console.log('Created:', created.configId, 'incoming server:', created.incomingServer)

// 2. Read the connection
const sip = await call('GET', `/${created.configId}`)
console.log('Type:', sip.type, 'password set:', sip.hasPassword)

// 3. Change the login and password
const updated = await call('PATCH', `/${created.configId}`, {
  login: 'office-line-2',
  password: 'EXAMPLE_NEW_SIP_PASSWORD',
})
console.log('New login:', updated.login)

// 4. Delete the connection
const removed = await call('DELETE', `/${created.configId}`)
console.log('Deleted:', removed.deleted)

Endpoint reference

Method Path Bitrix24 method Description
MethodGET Path/v1/voximplant-sip Bitrix24 methodvoximplant.sip.get DescriptionList connections with filtering, sorting and pagination
MethodGET Path/v1/voximplant-sip/:configId Bitrix24 methodvoximplant.sip.get DescriptionA single connection by ID
MethodPOST Path/v1/voximplant-sip Bitrix24 methodvoximplant.sip.add DescriptionCreate a connection
MethodPATCH Path/v1/voximplant-sip/:configId Bitrix24 methodvoximplant.sip.update DescriptionChange the title, server, login or password
MethodDELETE Path/v1/voximplant-sip/:configId Bitrix24 methodvoximplant.sip.delete DescriptionDelete a connection

Error codes

SIP connection errors

HTTP Code When
HTTP400 CodeINVALID_PARAMS WhenInvalid list parameters filter, sort, order, start; configId is not a positive integer; the body is not a JSON object; type is neither office nor cloud; a field value is not a string; an update contains no field other than type
HTTP400 CodeMISSING_REQUIRED_FIELDS Whenserver or login is missing on create
HTTP400 CodeREADONLY_FIELD WhenThe body contains a field other than type, title, server, login, password; or on update type differs from the current one
HTTP404 CodeENTITY_NOT_FOUND WhenNo connection with this configId among the connections available to the key
HTTP422 CodeBITRIX_ERROR WhenBitrix24 rejected the request or did not confirm the update or deletion; the reason is in error.message

System errors

HTTP Code When
HTTP401 CodeMISSING_API_KEY WhenThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY WhenThe platform does not recognize the key string: a typo, a truncated value, or a deleted key
HTTP401 CodeTOKEN_MISSING WhenThe key has no access to the portal: a personal key has no portal webhook, or an application key was sent without a session token in Authorization: Bearer
HTTP403 CodeSCOPE_DENIED WhenThe key lacks the telephony scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY WhenA read-only key attempts to create, update or delete a connection
HTTP403 CodeBITRIX_ACCESS_DENIED WhenBitrix24 denied access — causes explained
HTTP429 CodeRATE_LIMITED WhenRequest rate exceeded
HTTP429 CodeQUEUE_OVERFLOW WhenThe account request queue is full, so the request is rejected without waiting. The Retry-After header suggests the delay
HTTP429 CodeQUEUE_TIMEOUT WhenThe 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 WhenBitrix24 is unavailable
HTTP503 CodeBITRIX_TIMEOUT WhenBitrix24 did not respond in time

Full list of common API errors — Errors.

See also