Skip to main content
Version: /v2

Create Phone Numbers + SIP Gateways - API

Registers any unknown e164 phone numbers on your account and provisions an inbound + outbound SIP gateway pair for them.

  • isShared: true → all supplied numbers share a single inbound/outbound gateway pair.
  • isShared: false → each number gets its own dedicated inbound/outbound gateway pair.

The operation is atomic: if any of the supplied numbers is already attached to a gateway of the same direction, the request is rejected with 400 and nothing is created. If a concurrent request attaches one of the numbers before this one completes, the request returns 409 — retry it.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/sip/phone-numbers
Headers Parameters

values: YOUR_TOKEN_WITHOUT_ANY_PREFIX

This will be a JWT token generate using VideoSDK ApiKey and Secret.

Note that the token will not include any prefix such as "Basic " or "Bearer ". Just pass a token as value.

You can generate a new token by refering this Guide: Generate Auth token

REQUIRED

values: application/json

This is usefull for json body parameters, so that VideoSDK servers can understand that the incoming body parameter will be a JSON string.

Body Parameters
REQUIRED
Friendly label applied to every phone number created by this request.
REQUIRED
Array of e164-formatted phone numbers to register. Unknown numbers are inserted; known-but-detached numbers are reused.
OPTIONAL
If true, all numbers share a single inbound/outbound gateway pair. If false, each number gets its own pair.
Media encryption setting applied to both gateways. One of disable, enable.
REQUIRED
Inbound gateway config. Required nested field: sipRegion (one of auto, us002, in002).
REQUIRED
Outbound gateway config. Required nested fields: address (non-empty), sipRegion (one of auto, us002, in002), and transport (one of udp, tcp, tls). Optional: auth (requires both username and password when provided).
Response Parameters
Human-readable success message.
POST
|
https://api.videosdk.live/v2/sip/phone-numbers
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "My SIP Setup",
"phoneNumbers": [
"+14155551234",
"+14155555678"
],
"isShared": true,
"mediaEncryption": "disable",
"inbound": {
"sipRegion": "us002"
},
"outbound": {
"sipRegion": "us002",
"address": "sip.telnyx.com:5061",
"transport": "tls",
"auth": {
"username": "sip-user",
"password": "sip-pass"
}
}
}),
};
const url= `https://api.videosdk.live/v2/sip/phone-numbers`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"message": "Phone Number with SIP Configured Created Successfully"
}

Got a Question? Ask us on discord