Skip to main content
POST
/
api
/
v2
/
platform
/
telephony
/
bridges
/
{slug}
/
disconnect-provider
Disconnect Provider from Bridge
curl --request POST \
  --url http://localhost:3001/api/v2/platform/telephony/bridges/{slug}/disconnect-provider/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Org-Handle: <org-handle>' \
  --data '
{
  "phone_number": "+1234567890"
}
'
{
  "status_code": 200,
  "message": "Provider disconnected from bridge successfully.",
  "data": {
    "message": "Provider disconnected successfully",
    "bridge_slug": "sales-bridge-001"
  }
}
{
  "status_code": 200,
  "message": "Provider disconnected from bridge successfully.",
  "data": {
    "message": "Provider disconnected successfully",
    "bridge_slug": "sales-bridge-001"
  }
}

Disconnect Provider from Bridge

Disconnect a telephony provider from a specific bridge, removing the associated phone number from the bridge. Use this before deleting a bridge or reassigning a phone number to a different bridge.
Prerequisites: Make sure you have your API Token and Org-Handle ready. See Authentication for details.

Path Parameters

NameTypeRequiredDescription
slugstringYesUnique bridge slug
You can get the bridge slug by hitting the Get All Bridges API. The slug field in the response is your Bridge Slug.

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Content-TypestringYesapplication/json
You can get the Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.

Request Body

FieldTypeRequiredDescription
phone_numberstringYesPhone number (E.164 format) to remove from the bridge

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectDisconnection result

Data Object Fields

FieldTypeDescription
messagestringSuccess message
bridge_slugstringThe bridge slug the provider disconnected from

Common Error Codes

Status CodeDescription
200Success - Provider disconnected successfully
400Bad Request - Phone number not connected or invalid
401Unauthorized - Invalid or missing API token
403Forbidden - Invalid organization handle
404Not Found - Bridge not found
500Internal Server Error - Server-side error

Code Examples

const axios = require('axios');

const headers = {
  'Authorization': 'Token your-api-token',
  'Org-Handle': 'your-org-handle',
  'Content-Type': 'application/json'
};

// Disconnect a provider from a bridge
const disconnectProviderFromBridge = async (slug, phoneNumber) => {
  const response = await axios.post(
    `https://unpod.dev/api/v2/platform/telephony/bridges/${slug}/disconnect-provider/`,
    { phone_number: phoneNumber },
    { headers }
  );
  console.log(`Provider disconnected from bridge: ${response.data.data.bridge_slug}`);
  return response.data.data;
};

// Example usage
disconnectProviderFromBridge('sales-bridge-001', '+1234567890');

Best Practices

  1. Pre-disconnect Check: Verify the phone number is currently connected using Get Bridge by Slug before disconnecting
  2. Phone Number Format: Use E.164 format (e.g., +1234567890) for the phone_number field
  3. Before Deletion: Always disconnect providers before deleting a bridge to ensure clean teardown
  4. Error Handling: Handle 400 errors — the phone number may not be connected to the specified bridge
  5. Service Disruption: Disconnecting an active number will stop calls routing through the bridge immediately
  6. Security: Keep API tokens secure and rotate them regularly

Authorizations

Authorization
string
header
required

Format: Token

Headers

Org-Handle
string
required

Organization domain handle

Example:

"unpod"

Path Parameters

slug
string
required
Example:

"sales-bridge"

Body

application/json
phone_number
string
required
Example:

"+1234567890"

Response

Provider disconnected from bridge