Manage & View
APIs for viewing configurations, updating settings, and managing your trunk.
Get Phone Numbers
Retrieves all phone numbers mapped to a trunk.
HTTP Request
Example Request
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
metadata.page_size | Integer; Number of results per page |
metadata.first_page_uri | String; URI for the first page |
metadata.prev_page_uri | String or null; URI for previous page (null if on first page) |
metadata.next_page_uri | String or null; URI for next page (null if on last page) |
response[] | Array; List of phone number objects |
Get ACLs (Whitelisted IPs)
Retrieves all whitelisted IP addresses for a trunk.
HTTP Request
Example Request
Example Response
Get Destination URIs
Retrieves all destination URIs configured for a trunk.
HTTP Request
Example Request
Example Response
Update Phone Number Mode
Updates the routing mode for a mapped phone number. Use this to switch between PSTN and StreamKit (Voice AI) modes.
HTTP Request
Important: The <phone_number_id>is the numeric ID returned when you mapped the phone number (e.g., 41523), NOT the phone number itself.
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Request Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
phone_number | Mandatory | String; The phone number in E.164 format. Must match the phone number associated with the ID. Example: +919876543210 |
mode | Mandatory | String; The new routing mode. Can be: pstn- Route calls to telephone network, flow- Route calls to Voice AI bot (StreamKit) |
Example Request (Switch to Flow mode)
Example Request (Switch to PSTN mode)
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; The phone number mapping ID |
phone_number | String; The phone number in E.164 format |
trunk_sid | String; The associated trunk |
mode | String; The updated routing mode (pstn or flow) |
date_created | String; ISO 8601 timestamp when mapping was created |
date_updated | String; ISO 8601 timestamp when mapping was updated (will be updated after this call) |
Set Trunk Alias (Caller ID)
Sets the phone number displayed to called parties on outbound calls. This is useful when you want to display a specific caller ID regardless of which phone number is mapped to the trunk.
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Request Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
settings | Mandatory | Array; List of setting objects |
settings[].name | Mandatory | String; Setting name. Use trunk_external_aliasfor caller ID |
settings[].value | Mandatory | String; The phone number to display as caller ID. Should be in E.164 format. Example: +919876543210 |
Example Request
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
metadata.total | Integer; Total number of settings in request |
metadata.success | Integer; Number of successfully applied settings |
name | String; Setting name (trunk_external_alias) |
value | String; The caller ID phone number |
trunk_sid | String; The associated trunk |
date_created | String; ISO 8601 timestamp when setting was created |
date_updated | String; ISO 8601 timestamp when setting was last updated |
Delete Trunk
Permanently deletes a trunk and all its associated configurations (phone numbers, ACLs, destination URIs).
⚠️ Warning: This action cannot be undone. All associated phone number mappings, whitelisted IPs, and destination URIs will be permanently deleted.
HTTP Request
Example Request
Example Response
Response Parameters
The response returns the full trunk data that was deleted, allowing you to verify which trunk was removed.
List Trunks
Retrieves all SIP trunks for the account with pagination. Optionally filter to a single trunk using trunk_sid.
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Query Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
page_size | Optional | Integer; number of results per page. Default: 50 |
offset | Optional | Integer; pagination offset. Default: 0 |
trunk_sid | Optional | String; when provided, returns only the matching trunk |
Example Request
:::BlockQuote curl -s -X GET "https://<your_api_key>:<your_api_token>@<subdomain>/v2/accounts/<your_sid>/trunks?page_size=50&offset=0" :::
Example Request (single trunk filter)
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
metadata.page_size | Integer; number of results per page |
metadata.first_page_uri | String; URI for the first page |
metadata.prev_page_uri | String or null; URI for previous page |
metadata.next_page_uri | String or null; URI for next page |
response[] | Array; list of trunk objects (same fields as Create Trunk response) |
Update Trunk
Partially updates trunk properties such as trunk_name, auth_type, or nso_code.
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Request Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
trunk_name | Optional | String; Unique identifier for the trunk. Must be alphanumeric with underscores only, maximum 16 characters. |
auth_type | Optional | String; Authentication type (e.g. IP-WHITELIST) |
nso_code | Optional | String; Network Service Operator code. Use ANY-ANY for standard configuration. |
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
trunk_sid | String; Unique identifier for the trunk |
trunk_name | String; Updated trunk name |
date_updated | String; ISO 8601 timestamp when trunk was last updated |
status | String; Current trunk status (active / inactive) |
Trunk Map Lookup (Exophone)
Resolves which trunk a virtual number (ExoPhone / DID) is mapped to.
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Query Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
exophone | Mandatory | String; Virtual number / DID in E.164 format. Example: +919876543210 |
trunk_sid | Optional | String; optionally constrain lookup to a specific trunk |
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
exophone | String; The queried virtual number in E.164 format |
trunk_sid | String; Trunk SID associated with this number |
phone_number_id | String; Numeric mapping id (same id used by Update Phone Number Mode / Delete Phone Number Mapping) |
mode | String or null; Routing mode (pstn / flow / null) |
Delete Phone Number Mapping
Detaches a phone number (DID/ExoPhone) from the trunk.
Important: Pass the numeric mapping id returned when you mapped the phone number (e.g. 41523), not the phone number itself. The id is passed as query parameter id.
HTTP Request
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; Deleted phone number mapping id |
phone_number | String; The detached phone number in E.164 format |
trunk_sid | String; The trunk this mapping belonged to |
mode | String or null; Routing mode at time of delete |
Update Whitelisted IP
Updates an existing ACL (whitelisted IP) entry — for example to change IP or subnet mask.
Important: \<whitelist\_entry\_id> is the numeric id returned when you mapped the ACL (e.g. 1153), not the IP address itself.
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Request Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
ip | Mandatory | String; IPv4 address. Example: 44.248.146.11 |
mask | Mandatory | Integer; Subnet mask in CIDR notation. Example: 32, 24 |
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; Unique identifier for this ACL entry |
ip | String; The whitelisted IP address |
mask | Integer; Subnet mask in CIDR notation |
trunk_sid | String; The trunk this ACL is associated with |
date_updated | String; ISO 8601 timestamp when ACL was last updated |
Delete Whitelisted IP
Removes an ACL (whitelisted IP) entry from the trunk.
Important: Whitelist entry id is passed as query param id (not /whitelisted-ips/\<id>).
HTTP Request
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; Deleted ACL entry id |
ip | String; The IP that was removed |
mask | Integer; Subnet mask that was configured |
trunk_sid | String; The trunk this ACL belonged to |
Update Destination URI
Updates load-balancing attributes (priority, weight) for an existing destination URI.
Important: \<destination\_id> is the numeric id returned when you mapped the destination URI (e.g. 2543).
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Request Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
priority | Optional | Integer; Lower values = higher priority. Default: 0 |
weight | Optional | Integer; Higher values = more traffic. Default: 1 |
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; Destination URI id |
destination | String; The SIP URI |
priority | Integer; Updated priority |
weight | Integer; Updated weight |
trunk_sid | String; The associated trunk |
date_updated | String; ISO 8601 timestamp when destination was last updated |
Delete Destination URI
Removes a destination URI from the trunk.
Important: Destination id is passed as query param id (not /destination-uris/\<id>).
HTTP Request
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; Deleted destination URI id |
destination | String; The SIP URI that was removed |
trunk_sid | String; The trunk this destination belonged to |
Update SIP Credential
Updates an existing SIP digest credential entry (rotate password, rename label, or change username).
Important: Credential id is in the path (/credentials/\<credential\_id>), unlike Delete Credentials which uses query ?id=.
HTTP Request
Request Headers
Header | Value |
|---|---|
Content-Type | application/json |
Request Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
user_name | Optional | String; New SIP digest username |
password | Optional | String; New SIP digest password (use a strong secret) |
friendly_name | Optional | String; Label to identify where the creds are used (max 32 chars) |
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
id | String; Credential entry id |
trunk_sid | String; The associated trunk |
user_name | String; SIP digest username |
friendly_name | String or null; Optional label |
date_updated | String; ISO 8601 timestamp when credential was last updated |
List Trunk Settings
Retrieves settings configured on the trunk (for example trunk_external_alias / caller ID).
HTTP Request
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
name | String; Setting name (e.g. trunk_external_alias) |
value | String; Setting value (e.g. caller ID in E.164) |
trunk_sid | String; The associated trunk |
date_created | String; ISO 8601 timestamp when setting was created |
date_updated | String; ISO 8601 timestamp when setting was last updated |
Delete Trunk Setting
Removes a trunk setting by name (for example clears the outbound caller ID alias).
Important: Setting key is passed as query param name.
HTTP Request
Query Parameters
Parameter Name | Mandatory/Optional | Value |
|---|---|---|
name | Mandatory | String; Setting key to remove. Example: trunk_external_alias |
Example Request
HTTP Response
On success, the HTTP response status code will be 200 OK.
Example Response
Response Parameters
Parameter Name | Type & Value |
|---|---|
name | String; Deleted setting name |
value | String; Value that was removed |
trunk_sid | String; The associated trunk |