Skip to main content
The Origination URIs API lets you create and manage destination endpoints (your PBX/infrastructure) where Plivo sends inbound calls.

API Endpoint

https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

The Origination URI Object

AttributeTypeDescription
uri_uuidstringUnique identifier for the origination URI
namestringFriendly name for the origination URI
uristringFQDN or IP address of your VoIP infrastructure
authentication_neededbooleanWhether Plivo should authenticate when sending calls
usernamestringUsername for authentication (if enabled)
passwordstringPassword for authentication (only set on create/update)

Example Response

{
  "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "primary-pbx",
  "uri": "sip.example.com",
  "authentication_needed": true,
  "username": "plivo_inbound"
}

Create an Origination URI

Create a new destination endpoint for inbound calls.
POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

Parameters

ParameterTypeRequiredDescription
namestringNoFriendly name for the URI
uristringYesFQDN or IP address of your VoIP infrastructure
authentication_neededbooleanNoRequire authentication. Default: false
usernamestringConditionalUsername for auth. Required if authentication_needed=true
passwordstringConditionalPassword for auth. Required if authentication_needed=true

Without Authentication

cURL
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{
      "name": "primary-pbx",
      "uri": "sip.example.com:5060"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

With Authentication

cURL
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{
      "name": "secure-pbx",
      "uri": "sip.example.com:5060",
      "authentication_needed": true,
      "username": "plivo_inbound",
      "password": "securepassword123!"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "Origination URI created successfully.",
  "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
}

Retrieve an Origination URI

Get details of a specific origination URI.
GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/{uri_uuid}/
cURL
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Response

{
  "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "primary-pbx",
  "uri": "sip.example.com:5060",
  "authentication_needed": true,
  "username": "plivo_inbound"
}

List All Origination URIs

Get all origination URIs for your account.
GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

Query Parameters

ParameterTypeDescription
limitintegerResults per page (1-20). Default: 20
offsetintegerPagination offset. Default: 0
cURL
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 20,
    "offset": 0,
    "total_count": 109,
    "previous": null,
    "next": "v1/Account/{auth_id}/Zentrunk/URI/?limit=20&offset=20"
  },
  "objects": [
    {
      "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "primary-pbx",
      "uri": "sip.example.com",
      "authentication_needed": true,
      "username": "plivo_inbound"
    },
    {
      "uri_uuid": "aec4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "backup-pbx",
      "uri": "sip-backup.example.com",
      "authentication_needed": false,
      "username": null
    }
  ]
}

Update an Origination URI

Modify an existing origination URI’s properties.
POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/{uri_uuid}/

Parameters

ParameterTypeDescription
namestringNew friendly name
uristringNew FQDN or IP address
authentication_neededbooleanEnable/disable authentication
usernamestringNew username (if auth enabled)
passwordstringNew password (if auth enabled)
cURL
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{
      "uri": "new-sip.example.com:5060",
      "authentication_needed": true,
      "username": "new_user",
      "password": "new_password123!"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "origination uri updated successfully.",
  "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
}

Delete an Origination URI

Permanently delete an origination URI.
DELETE https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/{uri_uuid}/
cURL
curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/
Response: HTTP 204 No Content
Deleting an origination URI that is attached to an active trunk as primary or fallback will cause inbound calls to fail.

Usage with Inbound Trunks

After creating origination URIs, attach them to an inbound trunk:
cURL
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{
      "name": "inbound-trunk",
      "trunk_direction": "inbound",
      "primary_uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "fallback_uri_uuid": "aec4773-4ae6-4b75-92ea-9cf3ea4227d6"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/

Primary vs Fallback URIs

TypePurpose
Primary URIDefault destination for inbound calls
Fallback URIUsed when primary is unreachable or returns error
Configure both for high availability:
  1. Create two origination URIs pointing to different servers
  2. Assign one as primary_uri_uuid and the other as fallback_uri_uuid
  3. If primary fails, Plivo automatically routes to fallback

URI Format Examples

FormatExample
IP address192.168.1.100
IP with port192.168.1.100:5060
FQDNsip.example.com
FQDN with portsip.example.com:5060
SIP URIsip:[email protected]

  • Trunks - Create and manage SIP trunks
  • Calls - View SIP trunk call records