Para agentes de IA: markdown de esta página — /docs-content-en/voximplant-sip/create.md índice de la documentación — /llms.txt

Los artículos de la documentación están disponibles actualmente en inglés.

Create connection

POST /v1/voximplant-sip

Creates a SIP connection to an office or cloud PBX. The Bitrix24 account receives and makes calls through this connection. The body is a flat JSON object.

Request fields (body)

Field Type Required Description
server string yes SIP server address
login string yes Login on the SIP server
password string no Connection password. Not returned in responses — the hasPassword flag is returned instead
type string no PBX type: office — office PBX, cloud — cloud PBX. Defaults to cloud. The type cannot be changed after creation
title string no Connection name

All values are strings. The body accepts no other fields.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/voximplant-sip" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "office",
    "title": "Office PBX",
    "server": "sip.example.com",
    "login": "office-line",
    "password": "EXAMPLE_SIP_PASSWORD"
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/voximplant-sip" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "office",
    "title": "Office PBX",
    "server": "sip.example.com",
    "login": "office-line",
    "password": "EXAMPLE_SIP_PASSWORD"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/voximplant-sip', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'office',
    title: 'Office PBX',
    server: 'sip.example.com',
    login: 'office-line',
    password: 'EXAMPLE_SIP_PASSWORD',
  }),
})

const { success, data } = await res.json()
if (success) {
  console.log('Created connection', data.configId, 'incoming server:', data.incomingServer)
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/voximplant-sip', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'office',
    title: 'Office PBX',
    server: 'sip.example.com',
    login: 'office-line',
    password: 'EXAMPLE_SIP_PASSWORD',
  }),
})

const { success, data } = await res.json()
if (success) {
  console.log('Created connection', data.configId, 'incoming server:', data.incomingServer)
}

Response fields

A successful request returns status 201. Passwords are not included in the response — the hasPassword and hasIncomingPassword flags are returned instead.

Field Type Description
success boolean true on success
data.id string ID of the created connection, same as configId
data.configId string Connection ID — used to get, update, and delete the connection
data.type string PBX type: office — office PBX, cloud — cloud PBX
data.title string Connection name
data.server string SIP server address
data.login string Login on the SIP server
data.hasPassword boolean Whether the connection password is set
data.authUser string | null User name for authentication on the SIP server. null if not set
data.outboundProxy string | null Proxy server address for outgoing calls. null if not set
data.detectLineNumber string Whether to detect the line number from the SIP headers of an incoming call: N — do not detect
data.lineDetectHeaderOrder string SIP headers used to detect the line number, in the order they are checked, for example diversion;to
data.registrationStatusCode string | null Result code of registration on the SIP server. null right after creation
data.registrationErrorMessage string | null Registration error text. null if there is no error
data.regId number Cloud PBX only: registration ID on the SIP server. A number in the create response, a string in the list and get responses
data.incomingServer string Office PBX only: server address for incoming calls, issued by Bitrix24
data.incomingLogin string Office PBX only: login for incoming calls, issued by Bitrix24
data.hasIncomingPassword boolean Office PBX only: whether the password for incoming calls is set

Response example

JSON
{
  "success": true,
  "data": {
    "id": "17",
    "type": "office",
    "configId": "17",
    "server": "sip.example.com",
    "login": "office-line",
    "hasPassword": true,
    "incomingServer": "ip.b24-1234-1234567890.bitrixphone.com",
    "incomingLogin": "sip17",
    "hasIncomingPassword": true,
    "authUser": null,
    "outboundProxy": null,
    "detectLineNumber": "N",
    "lineDetectHeaderOrder": "diversion;to",
    "registrationStatusCode": null,
    "registrationErrorMessage": null,
    "title": "Office PBX"
  }
}

Error response example

400 — server or login is missing:

JSON
{
  "success": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELDS",
    "message": "server and login are required"
  }
}

Errors

HTTP Code Description
400 MISSING_REQUIRED_FIELDS server or login is missing
400 INVALID_PARAMS The request body is not a JSON object
400 INVALID_PARAMS type is neither office nor cloud
400 INVALID_PARAMS A field value is not a string
400 READONLY_FIELD The body contains a field other than type, title, server, login, password
401 MISSING_API_KEY The X-Api-Key header is missing
401 INVALID_API_KEY The platform does not recognize this key string: a typo, a truncated value, or a deleted key
401 TOKEN_MISSING The 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
403 SCOPE_DENIED The key does not have the telephony scope
403 WRITE_BLOCKED_READONLY_KEY The key is read-only — see access rights
403 BITRIX_ACCESS_DENIED Bitrix24 denied access — possible causes
422 BITRIX_ERROR Bitrix24 rejected the creation; the reason is in error.message
429 RATE_LIMITED Request rate exceeded
429 QUEUE_OVERFLOW The account request queue is full, so the request is rejected without waiting. The Retry-After header suggests the delay
429 QUEUE_TIMEOUT The request did not get through the account queue in time and was not sent to Bitrix24. The Retry-After header suggests the delay
502 BITRIX_UNAVAILABLE Bitrix24 is unavailable
503 BITRIX_TIMEOUT Bitrix24 did not respond in time

Full list of common API errors — Errors.

Known specifics

  • Bitrix24 issues the incoming-call credentials for an office PBX. When you create a connection of type office, the response immediately contains incomingServer and incomingLogin, and hasIncomingPassword is true. The API does not return the incoming-call password itself.
  • A connection is visible only to its own application. Only keys of the same Bitrix24 application can find the created connection: a connection created with a personal key is not visible to an app key, and vice versa.

See also