Skip to main content
Version: /v2

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 /detach to detach.
  • isShared — creation-time only.
  • address, auth, transport on an inbound gateway — outbound-only.

All fields are optional — send only what you want to change.

HTTP method and endpoint

PATCH

|

https://api.videosdk.live/v2/sip/phone-numbers/gateways/:gatewayId
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.

Parameters
REQUIRED
Unique identifier of the inbound or outbound SIP gateway to update.
Body Parameters
OPTIONAL
New friendly label for the gateway. Allowed on both inbound and outbound.
Media encryption setting. One of enable, disable. Allowed on both inbound and outbound.
OPTIONAL
Geographical region for the gateway. One of auto, us002, in002. Allowed on both inbound and outbound.
OPTIONAL
Outbound only. Destination SIP address (non-empty). Returns 400 when sent against an inbound gateway.
OPTIONAL
Outbound only. Transport protocol — one of udp, tcp, tls.
OPTIONAL
Outbound only. SIP credentials — must include both username and password.
Response Parameters
Human-readable success message.
The updated gateway. Inbound gateways always have address: null and auth: {}.
PATCH
|
https://api.videosdk.live/v2/sip/phone-numbers/gateways/:gatewayId
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);
RESPONSE
{
"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