Latest

Overview

The Plivo Zentrunk API uses HTTP verbs and standard HTTP status codes to make it easier for you to integrate communications into your code. To secure your requests to our servers, we serve our API calls over HTTPS.

Note: The current version of the API is v1.

API Endpoint

GET https://api.plivo.com/{version}/
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/{call_uuid}/

Was this code helpful

API requests

Plivo exposes a list of REST APIs to perform various actions.

GET https://api.plivo.com/v1/
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/{call_uuid}/

Was this code helpful

Authentication

All requests to Plivo API are authenticated with BasicAuth using the values of the Auth ID and Auth Token that appear on the Overview page of the console.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/{call_uuid}/

Was this code helpful

Content-Type

Plivo only accepts input of the type application/json.

All POST request arguments must be passed as text in JSON format with the Content-Type set as application/json.

All GET and DELETE request arguments must be passed in the query string.

Pagination

Plivo uses offset-based pagination to list resources.

For instance, if your search request has a result of 100 objects with limit = 10 and offset = 5, then objects with indices 51 through 60 are returned.

Parameters used for pagination

limitinteger

A limit on the number of results to be returned. limit can range between 1 and 20, and the default is 20.

offsetinteger

A pagination cursor to denote the number of objects by which the results should be offset.

API responses

Plivo API endpoints return responses in JSON format. Plivo sets an api_id in each response to uniquely identify your request. Each API call returns one of these HTTP status codes depending on whether the call succeeds or fails.

200

Request has been executed

201

Resource created

202

Resource changed

204

Resource deleted

400

A parameter is missing or is invalid

401

Authentication failed

404

Resource cannot be found

405

HTTP method not allowed

429

Too many requests, rate limited

500

Server error

Response examples

Response attributes

api_idstring

Identifies the request.

errorstring

Indicates an error and provides information regarding the error.

messagestring

Provides information regarding the request.

Response

Success

{
  "call_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
  "from_number": "+912235328936",
  "to_number": "+919943720205",
  "call_direction": "outbound",
  "call_duration": 4,
  "bill_duration": 4,
  "end_time": "2022-12-06 07:02:00",
  "hangup_cause_name": "normal_hangup",
  "hangup_source": "carrier",
  "total_rate": "0.03000",
  "total_amount": "0.00200",
  "initiation_time": "2022-12-06 07:01:48",
  "answer_time": "2022-12-06 07:01:56",
  "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
  "from_country": "IN",
  "to_country": "IN",
  "transport_protocol": "udp",
  "srtp": false,
  "hangup_cause_code": 3000,
  "secure_trunking": false,
  "secure_trunking_rate": "0.00000",
  "stir_verification": "not applicable",
  "attestation_indicator": "null"
}

Error

{
    "app_id": "73bbb0ff-01b9-4fc5-b978-9404da41297d",
    "status": "error",
    "error": "filtering not allowed on srtp"
}

Call

A Call object is created when an outbound call is initiated or when an inbound call is received. You can use a Call object to interact with completed calls.

API Endpoint

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

The Call object

A Call object is created when an outbound call is initiated or when an inbound call is received. You can use a Call object to interact with completed calls.

Attributes

call_uuidstring

The unique identifier used to identify the call

from_numberstring

The caller ID using which the call was initiated.

to_numberstring

The number to which the call was initiated.

call_direction string

The direction of the call, if you want to filter results by call direction.
Allowed values: inbound, outbound

call_duration integer

The duration of the call in seconds. This might be different from the bill_duration based on the billing interval of the prefix called.

bill_durationinteger

The duration for which the call was billed in seconds.

end_time string

The timestamp when the call ended.
Format: yyyy-MM-dd HH:mm:ss

hangup_cause_namestring

The reason for the call hangup. Refer to our list of hangup causes and sources.

hangup_sourcestring

The entity that triggered the call hangup. Possible hangup sources are customer, carrier, zentrunk

total_ratestring

The per-minute rate charged based on the destination number.

total_amountstring

The total amount charged for the call.

initiation_timestring

The timestamp when the call was initiated.
Format: yyyy-MM-dd HH:mm:ss

answer_timestring

The timestamp when the call was answered.
Format: yyyy-MM-dd HH:mm:ss

trunk_domainstring

Unique domain address used to identify the Outbound trunk

from_countrystring

The ISO2 code of the caller ID from which the call was initiated.

to_countrystring

The ISO2 code of the to number to which the call was initiated.

transport_protocolstring

Transport protocol used on call to send/receive packets

srtpboolean

Indicates if the secure transport real time protocol was enabled for the call.

hangup_cause_codeinteger

The integer code for the hangup cause. Refer to our list of hangup causes and sources.

secure_trunkingboolean

Indicates if the secure trunking was enabled for the call.

secure_trunking_ratestring

The per-minute secure trunking rate charged for the call.

stir_verificationstring

For outbound calls: Gives details about the attestation assigned to the call by Plivo

For inbound calls: Gives details about the attestation received on the inbound call to your Plivo phone number.

Possible values:

  • Verified means the call is from a verified caller who has authorized access to the customer’s caller ID, and hence should be treated with confidence. Verified is equivalent to attestation level A.
  • Not Verified means that, for this call, either the caller is not verified, or it’s uncertain whether they have access to the caller ID used, or both. Not Verified means the call received attestation level B or C.
  • Not Applicable means STIR/SHAKEN doesn’t apply to this call, as would be the case if a call is not addressed to a US number or if it’s a cloud call (WebRTC or SIP).

Read more about STIR/SHAKEN.

attestation_indicatorstring

Indicates the attestation label assigned to the call

billed_durationinteger

The duration for which the call was billed in seconds. This might be different from the bill_duration based on the billing interval of the prefix called.

Response

{
  "call_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
  "from_number": "+912235328936",
  "to_number": "+919943720205",
  "call_direction": "outbound",
  "call_duration": 4,
  "bill_duration": 4,
  "end_time": "2022-12-06 07:02:00",
  "hangup_cause_name": "normal_hangup",
  "hangup_source": "carrier",
  "total_rate": "0.03000",
  "total_amount": "0.00200",
  "initiation_time": "2022-12-06 07:01:48",
  "answer_time": "2022-12-06 07:01:56",
  "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
  "from_country": "IN",
  "to_country": "IN",
  "transport_protocol": "udp",
  "srtp": false,
  "hangup_cause_code": 3000,
  "secure_trunking": false,
  "secure_trunking_rate": "0.00000",
  "stir_verification": "not applicable",
  "attestation_indicator": "null"
}

Get call detail record (CDR) of a call

This method lets you retrieve the call detail record (CDR) of a call using a call_uuid.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/{call_uuid}/

Arguments

No arguments need to be passed.

Returns

Returns the call detail record of the call identified using the given call UUID as the Call object.

Example Request

1

Was this code helpful

1

Was this code helpful

1

Was this code helpful

1

Was this code helpful

1

Was this code helpful

1

Was this code helpful

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/{call_uuid}/

Was this code helpful

1

Was this code helpful

Response

{
  "call_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
  "from_number": "+912235328936",
  "to_number": "+919943720205",
  "call_direction": "outbound",
  "call_duration": 4,
  "bill_duration": 4,
  "end_time": "2022-12-06 07:02:00",
  "hangup_cause_name": "normal_hangup",
  "hangup_source": "carrier",
  "total_rate": "0.03000",
  "total_amount": "0.00200",
  "initiation_time": "2022-12-06 07:01:48",
  "answer_time": "2022-12-06 07:01:56",
  "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
  "from_country": "IN",
  "to_country": "IN",
  "transport_protocol": "udp",
  "srtp": false,
  "hangup_cause_code": 3000,
  "secure_trunking": false,
  "secure_trunking_rate": "0.00000",
  "stir_verification": "not applicable",
  "attestation_indicator": "null"
}

Retrieve details of all calls

This method lets you retrieve details of all completed calls. The maximum number of results that you can fetch with a single API call is 20.

API Endpoint

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

Arguments

All of these optional arguments let you filter which calls you retrieve details for.

from_number

The number from which the calls were made. You can filter the details by using the exact number or the prefix.

to_number

The destination number to which the calls were made. You can filter the details by using the exact number or the prefix.

call_direction

The direction of the call.

Allowed values: inbound, outbound

bill_duration

Filters calls by billed duration in seconds. The filter can be used in five forms:

  • bill_duration: Retrieves calls the exact duration specified. For example, to retrieve calls that were exactly three minutes long, use bill_duration=180.
  • bill_duration__gt: Retrieves calls with a duration greater than the value specified. To retrieve calls that were more than two hours long, use bill_duration__gt=7200.
  • bill_duration__gte: Retrieves calls with a duration greater than or equal to the value specified. To retrieve calls that were two hours or more in duration, use bill_duration__gte=7200.
  • bill_duration__lt: Retrieves calls with a duration less than the value specified. To retrieve calls that were less than seven minutes long, use bill_duration__lt=420.
  • bill_duration__lte: Retrieves calls with a duration less than or equal to the value specified. To retrieve calls that were two hours or less in duration, use bill_duration__lte=7200.
end_time

Filters calls by completion time. The time format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. The filter can be used in five forms:

  • end_time: Retrieves calls that ended at the exact time specified. For example, to get all calls that ended at 2023-03-21 11:47[:30], use end_time=2023-03-21 11:47[:30].
  • end_time__gt: Retrieves calls that ended after the specified time. To get all calls that ended after 2021-03-21 11:47, use end_time__gt=2023-03-21 11:47.
  • end_time__gte: Retrieves calls that ended at or after the specified time. To get all calls that ended at or after 2023-03-21 11:47[:30], use end_time__gte=2021-03-21 11:47[:30].
  • end_time__lt: Retrieves calls that ended before the specified time. To get all calls that ended before 2023-03-21 11:47, use end_time__lt=2023-03-21 11:47.
  • end_time__lte: Retrieves calls that ended at or before the specified time. To get all calls that ended at or before 2023-03-21 11:47[:30], use end_time__lte=2023-03-21 11:47[:30].

You can combine these filters to get call detail records that were added during a particular time range.

Note: You can retrieve only calls made in the last 90 days via APIs.

If you don’t use the end_time filter when you search, Plivo uses a search window of the last 30 days from the current date. Alternatively, you can use end_time__[lt|lte] and end_time__[gt|gte] to search a range of times for CDRs of up to 90 days of search boundary. If the provided range exceeds the 90-day boundary, the API will return a 400 response code, signaling an error.


Timestamps need to be UTC timestamps.

hangup_cause_code

Retrieves calls that were hung up with a specific hangup cause code. Refer to our list of hangup causes and sources

hangup_source

Retrieves calls that were hung up by a specific hangup source. Refer to our list of hangup causes and sources.

Allowed values: customer, carrier, zentrunk

limit

Limits the number of results retrieved. The maximum it can be set to is 20.

Defaults to 20.

offset

Denotes the number of value items by which the results should be offset. For example, if the results contains 1,000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.

stir_verification

For outbound calls: Gives details about the STIR/SHAKEN attestation assigned to the call by Plivo.

For inbound calls: Gives details about the attestation received on the call.

Allowed values:

  • Verified — The call is from a verified caller who has authorized access to the customer’s caller ID. Verified is equivalent to attestation level A.
  • Not Verified — Either the caller is not verified, or it’s uncertain whether the caller has authorized access to the caller ID used, or both. Not Verified means the call received attestation level B or C.
  • Not Applicable — STIR/SHAKEN doesn’t apply to this call, as would be the case if a call is not addressed to a US number or if it’s a cloud call (WebRTC or SIP).

Returns

Returns the call objects that match the filters specified in the request.

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 20,
    "offset": 0,
    "total_count": 2,
    "previous": null,
    "next": null
  },

  "objects": [
    {
      "call_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
      "from_number": "+12025551111",
      "to_number": "+13128574907",
      "call_direction": "outbound",
      "call_duration": 4,
      "bill_duration": 60,
      "end_time": "2022-12-06 07:02:00",
      "hangup_cause_name": "normal_hangup",
      "hangup_source": "carrier",
      "total_rate": "0.03000",
      "total_amount": "0.00200",
       “billed_duration”: 60,
      "initiation_time": "2022-12-06 07:01:48",
      "answer_time": "2022-12-06 07:01:56",
      "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
      "from_country": "IN",
      "to_country": "IN",
      "transport_protocol": "udp",
      "srtp": false,
      "hangup_cause_code": 3000,
      "secure_trunking": false,
      "secure_trunking_rate": "0.00000",
      "stir_verification": "Verified",
      "attestation_indicator": "A"
    },
    {
      "call_uuid": "0b6eb07-796c-4d86-a4fd-44ed11667ddbe",
      "from_number": "+912235328936",
      "to_number": "+919943720205",
      "call_direction": "outbound",
      "trunk_id": "0b6eb07-796c-4d86-a4fd-44ed11667ddb",
      "call_duration": 4,
      "bill_duration": 4,
      "end_time": "2022-12-06 07:02:00",
      "hangup_cause_name": "normal_hangup",
      "hangup_source": "carrier",
      "total_rate": "0.03000",
      "total_amount": "0.00200",
       “billed_duration”: 60,
      "initiation_time": "2022-12-06 07:01:48",
      "answer_time": "2022-12-06 07:01:56",
      "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
      "from_country": "IN",
      "to_country": "IN",
      "transport_protocol": "udp",
      "srtp": false,
      "hangup_cause_code": 3000,
      "secure_trunking": false,
      "secure_trunking_rate": "0.00000",
      "stir_verification": "Not Applicable",
      "attestation_indicator": "null"
    }
  ]
}

Call Insights API Specs

This method lets you retrieve call insights for a call.

API Endpoint

URL https://api.plivo.com/v1/Account/{Auth id}/Zentrunk/Call/{call ID}/Insights

Response Descriptions

Name Description Example value
api_id

Unique api request identifier

<UUID>

call_uuid

Unique call Identifier

<UUID>

rtt

Round trip time is the time taken for data to travel to a target destination and back, in milliseconds. A high RTT indicates poor network quality and can result in audio lag.

7

packet_loss

Loss of voice packets over transmission, as a percentage of overall packet count in the stream. Packet loss can cause broken audio.

2

jitter

The variance in delay of voice packet transmissions, measured in milliseconds. Jitter can impact voice quality, causing robotic-sounding audio.

7

post_dial_delay

Length of the interval between when the call was initiated and ringing began, in milliseconds.

12

hungup_source

who hung up the call. caller/callee

plivo

hungup_cause

cause of hung up

end of xml instructions

from.number

The caller ID using which the call was initiated.

12025551111

from.carrier

The caller carrier using which the call was initiated.

Airtel

from.region

The caller region where the call was initiated.

IN

to.number

The number to which the call was initiated.

11025551111

to.carrier

The carrier to which the call was initiated.

jio

to.region

The region to which the call was initiated.

IN

plivo_quality_score

Each call is rated between 1 to 5 based on the audio quality stats recorded for the call. A higher score indicates better call quality.

4

Response

{
   "api_id": "a63df7e3-9f24-4aae-2152-dc8f92548290",
   "call_uuid": "c9d6be3d-94c3-4b38-a2eb-8063ca404d77",
   "from": {
       "carrier": "Mahanagar Telephone Nigam Ltd (MTNL), Fixedline Number",
       "number": "+918035735470",
       "region": "IN"
   },
   "hangup_cause": "normal_hangup",
   "hangup_source": "customer",
   "jitter": "3",
   "packet_loss": "0",
   "plivo_quality_score": "4.2",
   "post_dial_delay": 1000.0,
   "rtt": "24508",
   "to": {
       "carrier": "Mahanagar Telephone Nigam Ltd (MTNL), Fixedline Number",
       "number": "+912269947000",
       "region": "IN"
   }
}

Trunk

Plivo SIP trunks can initiate and accept calls via the UDP network. Customers can interact with the Trunk object to create, retrieve, modify, and remove trunks. Trunks can be linked to a credentials list, an IP access control list, and an origination URI.

API Endpoint

BaseURI https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/{trunk_id}/

Was this code helpful

The Trunk object

Attributes

trunk_id string

Unique identifier used to identify the inbound or outbound trunk.

trunk_domain string

Unique address you reserve on Plivo to which you route your SIP traffic.

name string

Friendly name you assign to the trunk.

trunk_status string

Status of the trunk.

Allowed values: enabled, disabled

secure boolean

Indicates whether the trunk is secured with SRTP to encrypt the media of the call and TLS to encrypt SIP signaling.

Allowed values: true, false

trunk_directionstring

Direction of the trunk.

Allowed values: outbound, inbound

ipacl_uuid string

Unique identifier of IP access control list.

credential_uuidstring

Unique identifier of credentials list.

primary_uri_uuidstring

Unique identifier of origination URI used as a primary URI.

fallback_uri_uuidstring

Unique identifier of origination URI used as a fallback URI.

Response

{
  "name": "trunk_name_1",
  "trunk_id": "21784177241578",
  "trunk_domain": "21784177241578.zt.plivo.com"
  "trunk_status": "enabled",
  "secure": true,
  "trunk_direction": "outbound",
  "ipacl_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
  "credential_uuid": "eb07-796c-4d86-a4fd-44ed11667ddb",
  "primary_uri_uuid": null,
  "fallback_uri_uuid": null
}

Create a trunk

Creates a new trunk.

API Endpoint

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

Arguments

name string

Name of the trunk.

trunk_status string

Status of the trunk.
Allowed values: enabled, disabled
Default value is enabled.

secureboolean

Indicates whether the trunk is secured. Plivo uses SRTP to encrypt the call media and TLS to encrypt the SIP signaling.
Allowed values: true, false
Defaults to false.

trunk_direction string

Indicates the direction of the trunk.
Allowed values: outbound, inbound

ipacl_uuid stringconditional

Unique identifier of an IP access control list. Specified for outbound trunk creation

credential_uuidstringconditional

Unique identifier of a credentials list. Specified for outbound trunk creation.

primary_uri_uuid stringconditional

Unique identifier of the origination URI used as a primary URI. Specified for inbound trunk creation.

fallback_uri_uuidstring

Unique identifier of the origination URI used as a fallback URI.

Returns

If successful, returns “Trunk created successfully.” in the message field along with a unique trunk_id.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"name": "testuser", "trunk_status": "enabled", "trunk_direction": "outbound", "ipacl_uuid": "1c13de4c-423d-11e3-9899-22000abfa5d5"}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/

Was this code helpful

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "Trunk created successfully.",
  "trunk_id": "986908123123411213"
}

Retrieve a trunk

Retrieves the details of an existing trunk.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/{trunk_id}/

Arguments

No arguments need to be passed.

Returns

Returns a Trunk object if a valid trunk_id is provided. Returns an error otherwise.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/21784177241578/

Was this code helpful

Response

{
  "name": "trunk_name_1",
  "trunk_id": "21784177241578",
  "trunk_domain": "21784177241578.zt.plivo.com"
  "trunk_status": "enabled",
  "secure": true,
  "trunk_direction": "outbound",
  "ipacl_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
  "credential_uuid": "eb07-796c-4d86-a4fd-44ed11667ddb",
  "primary_uri_uuid": null,
  "fallback_uri_uuid": null
}

Retrieve all trunks

Retrieves the details of all trunks.

API Endpoint

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

Arguments

trunk_status string

Filters trunks based on trunk status.
Allowed values: enabled, disabled

secure boolean

Filters trunks based on whether they’re secure.
Allowed values: true, false

trunk_directionstring

Filters trunks based on trunk direction.
Allowed values: inbound, outbound

ipacl_uuidstring

Filters trunks based on IP access control list.

credential_uuidstring

Filters trunks based on credentials.

primary_uri_uuidstring

Filters trunks based on primary URI.

fallback_uri_uuidstring

Filters trunks based on fallback URI.

limitinteger

A limit on the number of results per page. limit can range between 1 and 20, and the default is 20.

offsetinteger

A pagination cursor to denote the number of objects by which the results should be offset. Defaults to 0.

Returns

A dictionary with an objects property that contains an array of trunk objects.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/

Was this code helpful

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 2,
    "offset": 0,
    "total_count": 10,
    "previous": null,
    "next": "v1/Account/{auth_id}/Zentrunk/Trunk/?limit=2&offset=2"
  },
  "objects": [
    {
      "name": "trunk_name_1",
      "trunk_id":"21784177241578",
      "trunk_domain":"21784177241578.zt.plivo.com"
      "trunk_status": "enabled",
      "secure": true,
      "trunk_direction": "outbound",
      "ipacl_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
      "credential_uuid": "eb07-796c-4d86-a4fd-44ed11667ddb",
      "primary_uri_uuid": null,
      "fallback_uri_uuid": null
    },
    {
      "name": "trunk_name_2",
      "trunk_id":"31784177241575",
      "trunk_domain":"31784177241575.zt.plivo.com"
      "trunk_status": "enabled",
      "secure": false,
      "trunk_direction": "inbound",
      "ipacl_uuid": null,
      "credential_uuid": null,
      "primary_uri_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
      "fallback_uri_uuid": "796c-4d86-a4fd-44ed11667ddb-eb07"
    }
  ]
}

Update a trunk

Updates a trunk’s name, status, direction, and other related properties.

API Endpoint

POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/{trunk_id}/

Arguments

namestring

Name of the trunk.

trunk_status string

Status of the trunk.
Allowed values: enabled, disabled
Defaults to enabled

secureboolean

Indicates whether the trunk is secured. Plivo uses SRTP to encrypt the call media and TLS to encrypt SIP signaling.
Allowed values: true, false
Defaults to false.

trunk_directionstring

Indicates the direction of the trunk.
Allowed values: outbound, inbound

ipacl_uuidstring

Unique identifier of IP access control list.

credential_uuidstring

Unique identifier of a credentials list.

primary_uri_uuidstring

Unique identifier of the origination URI used as a primary URI.

fallback_uri_uuidstring

Unique identifier of the origination URI used as a fallback URI.

Returns

Returns a confirmation that the trunk is updated.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"name": "testuser"}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/{trunk_id}/

Was this code helpful

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "Trunk updated successfully.",
  "trunk_id": "986908123123411213"
}

Delete a trunk

Permanently deletes a trunk.

API Endpoint

DELETE https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/{trunk_id}/

Arguments

No arguments need to be passed.

1
2
curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

Credentials

The Credentials list is a subresource connected to the Trunks. When Plivo receives a SIP INVITE command for a Trunk domain that has an associated credentials list, we prompt for authentication. In response, your system must provide a valid username and password to authenticate.

API Endpoint

BaseURI https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Was this code helpful

The Credentials Object

Attributes

credential_uuidstring

Unique identifier for the credentials list created.

namestring

Friendly name for the credentials list.

username string

Username to be sent in response to an auth challenge of the SIP INVITE.

passwordstring

Password to authenticate the SIP request.

Response

{
  "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "dummy1",
  "username": "dummy1_username"
}

Create a credentials list

Create a new credentials list.

API Endpoint

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

Attributes

namestring

Friendly name for the credentials list.

usernamestring

Username to be sent in response to an auth challenge of the SIP INVITE.

passwordstring

Password to authenticate the SIP request.

Returns

If successful, returns “credential created successfully.” in the message field along with a credential_uuid.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"name": "testuser", "username": "testcredential", "Password": "test12332434!"}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

Was this code helpful

Response

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

Retrieve a Credential

Retrieves the details of an existing credential.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Arguments

No arguments need to be passed.

Returns

Returns a Credential object if a valid credential_uuid is provided. Returns an error otherwise.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

Response

{
  "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "dummy1",
  "username": "dummy1_username"
}

Retrieve all Credentials

Retrieves the details of all credentials in the account.

API Endpoint

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

Arguments

No arguments need to be passed.

Returns

A dictionary with an objects property that contains an array of Credentials objects.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

Was this code helpful

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 2,
    "offset": 0,
    "total_count": 109,
    "previous": null,
    "next": "v1/Account/{auth_id}/Zentrunk/Credential/?limit=2&offset=2"
  },
  "objects": [
    {
      "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "dummy1",
      "username": "dummy1_username"
    },
    {
      "credential_uuid": "c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "dummy1",
      "username": "dummy2_username"
    }
  ]
}

Update a Credential

Updates a credential name, username, or password.

API Endpoint

POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Arguments

namestring

Friendly name for the credentials list.

usernamestring

Username to be sent in response to an auth challenge of the SIP INVITE.

Passwordstring

Password to authenticate the SIP request.

Returns

Returns a confirmation that the credential was updated.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"username": "testcredential", "Password": "test12332434!"}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

Response

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

Delete a Credential

Permanently deletes a credential.

API Endpoint

DELETE https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Arguments

No arguments need to be passed.

1
2
curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Was this code helpful

Origination URI

The origination URI is a subresource linked to inbound trunks. It denotes an entry point into your communication infrastructure, such as an IP PBX or SBC, by identifying the network element involved.

API Endpoint

BaseURI https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

The Origination URI object

Attributes

uri_uuidstring

Unique identifier for the origination URI.

namestring

Friendly name for the origination URI.

uristring

FQDN or IP address of the VoIP infrastructure.

authentication_neededboolean

Indicates whether authentication is required to access the VoIP infrastructure.

usernamestring

Username to authenticate inbound traffic.

passwordstring

Password to authenticate inbound traffic.

Response

{
  "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "testuri123",
  "uri": "test@plivo.com",
  "authentication_needed": true,
  "username": "dummy1_username"
}

Create an origination URI

Creates a new origination URI.

API Endpoint

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

Attributes

namestring

Friendly name for the origination URI.

uristring

FQDN or IP address of the VoIP infrastructure.

authentication_neededboolean

Indicates whether authentication is required to access the VoIP infrastructure.
Allowed values: true, false
Defaults to false.

usernamestring

Username to authenticate inbound traffic. Required if authentication_needed is set to true.

passwordstring

Password to authenticate inbound traffic. Required if authentication_needed is set to true.

Returns

If successful, returns “Origination URI created successfully.” in the message field along with a uri_uuid.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"name": "testuri", "uri": "test@plivo.com", "authentication_needed": true, "username": "testuser", "password": "testpass12324!"}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/

Was this code helpful

Response

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

Retrieve an origination URI

Retrieves the details of an existing trunk.

API Endpoint

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

Arguments

No arguments need to be passed.

Returns

Returns an origination URI object if a valid uri_uuid is provided. Returns an error otherwise.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

Response

{
  "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "testuri123",
  "uri": "test@plivo.com",
  "authentication_needed": true,
  "username": "dummy1_username"
}

Retrieve all origination URIs

Retrieves the details of all origination URIs in the account.

API Endpoint

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

Arguments

No arguments need to be passed.

Returns

A dictionary with an objects property that contains an array of origination URI objects.

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 2,
    "offset": 0,
    "total_count": 109,
    "previous": null,
    "next": "v1/Account/{auth_id}/Zentrunk/URI/?limit=2&offset=2"
  },
  "objects": [
    {
      "uri_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "uritest1",
      "uri": "test@plivo.com",
      "authentication_needed": true,
      "username": "dummy1_username"
    },
    {
      "uri_uuid": "aec4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "uritest12",
      "uri": "test2@plivo.com",
      "authentication_needed": false,
      "username": null
    }
  ]
}

Update an origination URI

Updates a credential name, username, or password.

API Endpoint

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

Arguments

namestring

Friendly name for the origination URI.

uristring

FQDN or IP address of the VoIP infrastructure.

authentication_neededboolean

Indicates whether authentication is required to access the VoIP infrastructure.
Allowed values: true, false
Defaults to false.

usernamestring

Username to authenticate inbound traffic. Required if authentication_needed is set to true.

passwordstring

Password to authenticate inbound traffic. Required if authentication_needed is set to true.

Returns

Returns a confirmation that the origination URI is updated.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"authentication_needed": true, "username": "testcredential", "Password": "test12332434!"}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

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 deletes an origination URI.

API Endpoint

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

Arguments

No arguments need to be passed.

1
2
curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Was this code helpful

IP Access Control List

The IP access control list serves as a subresource comprising instances of IP access control lists linked to the outbound trunk. When an outbound trunk associated with an IP access control list receives a SIP INVITE, the INVITE is accepted only if the source IP address is included in one of the associated lists.

API Endpoint

BaseURI https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

The IP access control list object

Attributes

ipacl_uuidstring

Unique identifier for an IP access control list.

namestring

Friendly name for the IP access control list.

associated_ipsarray

Comma-separated list of IP addresses.

Returns

If successful, returns “IP access control list created successfully.” in the message field along with an ipacl_uuid.

Response

{
  "ipacl_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "sample_ipacl",
  "ip_addresses": [
    "192.168.1.1,127.0.1.1"
  ]
}

Create a IP access control list

API Endpoint

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

Attributes

namestring

Friendly name for the IP access control list.

ip_addressesstring

Comma-separated list of IP addresses.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"name": "testname", "ip_addresses": ["92.168.0.1","92.168.0.2"]}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/

Was this code helpful

Retrieve an IP access control list

Retrieves the details of an IP access control list.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/{ipacl_uuid}/

Arguments

No arguments need to be passed.

Returns

Returns an IP access control list object if a valid ipacl_uuid is provided. Returns an error otherwise.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

Response

{
  "ipacl_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "sample_ipacl",
  "ip_addresses": [
    "192.168.1.1,127.0.1.1"
  ]
}

Retrieve all IP access control lists

Retrieves the details of all IP access control lists in the account.

API Endpoint

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

Arguments

No arguments need to be passed.

Returns

A dictionary with an objects property that contains an array of IP access control lists objects.

1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/

Was this code helpful

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 2,
    "offset": 0,
    "total_count": 109,
    "previous": null,
    "next": "v1/Account/{auth_id}/Zentrunk/IPAccessControlList/?limit=2&offset=2"
  },
  "objects": [
    {
      "ipacl_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "sample_ipacl_1",
      "ip_addresses": [
        "192.162.1.1,126.0.1.1"
      ]
    },
    {
      "ipacl_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "sample_ipacl_2",
      "ip_addresses": [
        "192.168.1.1,127.0.1.1"
      ]
    }
  ]
}

Update an IP access control list

Updates an IP access control lists name or IP addresses.

API Endpoint

POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/{ipacl_uuid}/

Arguments

namestring

Friendly name for the IP access control list.

ip_addressesarray

Comma-separated list of IP addresses.

Returns

Returns a confirmation that the object was updated.

1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"name": "testname", "ip_addresses": ["92.168.0.1","92.168.0.2"]}'  \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "IP access control list updated successfully.",
  "ipacl_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
}

Delete an IP access control list

Permanently deletes an IP access control list.

API Endpoint

DELETE https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/{ipacl_uuid}/

Arguments

No arguments need to be passed.

1
2
curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/IPAccessControlList/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Was this code helpful