Skip to main content
POST
/
legacy
/
reporting
/
batch_detail_records
/
voice
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const voice = await client.legacy.reporting.batchDetailRecords.voice.create({
  end_time: '2024-02-12T23:59:59Z',
  start_time: '2024-02-01T00:00:00Z',
});

console.log(voice.data);
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "start_time": "2024-02-01T00:00:00Z",
    "end_time": "2024-02-12T23:59:59Z",
    "call_types": [
      123
    ],
    "record_types": [
      1,
      2
    ],
    "connections": [
      123,
      456
    ],
    "report_name": "My Report",
    "status": 1,
    "report_url": "<string>",
    "filters": [
      {
        "filter_type": "and",
        "cli": "+13129457420",
        "cli_filter": "contains",
        "cld": "+13129457420",
        "cld_filter": "contains",
        "tags_list": "tag1",
        "billing_group": "adfaa016-f921-4b6c-97bb-e4c1dad231c5"
      }
    ],
    "created_at": "2024-02-12T14:00:00Z",
    "updated_at": "2024-02-12T14:05:00Z",
    "timezone": "<string>",
    "source": "<string>",
    "retry": 123,
    "managed_accounts": [
      "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
    ],
    "record_type": "cdr_detailed_report"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

CDR detailed report request data

Request object for CDR detailed report

start_time
string<date-time>
required

Start time in ISO format

Example:

"2024-02-01T00:00:00Z"

end_time
string<date-time>
required

End time in ISO format

Example:

"2024-02-12T23:59:59Z"

timezone
string

Timezone for the report

Example:

"UTC"

call_types
integer[]

List of call types to filter by (Inbound = 1, Outbound = 2)

Example:
[1, 2]
record_types
integer[]

List of record types to filter by (Complete = 1, Incomplete = 2, Errors = 3)

Example:
[1, 2]
connections
integer[]

List of connections to filter by

Example:
[123, 456]
report_name
string

Name of the report

Example:

"My CDR Report"

source
string

Source of the report. Valid values: calls (default), call-control, fax-api, webrtc

Example:

"calls"

include_all_metadata
boolean

Whether to include all metadata

Example:

true

filters
object[]

List of filters to apply

fields
string[]

Set of fields to include in the report

Example:
["call_leg_id", "start_time", "end_time"]
managed_accounts
string<uuid>[]

List of managed accounts to include

Example:
[
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]
select_all_managed_accounts
boolean

Whether to select all managed accounts

Example:

false

Response

CDR report request created successfully

data
object

Response object for CDR detailed report