Call Detail Records (CDR)

A Call Detail Record (CDR) is a structured log of a phone call that includes metadata such as:

  • Call direction (inbound/outbound)
  • Start and end timestamps
  • Call status (answered, missed, failed, etc.)
  • Caller and callee numbers
  • Duration (billed and total)
  • Billing info
  • Hangup cause and source

This data is essential for reporting, analytics, billing, tracking, and debugging.


🔍 Accessing CDRs

There are multiple ways to access CDRs depending on your use case and integration style.

🛠️ Inside Callr Actions Scenarios

✅ For Inbound Calls

When a call reaches your inbound-call branch, the CDR is automatically available via the call.cdr object.

- action: log@v1
  params:
    message: ${{ call.cdr.status }} # full CDR object: callr.cdr

You can push the CDR to your backend using fetch@v2, typically from the hangup branch.

✅ For Outbound Calls (using dial@v1)

- action: dial@v1
  params:
    targets:
      - number: "+33639980042"
        timeout: 60
  result: $dial

- action: log@v1
  params:
    message: ${{ $dial.cdr.status }} # full CDR object: $dial.cdr

The typical use case is to push the CDR to your platform (more examples here: Push Data to Your Platform).

- action: fetch@v2
  params:
    url: https://...
    method: POST
    headers:
      content-type: application/json
    body: |
      {
        "cdr": ${{ JSON.stringify(call.cdr) }}
      }

🌐 Webhooks (v2.call.*)

If you're using Callr Webhooks, the CDR is included in the payload of the following event types:

  • v2.call.inbound.started
  • v2.call.inbound.ended
  • v2.call.outbound.started
  • v2.call.outbound.ended

You’ll receive the same CDR structure as available in Callr Actions — including full call metadata and billing info.

📘

Tip

💡 Make sure your webhook server is ready to handle POST requests and validate incoming data.

📦 CDR Export API

For historical data or bulk exports, use the CDR export endpoint.

curl --request POST \
     --url 'https://api.callr.com/v2.0/calls/export?direction=<direction>&from=<from>&to=<to>' \
     --header 'accept: application/json' \
     --header 'x-api-key: <your-callr-api-key>'

This allows you to download CDRs in bulk (CSV format) over a specified time range.


🧾 CDR Fields Overview

FieldTypeDescription
billingCreditstringThe credit amount applied, expressed in cents.
billingDebitstringThe debit amount applied, expressed in cents.
billingDestinationLabelstringThe geographic label representing the billing destination.
billingPaymentTypestringThe payment type used for billing, either prepaid or postpaid.
calleestringThe phone number of the callee.
callerNamestringThe name of the caller.
callerNumberstringThe phone number of the caller (empty if caller ID is restricted).
callerRestrictedboolIndicates whether the caller's identity is restricted (i.e., CLIR).
callidint64The unique identifier for the call.
directionstringThe call direction, which can be inbound or outbound.
durationAnsweredintThe duration in seconds that the call was actively answered.
durationBilledintThe duration in seconds used for billing purposes.
durationTotalintThe total duration in seconds of the call.
startedstringThe ISO8601 timestamp when the call started.
answeredstringThe ISO8601 timestamp when the call was answered.
endedstringThe ISO8601 timestamp when the call ended.
hangupCauseintThe hangup cause code as defined by Q.850 ISDN standards.
hangupSourcestringThe source of the hangup event (caller, callee, or system).
hangupTechstringA technology specific identifier for the hangup cause.
scenarioNamestringThe name of the scenario associated with the call.
scenarioSidstringThe unique identifier of the call scenario.
scenarioTypeNamestringThe type name of the scenario (e.g., Actions).
scenarioTypeVersionstringThe version of the scenario type.
statusstringThe current status of the call (dialing, ringing,answered, failed, unallocated, busy, or canceled).