Update SIP Gateway - API
Updates an inbound or outbound SIP gateway by gatewayId. The same endpoint handles both directions; the server applies the field whitelist that matches the gateway's direction.
Inbound-allowed fields: name, mediaEncryption, sipRegion.
Outbound-allowed fields: name, mediaEncryption, sipRegion, address (non-empty), transport (udp / tcp / tls), auth (must include both username and password).
Valid sipRegion values: auto, us002, in002. Valid mediaEncryption values: enable, disable.
Forbidden in update (returns 400):
phoneNumbers/numbers— use the create endpoint to attach and/detachto detach.isShared— creation-time only.address,auth,transporton an inbound gateway — outbound-only.
All fields are optional — send only what you want to change.
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.
enable, disable. Allowed on both inbound and outbound. auto, us002, in002. Allowed on both inbound and outbound. 400 when sent against an inbound gateway. udp, tcp, tls. username and password. import fetch from 'node-fetch';
const options = {
method: "PATCH",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name" : "Renamed outbound GW",
"mediaEncryption" : "enable",
"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/gateways/:gatewayId`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
{
"message": "Gateway updated successfully",
"gateway": {
"id": "gw_outbound_uuid",
"address": "sip.telnyx.com:5061",
"numbers": [
"+14155551234"
],
"mediaEncryption": "enable",
"transport": "tls",
"geoRegion": "us002",
"auth": {
"username": "sip-user",
"password": "sip-pass"
}
}
}
Got a Question? Ask us on discord