Skip to main content
Call detail records (CDRs) capture a complete log of every call that passes through the platform. Each record stores the originating caller_number, the destination_number, call direction (inbound or outbound), the final disposition (e.g. ANSWERED or NO ANSWER), raw and billable duration in seconds, the computed cost, and precise start and end timestamps. CDRs are associated with a tenant and optionally with the extension that handled the call. All endpoints require an active admin session. The list endpoint supports search across caller_number, destination_number, direction, and disposition, and orders results by started_at descending.

GET /api/cdrs

Returns all CDRs ordered by started_at descending, with the tenant and extension relations included. Query parameters
Optional. Filters CDRs whose caller_number, destination_number, direction, or disposition contains the given string (case-insensitive).
message
string
Value is "CDRs fetched successfully.".
data
array
Array of CDR objects.
curl https://your-instance.laracopilot.com/api/cdrs \
  -H "Accept: application/json" \
  -b cookies.txt

POST /api/cdrs

Creates a new CDR record manually and returns 201 Created. This endpoint is typically used to ingest CDRs from an external telephony platform.
tenant_id
integer
required
ID of the tenant this CDR belongs to. Must reference an existing tenant.
extension_id
integer
Optional. ID of the extension that handled the call. Must reference an existing extension when provided.
caller_number
string
required
Originating phone number. Maximum 50 characters.
destination_number
string
required
Dialled destination number. Maximum 50 characters.
direction
string
required
Call direction, e.g. inbound or outbound. Maximum 50 characters.
disposition
string
required
Final call result, e.g. ANSWERED, NO ANSWER, BUSY. Maximum 50 characters.
duration_seconds
integer
required
Total call duration in seconds. Minimum value: 0.
bill_seconds
integer
required
Billable call duration in seconds. Minimum value: 0.
cost
number
required
Calculated call cost as a decimal. Minimum value: 0.
started_at
string
required
Call start timestamp. Must be a valid date string parseable by PHP’s date rules, e.g. "2025-04-22 10:00:00".
ended_at
string
Optional. Call end timestamp. Must be a valid date string when provided.
message
string
Value is "CDR created successfully.".
data
object
The newly created CDR record.
curl -X POST https://your-instance.laracopilot.com/api/cdrs \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "extension_id": 2,
    "caller_number": "+12125550099",
    "destination_number": "+14155550010",
    "direction": "outbound",
    "disposition": "ANSWERED",
    "duration_seconds": 240,
    "bill_seconds": 240,
    "cost": 0.0960,
    "started_at": "2025-04-22 14:00:00",
    "ended_at": "2025-04-22 14:04:00"
  }'

GET /api/cdrs/

Fetches a single CDR by its ID. Includes the tenant and extension relations. Path parameters
cdr
integer
required
The numeric ID of the CDR to retrieve.
message
string
Value is "CDR loaded successfully.".
data
object
The CDR record with tenant and extension included.
curl https://your-instance.laracopilot.com/api/cdrs/2 \
  -H "Accept: application/json" \
  -b cookies.txt

PUT /api/cdrs/

Replaces all fields on an existing CDR. PATCH /api/cdrs/{cdr} is also accepted and uses the same handler. Path parameters
cdr
integer
required
The numeric ID of the CDR to update.
tenant_id
integer
required
Must reference an existing tenant.
extension_id
integer
Optional. Must reference an existing extension when provided.
caller_number
string
required
Maximum 50 characters.
destination_number
string
required
Maximum 50 characters.
direction
string
required
Maximum 50 characters.
disposition
string
required
Maximum 50 characters.
duration_seconds
integer
required
Minimum value: 0.
bill_seconds
integer
required
Minimum value: 0.
cost
number
required
Minimum value: 0.
started_at
string
required
Valid date string.
ended_at
string
Optional. Valid date string.
message
string
Value is "CDR updated successfully.".
data
object
The updated CDR record.
curl -X PUT https://your-instance.laracopilot.com/api/cdrs/2 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "extension_id": 2,
    "caller_number": "+12125550099",
    "destination_number": "+14155550010",
    "direction": "outbound",
    "disposition": "ANSWERED",
    "duration_seconds": 240,
    "bill_seconds": 240,
    "cost": 0.0960,
    "started_at": "2025-04-22 14:00:00",
    "ended_at": "2025-04-22 14:04:00"
  }'

DELETE /api/cdrs/

Permanently deletes the specified CDR record. Path parameters
cdr
integer
required
The numeric ID of the CDR to delete.
message
string
Value is "CDR deleted successfully.".
curl -X DELETE https://your-instance.laracopilot.com/api/cdrs/2 \
  -H "Accept: application/json" \
  -b cookies.txt