How to Integrate CDR API Exports Reliably
A traffic campaign can look profitable in a portal while a delayed or mismatched record tells a different story in your internal reports. When you integrate CDR API exports into your reporting workflow, you replace manual checks and spreadsheet delays with a consistent view of minutes, destinations, number performance and expected revenue.
For traffic monetisation partners, reporting is not an administrative task. It is how you identify which destinations are scaling, investigate sudden ASR changes, reconcile payouts and make decisions before margin is affected. The quality of the integration matters as much as the data itself.
Why CDR exports belong in your operating workflow
A call detail record, or CDR, captures the events behind the aggregate figures shown in a reporting portal. Depending on the available fields, an export may include the allocated number, destination, start and end time, duration, call status, pricing reference, currency and unique record identifier. Aggregated dashboards remain useful for a quick view, but CDR-level data gives finance, operations and traffic teams a shared source for investigation.
This is particularly valuable when several teams or traffic sources use the same account. Operations may need to isolate failed attempts by route or time period. A media buyer may need to compare minute growth against campaign changes. Finance needs to reconcile approved traffic and payout periods without relying on copied figures.
The objective is not to import every available field without a plan. It is to create reporting that answers practical questions reliably: which numbers are active, what traffic was completed, what is still provisional, and whether the expected value aligns with the platform statement.
Plan the data model before you connect
Start with the decisions your team needs to make, then define the fields required to support them. A basic import that only contains duration and destination may be enough for a daily volume dashboard. It will not be enough to trace a payout difference to specific traffic records.
At minimum, retain a stable record ID where one is provided, the number or service identifier, destination, timestamps, billable duration, disposition or status, and any rate or revenue fields supplied by the platform. Store the original timestamp alongside a normalised UTC timestamp. International operations often span several time zones, and a report based on local server time can place calls into the wrong business day.
You should also separate raw data from calculated data. Keep the API response, or a faithful raw staging copy, before applying internal rules such as revenue estimates, source tagging or currency conversion. If a carrier adjustment, delayed record or rating update occurs later, the raw layer gives your team an audit trail.
Define finality rules
Not every CDR is final the moment it appears. Some records may arrive late, be corrected after a routing event, or move through rating and validation processes before they are included in a settled payout period. Your integration should therefore distinguish between operational reporting and financial reconciliation.
For example, a near-real-time dashboard can show completed minutes from the current day, clearly labelled as provisional. A separate finance dataset can use only records that meet your agreed settlement criteria. Mixing these views is a common cause of avoidable disputes between operations and finance.
How to integrate CDR API exports in a controlled way
The most dependable approach is a scheduled incremental import. Rather than requesting the entire history each time, request a defined time window and use pagination, cursor values or record timestamps as documented by the API. Save the last successfully processed checkpoint only after the full batch has passed validation.
Use an overlap window when collecting data. If your job runs every hour, request records from slightly before the previous checkpoint as well as new records. The overlap captures delayed records, while deduplication prevents double counting. The right overlap depends on the platform's processing behaviour, but it should be based on observed data latency rather than assumption.
A controlled workflow normally follows four stages:
- Retrieve records through an authenticated API request using credentials held outside source code.
- Land the unmodified response in a restricted raw table or storage area with the import time and request window recorded.
- Validate required fields, normalise formats and deduplicate using the provider's stable record ID or a documented composite key.
- Publish validated records to reporting and reconciliation tables, then alert the responsible team if volume or error thresholds are exceeded.
This design makes reruns safer. If a job fails midway through a large export, you can reprocess the affected window without creating duplicate minutes or losing the context needed to investigate the failure.
Secure the connection and access
CDR exports contain commercially sensitive information. Apply least-privilege access to API credentials, store secrets in a managed vault where possible, and rotate keys on a defined schedule. Limit access to raw data to staff who need it for operations, finance or technical support.
Log request status, response size, execution time and any error code, but do not write credentials or unnecessary sensitive fields into application logs. If your organisation shares reports with partners, publish only the fields needed for that relationship and retain an internal master dataset for audit purposes.
Validate the figures before relying on them
An API integration is only useful when its outputs can be checked. Build validation into the daily process rather than waiting for a month-end discrepancy.
Compare imported call counts and billable minutes against the platform's reporting view for the same time range. Small timing differences may be expected while records are still being processed. Material or persistent differences need investigation. Check whether the export uses connection time or answer time, whether duration is rounded, and whether unsuccessful attempts are included.
Monitor four practical indicators: record count, billable minutes, duplicate rate and missing-field rate. A sharp fall in records may indicate an authentication issue, pagination fault or filtering error. A sudden rise in duplicates often means the checkpoint logic has changed. Missing destination or status values can point to an upstream schema change that would make downstream reports misleading.
Revenue validation requires additional care. Estimated revenue from CDRs is useful for managing traffic, but it may not equal a final payout where contractual rates, thresholds, adjustments, taxes or settlement cut-offs apply. Keep expected revenue and settled revenue as separate measures. This protects decision-making without presenting a provisional figure as a confirmed amount.
Turn exported CDRs into better traffic decisions
Once the data is dependable, use it to analyse trends by destination, number, campaign reference, traffic source and hour. A daily total shows growth. A segmented view shows whether that growth is coming from the destinations and numbers you intended to scale.
Set practical alerts around changes that affect performance: falling answer rates, an unusual concentration of short calls, traffic arriving outside expected operating hours, or a destination mix that shifts quickly. These signals do not always mean there is a problem. They do indicate where a traffic manager should look first.
For teams allocating many international premium or revenue-share numbers, joining CDR data with allocation records is especially useful. It lets you see active numbers with no traffic, numbers generating sustained volume, and campaigns that require testing or routing review. TrustCaller users can combine live portal visibility with an internal CDR workflow when their reporting needs extend across multiple sources or business units.
Common integration mistakes
The first mistake is treating an export as a one-off download. Manual files can help with an initial review, but they create version-control problems once volumes rise. Scheduled imports with clear checkpoints are easier to audit and maintain.
The second is relying on timestamps alone to remove duplicates. Time formats can change, records can arrive late, and multiple calls can share the same second. Use a provider-issued unique ID whenever available. If one is not available, document a composite key and test it against real traffic patterns.
The third is overwriting historical data when rates or statuses change. Preserve the original record and record when a revision was received. This makes it possible to explain why an earlier dashboard differed from a final statement.
Finally, avoid building a complex warehouse before proving the essential flow. Start with reliable collection, deduplication and reconciliation. Add advanced segmentation, forecasting and automated alerts once the core figures are trusted.
A well-run CDR integration does more than reduce spreadsheet work. It gives traffic, finance and operations the same evidence at the moment a decision is needed, with enough detail to act confidently and enough control to explain every figure later.
Get your IPRN test numbers — instant activation
Create your account