Latest

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"
    }
  ]
}