Skip to main content
Version: /v2

Detach Gateway from Phone Number - API

Detaches both the inbound and outbound SIP gateways from the given phone number, leaving the number itself active and available for re-attachment.

Note: a gateway that becomes empty as a result of this detach is not automatically deleted — it stays in your account until you remove it.

Response shape: { message, phoneNumber, inbound, outbound }. inbound and outbound are the IDs of the gateways the number was detached from (or null if the number wasn't attached to that direction) — they are not full gateway objects.

Responses:

  • 200 success.
  • 400 phoneNumber missing in body, or the number is not attached to any gateway.
  • 404 phone number not found.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/sip/phone-numbers/detach
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
The e164-formatted phone number whose inbound + outbound gateways should be detached.
Response Parameters
Human-readable success message.
The phone number record after detach.
Gateway ID (string) of the inbound gateway the number was detached from, or null if it wasn't attached to one.
Gateway ID (string) of the outbound gateway the number was detached from, or null if it wasn't attached to one.
POST
|
https://api.videosdk.live/v2/sip/phone-numbers/detach
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"phoneNumber" : "+14155551234"
}),
};
const url= `https://api.videosdk.live/v2/sip/phone-numbers/detach`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"message": "Detached successfully",
"phoneNumber": {
"phoneNumberId": "pn_abc123",
"e164": "+14155551234",
"countryCode": "US",
"provider": "other",
"origin": "SIP Configured",
"status": "ACTIVE",
"createdAt": "2026-05-11T10:00:00.000Z",
"updatedAt": "2026-05-11T10:05:00.000Z",
"name": "My SIP Setup"
},
"inbound": "gw_inbound_uuid",
"outbound": "gw_outbound_uuid"
}

Got a Question? Ask us on discord