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, busy, failed, canceled, 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 available via the call.cdr object. During the call it is partial (it can even be null in the first actions): the end of call fields (ended, hangup*, duration*, billing* amounts, status) only appear once the call has ended. In the hangup branch, the CDR is complete.

- action: log@v1
  params:
    message: CDR=${{ JSON.stringify(call.cdr) }}

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

✅ For Outbound Calls (using dial@v2)

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

- action: log@v1
  params:
    message: CDR=${{ JSON.stringify($dial.cdr) }}

$dial.cdr is null when the CDR of the outbound call is not ready a few seconds after the call: use $dial?.cdr in expressions.

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

- action: fetch@v3
  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>'

The export is asynchronous:

  1. The request returns 202 with a Task ID.
  2. Follow the task with GET /v2.0/tasks/{taskid}, or subscribe to the v2.task.updated webhook.
  3. When the task is done, its result gives the CSV file. The file stays available for 24 hours.
ParameterRequiredDescription
directionYesinbound or outbound
from, toYesTime range, RFC 3339 (for example 2026-10-01T00:00:00Z)
scenarioNoSID of a scenario, to export only its calls
numberNoOne of your Callr numbers, to export only its calls
🚧

Limits

An export covers at most 31 days: split longer periods into several requests. You can run at most 5 exports per day. For real-time processing, use webhooks or fetch@v3 instead.


🧾 CDR Fields Overview

FieldTypeDescription
billingCreditstringThe credit amount applied, in cents of the account currency.
billingDebitstringThe debit amount applied, in cents of the account currency.
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).
bridgedint64Outbound calls only: the callid of the inbound call this call was bridged with.
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 gateway).
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 final status of the call (answered, failed, unallocated, busy, or canceled), once it has ended.

Did this page help you?