Skip to main content

Create a CDR request

POST 
/reporting/cdr_requests

Check the status and retrieve a CDR with a call to: GET/reporting/cdr_requests/{id}

  • CDRs are available for 30 days
  • The filters field specifies a list of query criteria as follows:
'filters': [
\{
'filter_type': enum('and', 'or'),
'cli': string,
'cli_filter': enum('contains', 'starts_with', 'ends_with')
\},
\{
'filter_type': enum('and', 'or'),
'cld': string,
'cld_filter': enum('contains', 'starts_with', 'ends_with'),
\},
\{
'filter_type': enum('and', 'or'),
'tags_list': list of tag strings
\}
]

Note: The first object in the filter list must specify a filter_type of and. You can not follow an or with another and. Other than that, you can specify as many filters as you like in any order.

Request

Body

required

CDR Request to add

    start_time stringrequired

    UTC (2024-11-01T00:00:00+00:00)

    end_time string

    UTC (2024-11-01T12:23:23+00:00). Must be less than 24 hours from now

    call_types integer[]

    Default value: 1

    Inbound = 1, Outbound = 2

    record_types integer[]

    Default value: 1

    Complete = 1, Incomplete = 2, Errors = 3

    connections string[]

    Array of connection IDs

    report_name string
    source string

    Specifies the source of the CDR. Can be either 'calls' or 'call-control'

    filters string[]

Responses

200: CDR Request response

400: Bad request

401: Unauthorized

Request samples


curl -L 'https://api.telnyx.com/reporting/cdr_requests' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"start_time": "string",
"end_time": "string",
"call_types": [
0
],
"record_types": [
0
],
"connections": [
"string"
],
"report_name": "string",
"source": "string",
"filters": [
"string"
]
}'

Response samples


{
"id": "string",
"start_time": "string",
"end_time": "string",
"call_types": [
0
],
"record_types": [
0
],
"connections": [
"string"
],
"report_name": "string",
"status": 1,
"report_url": "string",
"filters": "string",
"created_at": "string",
"updated_at": "string"
}