API Endpoint
The Trunk Object
| Attribute | Type | Description |
|---|---|---|
trunk_id | string | Unique identifier for the trunk |
trunk_domain | string | Unique address on Plivo to route SIP traffic (e.g., 21784177241578.zt.plivo.com) |
name | string | Friendly name for the trunk |
trunk_status | string | Status: enabled or disabled |
trunk_direction | string | Direction: inbound or outbound |
secure | boolean | Whether SRTP (media) and TLS (signaling) encryption is enabled |
ipacl_uuid | string | IP access control list UUID (outbound trunks) |
credential_uuid | string | Credentials list UUID (outbound trunks) |
primary_uri_uuid | string | Primary origination URI UUID (inbound trunks) |
fallback_uri_uuid | string | Fallback origination URI UUID (inbound trunks) |
Example Response
Create a Trunk
Create a new SIP trunk for inbound or outbound traffic.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Friendly name for the trunk |
trunk_direction | string | Yes | Direction: inbound or outbound |
trunk_status | string | No | Status: enabled or disabled. Default: enabled |
secure | boolean | No | Enable SRTP/TLS encryption. Default: false |
ipacl_uuid | string | Conditional | IP ACL UUID. Required for outbound trunks |
credential_uuid | string | Conditional | Credentials UUID. Required for outbound trunks |
primary_uri_uuid | string | Conditional | Primary origination URI. Required for inbound trunks |
fallback_uri_uuid | string | No | Fallback origination URI for inbound trunks |
Outbound Trunk
For outbound trunks (calls from your PBX to Plivo), you need eitheripacl_uuid or credential_uuid for authentication.
cURL
Inbound Trunk
For inbound trunks (calls from Plivo to your PBX), you need aprimary_uri_uuid pointing to your server.
cURL
Response
Retrieve a Trunk
Get details of a specific trunk.cURL
Response
Returns the trunk object.List All Trunks
Get all trunks with optional filtering.Query Parameters
| Parameter | Type | Description |
|---|---|---|
trunk_status | string | Filter by status: enabled, disabled |
trunk_direction | string | Filter by direction: inbound, outbound |
secure | boolean | Filter by encryption: true, false |
ipacl_uuid | string | Filter by IP ACL |
credential_uuid | string | Filter by credentials |
primary_uri_uuid | string | Filter by primary URI |
fallback_uri_uuid | string | Filter by fallback URI |
limit | integer | Results per page (1-20). Default: 20 |
offset | integer | Pagination offset. Default: 0 |
cURL
Response
Update a Trunk
Modify an existing trunk’s properties.Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | New name for the trunk |
trunk_status | string | Status: enabled or disabled |
trunk_direction | string | Direction: inbound or outbound |
secure | boolean | Enable/disable SRTP/TLS encryption |
ipacl_uuid | string | New IP ACL UUID |
credential_uuid | string | New credentials UUID |
primary_uri_uuid | string | New primary origination URI |
fallback_uri_uuid | string | New fallback origination URI |
cURL
Response
Delete a Trunk
Permanently delete a trunk.cURL
Trunk Types
| Trunk Type | Purpose | Can Attach to Phone Numbers? |
|---|---|---|
| Inbound | Route calls from Plivo to your PBX/infrastructure | ✅ Yes |
| Outbound | Route calls from your PBX/infrastructure to Plivo | ❌ No |
Outbound Trunks
Route calls from your PBX/infrastructure to Plivo:- Your system sends SIP INVITE to the trunk domain
- Authentication via IP ACL or credentials
- Calls terminate on PSTN via Plivo
Inbound Trunks
Route calls from Plivo to your PBX/infrastructure:- Calls arrive at Plivo (from PSTN or Plivo numbers)
- Plivo forwards to your origination URI
- Fallback URI used if primary fails
- Can be attached to purchased phone numbers
Related
- Credentials - Manage SIP credentials
- IP Access Control Lists - Manage IP whitelists
- Origination URIs - Manage destination URIs