Skip to main content

Bridges API

The Bridges API allows you to manage telephony bridges for connecting multiple call participants. Bridges are used for call routing, conferencing, and managing telephony channels.
Prerequisites: Make sure you have your API Token. See Authentication for details.

Create Telephony Bridge

Create a new telephony bridge with the specified configuration for use in call routing or conferencing.
POST /api/v2/platform/telephony/bridges/

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier
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
namestringYesBridge name
descriptionstringNoBridge description
regionstringNoRegion code (e.g., IN, US)

Example Request

POST /api/v2/platform/telephony/bridges/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id
  Content-Type: application/json

Body:
{
  "name": "Support Bridge",
  "description": "Bridge for customer support",
  "region": "US"
}

Success Response (201)

{
  "status_code": 201,
  "message": "Bridge created successfully.",
  "data": {
    "id": 314,
    "name": "Support Bridge",
    "description": "",
    "status": "ACTIVE",
    "documents_status": "pending",
    "slug": "support-bridge-abc123",
    "numbers": [],
    "hub": 1,
    "region": "IN",
    "organization": {
      "logo": "https://example.com/org-logo.png",
      "account_type": "influencer",
      "seeking": [
        "marketplace"
      ],
      "tags": [
        "finance",
        "retail"
      ],
      "org_id": 1,
      "created": "2023-05-06T10:49:24.027999Z",
      "modified": "2025-08-26T06:57:37.047004Z",
      "name": "My Organization",
      "token": "YOUR_ORG_TOKEN",
      "domain": "example.com",
      "domain_handle": "example.com",
      "is_private_domain": true,
      "privacy_type": "shared",
      "color": "#99B0AF",
      "org_type": "pro",
      "status": "active"
    }
  }
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectCreated bridge details

Bridge Object Fields

FieldTypeDescription
idintegerBridge unique identifier
namestringBridge name
descriptionstringBridge description
statusstringBridge status
documents_statusstringDocument verification status
slugstringUnique bridge slug identifier
numbersarrayAssigned numbers (empty on creation)
hubintegerHub identifier
regionstringRegion code
organizationobjectOrganization details

Organization Object Fields

FieldTypeDescription
logostringOrganization logo URL
account_typestringAccount type
seekingarraySeeking categories
tagsarrayOrganization tags
org_idintegerOrganization ID
createdstringCreation timestamp
modifiedstringLast modified timestamp
namestringOrganization name
tokenstringOrganization token
domainstringOrganization domain
domain_handlestringDomain handle
is_private_domainbooleanWhether domain is private
privacy_typestringPrivacy type
colorstringOrganization color
org_typestringOrganization type
statusstringOrganization status

Error Response (400 — Bad Request)

{
  "status_code": 400,
  "message": "Bridge creation failed.",
  "errors": "Name is required"
}

Get All Telephony Bridges

Retrieve a list of all telephony bridges in the system, including their IDs, status, type, and associated numbers for monitoring and call-routing management.
GET /api/v2/platform/telephony/bridges/

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier

Example Request

GET /api/v2/platform/telephony/bridges/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id

Success Response (200)

{
  "count": 6,
  "status_code": 200,
  "message": "Success",
  "data": [
    {
      "id": 348,
      "name": "test",
      "slug": "test-1f5evfn7",
      "status": "ACTIVE",
      "description": ""
    }
  ]
}

Response Fields

FieldTypeDescription
countintegerTotal number of bridges
status_codeintegerHTTP status code
messagestringResponse message
dataarrayArray of bridge objects

Bridge Object Fields

FieldTypeDescription
idintegerBridge unique identifier
namestringBridge name
slugstringUnique bridge slug identifier
statusstringBridge status: ACTIVE, DRAFT, INACTIVE
descriptionstringBridge description

Error Response (400 — Bad Request)

{
  "status_code": 400,
  "message": "Invalid request parameters",
  "errors": "Detailed error description"
}

Get Bridge by Slug

Retrieve details of a specific telephony bridge using its unique slug identifier.
GET /api/v2/platform/telephony/bridges/{slug}/

Path Parameters

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

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier

Example Request

GET /api/v2/platform/telephony/bridges/sales-bridge-abc123/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id

Success Response (200)

{
  "status_code": 200,
  "message": "Bridge fetched successfully.",
  "data": {
    "id": 101,
    "name": "Sales Bridge",
    "description": "Bridge for sales team calls",
    "status": "ACTIVE",
    "documents_status": "verified",
    "slug": "sales-bridge-abc123",
    "numbers": [
      {
        "id": 501,
        "number_id": 25,
        "number": "+1234567890",
        "state": "ASSIGNED",
        "active": true,
        "channels_count": 1,
        "status": "active"
      }
    ],
    "hub": 1,
    "region": "US"
  }
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectBridge details

Bridge Object Fields

FieldTypeDescription
idintegerBridge unique identifier
namestringBridge name
descriptionstringBridge description
statusstringBridge status
documents_statusstringDocument verification status
slugstringUnique bridge slug
numbersarrayAssigned phone numbers
hubintegerHub identifier
regionstringRegion code

Number Object Fields

FieldTypeDescription
idintegerNumber assignment ID
number_idintegerPhone number ID
numberstringPhone number (E.164)
statestringNumber state
activebooleanWhether number is active
channels_countintegerNumber of channels
statusstringNumber status

Error Response (404 — Not Found)

{
  "status_code": 404,
  "message": "Bridge not found.",
  "errors": "No bridge exists with the provided slug"
}

Update Telephony Bridge

Update an existing telephony bridge’s configuration or status.
PATCH /api/v2/platform/telephony/bridges/{slug}/

Path Parameters

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

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
namestringNoUpdated bridge name
descriptionstringNoUpdated bridge description
statusstringNoUpdated status: ACTIVE, DRAFT, etc.

Example Request

PATCH /api/v2/platform/telephony/bridges/sales-bridge-abc123/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id
  Content-Type: application/json

Body:
{
  "name": "Sales Bridge Updated",
  "status": "ACTIVE"
}

Success Response (200)

{
  "status_code": 200,
  "message": "Bridge updated successfully.",
  "data": {
    "id": 101,
    "name": "Sales Bridge Updated",
    "description": "Bridge for sales team calls",
    "status": "ACTIVE",
    "documents_status": "verified",
    "slug": "sales-bridge-abc123",
    "numbers": [],
    "hub": 1,
    "region": "US"
  }
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectUpdated bridge details

Bridge Object Fields

FieldTypeDescription
idintegerBridge unique identifier
namestringBridge name
descriptionstringBridge description
statusstringBridge status
documents_statusstringDocument verification status
slugstringUnique bridge slug
numbersarrayAssigned phone numbers
hubintegerHub identifier
regionstringRegion code

Error Response (400 — Bad Request)

{
  "status_code": 400,
  "message": "Bridge update failed.",
  "errors": "Invalid status value"
}

Delete Telephony Bridge

Remove an existing telephony bridge from the system, freeing its associated resources.
DELETE /api/v2/platform/telephony/bridges/{slug}/

Path Parameters

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

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier

Example Request

DELETE /api/v2/platform/telephony/bridges/support-bridge-xyz789/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id

Success Response (200)

{
  "status_code": 200,
  "message": "Bridge deleted successfully.",
  "data": {}
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectEmpty object

Error Response (404 — Not Found)

{
  "status_code": 404,
  "message": "Bridge not found.",
  "errors": "No bridge exists with the provided slug"
}

Connect Provider to Bridge

Connect a provider credential to a specific telephony bridge for enabling call functionality.
The provider_credential_id must be a configuration that is already assigned to the bridge. You can only use a number_id that is linked to the bridge while connect and disconnect provider.
POST /api/v2/platform/telephony/bridges/{slug}/connect-provider/

Path Parameters

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

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier
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
provider_credential_idintegerYesID of the provider credential

Example Request

POST /api/v2/platform/telephony/bridges/sales-bridge-abc123/connect-provider/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id
  Content-Type: application/json

Body:
{
  "provider_credential_id": 10
}

Success Response (200)

{
  "status_code": 200,
  "message": "Provider connected to bridge successfully.",
  "data": {
    "id": 101,
    "name": "Sales Bridge",
    "slug": "sales-bridge-abc123",
    "provider_credential": {
      "id": 10,
      "name": "Main Provider",
      "provider": 3,
      "provider_details": {
        "id": 3,
        "name": "Twilio",
        "type": "TELEPHONY"
      },
      "active": true
    }
  }
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectBridge details

Bridge Object Fields

FieldTypeDescription
idintegerBridge unique identifier
namestringBridge name
slugstringUnique bridge slug
provider_credentialobjectProvider credential info

Provider Credential Object Fields

FieldTypeDescription
idintegerCredential ID
namestringCredential name
providerintegerProvider ID
provider_detailsobjectProvider details
activebooleanWhether credential active

Provider Details Object Fields

FieldTypeDescription
idintegerProvider ID
namestringProvider name
typestringProvider type

Error Response (400 — Bad Request)

{
  "status_code": 400,
  "message": "Failed to connect provider.",
  "errors": "Provider credential not found or inactive"
}

Disconnect Provider from Bridge

Disconnect a provider credential from a specific telephony bridge.
POST /api/v2/platform/telephony/bridges/{slug}/disconnect-provider/

Path Parameters

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

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Product-IDstringYesProduct identifier
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
provider_credential_idintegerYesID of the provider credential

Example Request

POST /api/v2/platform/telephony/bridges/sales-bridge-abc123/disconnect-provider/
Headers:
  Authorization: Token your-api-token
  Org-Handle: your-org-handle
  Product-ID: your-product-id
  Content-Type: application/json

Body:
{
  "provider_credential_id": 10
}

Success Response (200)

{
  "status_code": 200,
  "message": "Provider disconnected from bridge successfully.",
  "data": {
    "id": 101,
    "name": "Sales Bridge",
    "slug": "sales-bridge-abc123",
    "provider_credential": null
  }
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectBridge details

Bridge Object Fields

FieldTypeDescription
idintegerBridge unique identifier
namestringBridge name
slugstringUnique bridge slug
provider_credentialnullNull after provider disconnected

Error Response (400 — Bad Request)

{
  "status_code": 400,
  "message": "Failed to disconnect provider.",
  "errors": "Provider is not connected to this bridge"
}

Common Error Codes

Status CodeDescription
200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid parameters provided
401Unauthorized - Invalid or missing API token
403Forbidden - Access denied to the resource
404Not Found - Bridge or resource 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',
  'Product-ID': 'your-product-id',
  'Content-Type': 'application/json'
};

// Get all bridges
const getBridges = async () => {
  const response = await axios.get(
    'https://unpod.dev/api/v2/platform/telephony/bridges/',
    { headers }
  );
  console.log(`Total bridges: ${response.data.count}`);
  return response.data.data;
};

// Create a new bridge
const createBridge = async (name, description, region = 'US') => {
  const response = await axios.post(
    'https://unpod.dev/api/v2/platform/telephony/bridges/',
    { name, description, region },
    { headers }
  );
  console.log(`Bridge created: ${response.data.data.slug}`);
  return response.data.data;
};

// Get bridge by slug
const getBridgeBySlug = async (slug) => {
  const response = await axios.get(
    `https://unpod.dev/api/v2/platform/telephony/bridges/${slug}/`,
    { headers }
  );
  console.log(`Bridge: ${response.data.data.name}`);
  return response.data.data;
};

// Update a bridge
const updateBridge = async (slug, updates) => {
  const response = await axios.patch(
    `https://unpod.dev/api/v2/platform/telephony/bridges/${slug}/`,
    updates,
    { headers }
  );
  console.log(`Bridge updated: ${response.data.data.name}`);
  return response.data.data;
};

// Delete a bridge
const deleteBridge = async (slug) => {
  const response = await axios.delete(
    `https://unpod.dev/api/v2/platform/telephony/bridges/${slug}/`,
    { headers }
  );
  console.log('Bridge deleted successfully');
  return response.data;
};

// Connect provider to bridge
const connectProvider = async (slug, providerCredentialId) => {
  const response = await axios.post(
    `https://unpod.dev/api/v2/platform/telephony/bridges/${slug}/connect-provider/`,
    { provider_credential_id: providerCredentialId },
    { headers }
  );
  console.log('Provider connected successfully');
  return response.data.data;
};

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

// Example usage
getBridges();

Best Practices

  1. Bridge Naming: Use descriptive names for bridges to easily identify their purpose
  2. Status Management: Keep bridges in DRAFT status until fully configured
  3. Provider Connection: Connect appropriate provider credentials before activating a bridge
  4. Error Handling: Always handle potential errors and implement retry logic
  5. Cleanup: Delete unused bridges to free up resources
  6. Security: Keep API tokens secure and rotate them regularly
  7. Monitoring: Monitor bridge status and call quality metrics
  8. Region Selection: Choose appropriate regions for optimal call quality