---
updatedAt: 2026-10-14T18:29:01.000Z
agentTools:
  projectIndex: https://docs.callr.com/llms.txt
---

# Call Detail Records (CDR)

A Call Detail Record (<Glossary>CDR</Glossary>) 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 <Glossary>Callr Actions</Glossary> Scenarios

✅ For <Glossary>Inbound Call</Glossary>s

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.

```yaml
- 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 <Glossary>Outbound Call</Glossary>s (using `dial@v2`)

```yaml
- 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 <Glossary>CDR</Glossary> to your platform (more examples here: [Push Data to Your Platform](https://docs.callr.com/docs/push-data-to-your-platform)).

```yaml
- 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 <Glossary>CDR</Glossary> structure as available in <Glossary>Callr Actions</Glossary> — 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](https://docs.callr.com/reference/callsexport).

```curl
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.

| Parameter    | Required | Description                                               |
| ------------ | -------- | --------------------------------------------------------- |
| `direction`  | Yes      | `inbound` or `outbound`                                   |
| `from`, `to` | Yes      | Time range, RFC 3339 (for example `2026-10-01T00:00:00Z`) |
| `scenario`   | No       | SID of a scenario, to export only its calls               |
| `number`     | No       | One 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

| Field                     | Type     | Description                                                                                                   |
| ------------------------- | :------- | ------------------------------------------------------------------------------------------------------------- |
| `billingCredit`           | `string` | The credit amount applied, in cents of the account currency.                                                  |
| `billingDebit`            | `string` | The debit amount applied, in cents of the account currency.                                                   |
| `billingDestinationLabel` | `string` | The geographic label representing the billing destination.                                                    |
| `billingPaymentType`      | `string` | The payment type used for billing, either `prepaid` or `postpaid`.                                            |
| `callee`                  | `string` | The phone number of the callee.                                                                               |
| `callerName`              | `string` | The name of the caller.                                                                                       |
| `callerNumber`            | `string` | The phone number of the caller (empty if caller ID is restricted).                                            |
| `callerRestricted`        | `bool`   | Indicates whether the caller's identity is restricted (i.e., CLIR).                                           |
| `bridged`                 | `int64`  | Outbound calls only: the `callid` of the inbound call this call was bridged with.                             |
| `callid`                  | `int64`  | The unique identifier for the call.                                                                           |
| `direction`               | `string` | The call direction, which can be `inbound` or `outbound`.                                                     |
| `durationAnswered`        | `int`    | The duration in seconds that the call was actively answered.                                                  |
| `durationBilled`          | `int`    | The duration in seconds used for billing purposes.                                                            |
| `durationTotal`           | `int`    | The total duration in seconds of the call.                                                                    |
| `started`                 | `string` | The ISO8601 timestamp when the call started.                                                                  |
| `answered`                | `string` | The ISO8601 timestamp when the call was answered.                                                             |
| `ended`                   | `string` | The ISO8601 timestamp when the call ended.                                                                    |
| `hangupCause`             | `int`    | The hangup cause code as defined by Q.850 ISDN standards.                                                     |
| `hangupSource`            | `string` | The source of the hangup event (`caller`, `callee`, or `gateway`).                                            |
| `hangupTech`              | `string` | A technology specific identifier for the hangup cause.                                                        |
| `scenarioName`            | `string` | The name of the scenario associated with the call.                                                            |
| `scenarioSid`             | `string` | The unique identifier of the call scenario.                                                                   |
| `scenarioTypeName`        | `string` | The type name of the scenario (e.g., Actions).                                                                |
| `scenarioTypeVersion`     | `string` | The version of the scenario type.                                                                             |
| `status`                  | `string` | The final status of the call (`answered`, `failed`, `unallocated`, `busy`, or `canceled`), once it has ended. |