Call Detail Records (CDRs)

GET /api/cdrs pulls the rated call records behind every number — the foundation for billing reconciliation, usage analysis and cost attribution.

Want to build usage analytics on your call data?

Log in to the Console

The endpoint

GET https://api.simpletelecom.com.au/v1/api/cdrs

Returns a paginated list of call detail records for a single service number. CDRs are the definitive record of every call your number handled — used for billing reconciliation, usage analysis and compliance reporting.

Records appear 1–2 minutes after a call fully completes and is priced. In-progress calls do not appear, so design your polling to expect a short delay for the most recent call.

Request parameters

| Parameter | Type | Required | Default | Description | |---|---|---|---|---| | service_number | string | Yes | — | Your service number (e.g. 1300858751 or 0731236322) | | start_date | string | No | 30 days ago | Start of range, YYYY-MM-DD | | end_date | string | No | Today | End of range, YYYY-MM-DD (inclusive) | | page | integer | No | 1 | Page number | | page_size | integer | No | 50 | Records per page (max 100) | | order | string | No | desc | Sort by call start time: asc or desc |

Requests spanning multiple calendar months are supported — the API queries the relevant monthly data tables automatically, so you can pull a full quarter in one request.

Example — a specific month

curl -X GET "https://api.simpletelecom.com.au/v1/api/cdrs?service_number=1300858751&start_date=2026-05-01&end_date=2026-05-31" \
  -H "Authorization: Bearer st_your_token_here"

Response

{
  "data": [
    {
      "cdr_id": "1774966356.4832",
      "start_time": "2026-04-01T00:12:36Z",
      "end_time": "2026-04-01T00:13:21Z",
      "duration_sec": 45,
      "source_number": "0452014047",
      "service_number": "1300858751",
      "destination": "0415759100",
      "cost": "0.1200"
    }
  ],
  "meta": {
    "total_records": 843,
    "page": 1,
    "page_size": 50,
    "total_pages": 17,
    "service_number": "1300858751",
    "start_date": "2026-04-01",
    "end_date": "2026-04-30"
  }
}

Response fields

| Field | Type | Description | |---|---|---| | cdr_id | string | Unique identifier for the call record | | start_time | string | Call start, ISO 8601 UTC | | end_time | string | Call end, ISO 8601 UTC | | duration_sec | integer | Call duration in seconds | | source_number | string | The caller's number (inbound) | | service_number | string | Your service number that received the call | | destination | string | The number the call was forwarded to (empty if the call did not connect) | | cost | string | Charge in AUD as a string with 4 decimal places (e.g. "0.1200") |

Notes:

  • Empty destination means the call did not connect to a forwarding number — the caller hung up before answering, or no destination was reached.
  • cost is a string with 4 decimal places to preserve precision. Parse it as a decimal, not a float, to avoid rounding errors in billing.
  • Timestamps are ISO 8601 UTC.

Pagination walkthrough

The meta block tells you how to page through the results:

  • total_records — how many records matched.
  • page / page_size — the current offset and window.
  • total_pages — how many pages to walk.

Here's a complete JavaScript example that pulls an entire month oldest-first:

JavaScript (fetch)

const token = "st_your_token_here";
const base = "https://api.simpletelecom.com.au/v1";
const serviceNumber = "1300858751";
const url = new URL(`${base}/api/cdrs`);
url.searchParams.set("service_number", serviceNumber);
url.searchParams.set("start_date", "2026-04-01");
url.searchParams.set("end_date", "2026-04-30");
url.searchParams.set("order", "asc");
url.searchParams.set("page_size", "100");

let page = 1;
let all = [];
while (true) {
  url.searchParams.set("page", page);
  const res = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
  const { data, meta } = await res.json();
  all.push(...data);
  if (page >= meta.total_pages) break;
  page += 1;
}

const totalMinutes = all.reduce((n, cdr) => n + cdr.duration_sec / 60, 0);
console.log(`${all.length} calls, ${totalMinutes.toFixed(1)} minutes, ` +
            `$${all.reduce((sum, c) => sum + parseFloat(c.cost), 0).toFixed(2)}`);

PHP (cURL)

<?php
$token  = "st_your_token_here";
$params = http_build_query([
    'service_number' => '1300858751',
    'start_date'     => '2026-04-01',
    'end_date'       => '2026-04-30',
    'order'          => 'asc',
    'page_size'      => 100,
]);
$ch = curl_init("https://api.simpletelecom.com.au/v1/api/cdrs?$params");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$response = json_decode(curl_exec($ch), true);
foreach ($response['data'] ?? [] as $cdr) {
    echo "$cdr[start_time] {$cdr[duration_sec]}s -> {$cdr[destination]} \${$cdr[cost]}\n";
}

Use cases

  • Billing reconciliation — verify every call against the invoice by summing cost over a billing period.
  • Usage analytics — chart call volume and duration over time by service_number and source_number.
  • Cost attribution — attribute call spend per department by mapping source_number/destination to your own cost centres.
  • Missed-call follow-up — find CDRs with an empty destination (calls that didn't connect) and trigger a callback workflow.

Related