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

PropertyValue
Objectsimplecdr
Primary path/simplecdrs
Path aliases/simplecdr, /simplecdrs, /simple_cdr, /simple_cdrs
Supported methodGET
Default formatjson
Compatibility formatstemplate, xml

Endpoint Patterns

ActionExample pattern
List recordsGET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI
Filter by date rangeGET 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 pathGET https://pbx.example.com/pbx/openapi.php/simplecdrs/RECORD_ID?tenant=CANISTRACCI
Template/XML compatibility outputGET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&format=template&template=Docs%20Export

Query Parameters

ParameterDescription
tenantTenant code or tenant name. Global API keys can use % wildcards; tenant API keys are restricted to their tenant.
startStart date and time. Defaults to today at 00:00:00.
endEnd date and time. Defaults to today at 23:59:59.
idComma-separated simple CDR ID values. A path value such as /simplecdrs/123 also maps to this filter.
uniqueidComma-separated Asterisk unique ID values.
calleridnumComma-separated caller ID number values.
calleridnameComma-separated caller ID name values.
dispositionComma-separated disposition values such as ANSWERED, NO ANSWER, BUSY, or FAILED.
directionComma-separated simple CDR directions, such as IN, OUT, or LOCAL.
dialednumComma-separated dialed number values.
whoansweredComma-separated values for the extension, user, or object that answered.
phoneComma-separated phone values searched across sc_whoanswered, sc_calleridnum, and sc_dialednum.
mindurationMinimum total call duration in seconds, exclusive.
mintalktimeMinimum answered talk time in seconds, exclusive.
formatResponse format. Defaults to json. Use template or xml for template-based compatibility output.
templateTemplate name from the tenant XML templates. Used only with format=template or format=xml.
contenttypeOptional Content-Type header for rendered template output.

Response Fields

FieldDescription
sc_te_idInternal tenant ID.
tenantcodeTenant code.
sc_startSimple CDR start timestamp.
sc_directionSimple direction value, such as IN, OUT, or LOCAL.
sc_calleridnumCaller ID number.
sc_calleridnameCaller ID name.
sc_dialednumDialed number.
sc_dispositionCall disposition.
sc_durationTotal call duration in seconds.
sc_billsecAnswered talk time in seconds.
sc_uniqueidAsterisk unique ID represented by the simple CDR row.
sc_whoansweredExtension, 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.

VariableDescription
{$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

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

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
tenant_requiredA tenant code or tenant name is required when using a tenant API key.
single_tenant_requiredTemplate output requires the request to resolve to exactly one tenant.
template_not_foundThe selected XML/template output template does not exist for the tenant.
method_not_allowedThe endpoint is read-only and only supports GET.

Revision #13
Created 2026-06-06 08:14:42 UTC by Admin
Updated 2026-07-03 15:49:01 UTC by Admin