Simple CDR
The Simple CDR endpoint is a read-only reporting endpoint. It supports GET only; create, update, and delete methods return method_not_allowed. Tenant API keys must include tenant=CANISTRACCI. Global API keys can query one tenant by code or name, or use SQL-style % wildcards in the tenant parameter.
Object Summary
| Property | Value |
|---|---|
| Object | simplecdr |
| Primary path | /simplecdrs |
| Path aliases | /simplecdr, /simplecdrs, /simple_cdr, /simple_cdrs |
| Supported method | GET |
| Default format | json |
| Compatibility formats | template, xml |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List records | GET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI |
| Filter by date range | GET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59 |
| Filter by ID from the path | GET https://pbx.example.com/pbx/openapi.php/simplecdrs/RECORD_ID?tenant=CANISTRACCI |
| Template/XML compatibility output | GET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&format=template&template=Docs%20Export |
Query Parameters
| Parameter | Description |
|---|---|
tenant | Tenant code or tenant name. Global API keys can use % wildcards; tenant API keys are restricted to their tenant. |
start | Start date and time. Defaults to today at 00:00:00. |
end | End date and time. Defaults to today at 23:59:59. |
id | Comma-separated simple CDR ID values. A path value such as /simplecdrs/123 also maps to this filter. |
uniqueid | Comma-separated Asterisk unique ID values. |
calleridnum | Comma-separated caller ID number values. |
calleridname | Comma-separated caller ID name values. |
disposition | Comma-separated disposition values such as ANSWERED, NO ANSWER, BUSY, or FAILED. |
direction | Comma-separated simple CDR directions, such as IN, OUT, or LOCAL. |
dialednum | Comma-separated dialed number values. |
whoanswered | Comma-separated values for the extension, user, or object that answered. |
phone | Comma-separated phone values searched across sc_whoanswered, sc_calleridnum, and sc_dialednum. |
minduration | Minimum total call duration in seconds, exclusive. |
mintalktime | Minimum answered talk time in seconds, exclusive. |
format | Response format. Defaults to json. Use template or xml for template-based compatibility output. |
template | Template name from the tenant XML templates. Used only with format=template or format=xml. |
contenttype | Optional Content-Type header for rendered template output. |
Response Fields
| Field | Description |
|---|---|
sc_te_id | Internal tenant ID. |
tenantcode | Tenant code. |
sc_start | Simple CDR start timestamp. |
sc_direction | Simple direction value, such as IN, OUT, or LOCAL. |
sc_calleridnum | Caller ID number. |
sc_calleridname | Caller ID name. |
sc_dialednum | Dialed number. |
sc_disposition | Call disposition. |
sc_duration | Total call duration in seconds. |
sc_billsec | Answered talk time in seconds. |
sc_uniqueid | Asterisk unique ID represented by the simple CDR row. |
sc_whoanswered | Extension, user, or object that answered the call. |
Template Variables
When format=template or format=xml is used, variables inside the {row_loop} section are replaced for each returned row.
| Variable | Description |
|---|---|
{$end} | Computed end timestamp from sc_start plus sc_duration seconds. |
{$clid} | CDR-style caller ID formatted as "sc_calleridname" <sc_calleridnum>. |
{$callerid_number} | Alias for sc_calleridnum. |
{$callerid_name} | Alias for sc_calleridname. |
{$firstdst} | Alias for sc_dialednum. |
{$talk_time} | Alias for sc_billsec. |
{$who_answered} | Alias for sc_whoanswered. |
Important Notes
- When neither id nor uniqueid is supplied, the endpoint applies the start/end date range.
- The mintalktime filter uses the stored simple CDR billsec/talk-time
value even though that field is not included in the current JSON output columns.value. - Template and XML compatibility output require the request to resolve to exactly one tenant.
Examples
List Today Simple CDRs
Returns simplified call history rows for the selected tenant using today as the default date range.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI"
Simple CDR Date Range
Limits simple CDR results to an explicit date and time window.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59"
Simple CDR by Path ID
Uses the path segment after /simplecdrs as a simple CDR ID filter.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs/98765?tenant=CANISTRACCI"
Simple CDR by ID and Unique ID
Filters by one or more simple CDR row IDs and unique IDs.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&id=98765%2C98766&uniqueid=1717240000.42"
Simple CDR Caller and Dialed Number
Combines caller number, caller name, and dialed number filters.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&calleridnum=15551234567&calleridname=Docs%20Caller&dialednum=100"
Simple CDR Direction and Disposition
Filters by simple direction values and disposition.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&direction=IN%2COUT&disposition=ANSWERED"
Simple CDR Who Answered
Filters by the extension or object that answered the call.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&whoanswered=100"
Simple CDR Phone Search
Searches across caller ID number, dialed number, and who answered.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&phone=100%2C15551234567"
Simple CDR Minimum Durations
Returns calls longer than the supplied total duration and talk-time thresholds.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&minduration=30&mintalktime=10"
Simple CDR Global Tenant Wildcard
Uses a global key and a tenant wildcard to query matching tenants.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CAN%25&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59"
Simple CDR Template Output
Renders simple CDR rows through a tenant XML/template definition. This requires exactly one tenant.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&format=template&template=Docs%20Simple%20CDR%20Export&contenttype=text%2Fcsv"
Common Errors
| Error | Meaning |
|---|---|
missing_api_key | No API key was supplied in the query string, X-API-Key, or bearer token. |
invalid_api_key | The supplied key does not match the tenant or global API key. |
tenant_required | A tenant code or tenant name is required when using a tenant API key. |
single_tenant_required | Template output requires the request to resolve to exactly one tenant. |
template_not_found | The selected XML/template output template does not exist for the tenant. |
method_not_allowed | The endpoint is read-only and only supports GET. |