Skip to main content

Create an MDR request

POST 
/reporting/mdr_requests

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

  • MDRs 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

MDR Request to add

    start_time stringrequired

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

    end_time string

    UTC (2024-11-01T17:36:08+00:00). If end time includes the last 4 hours, some MDRs might not appear in this report, due to wait time for downstream message delivery confirmation. You can also leverage the Messaging API for a near real-time status.

    call_types integer[]

    Default value: 1

    Inbound = 1, Outbound = 2

    record_types integer[]required

    Default value: 1

    Complete = 1, Incomplete = 2, Errors = 3

    connections string[]required

    Default value: ``

    Array of connection IDs

    profiles string[]

    Default value: ``

    Array of profile IDs

    report_name string
    filters string[]
    directions string[]required

    Default value: ``

    Array of directions. Allowed directions: inbound, outbound

    timezone string

    Default value: UTC

    Timezone for the start_time and end_time

Responses

200: MDR Request response

400: Bad request

401: Unauthorized

Request samples


curl -L 'https://api.telnyx.com/reporting/mdr_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"
],
"profiles": [
"string"
],
"report_name": "string",
"filters": [
"string"
],
"directions": [
"string"
],
"timezone": "UTC"
}'

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",
"profiles": "string"
}