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
|
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
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.
disable, enable. sipRegion (one of auto, us002, in002). 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). 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);
{
"message": "Phone Number with SIP Configured Created Successfully"
}
Got a Question? Ask us on discord