Get Telnyx product usage data (BETA)
GET/usage_reports
Get Telnyx usage data by product, broken out by the specified dimensions
Request
Query Parameters
Telnyx product
Breakout by specified product dimensions
Specified product usage values
The start date for the time range you are interested in. The maximum time range is 31 days. Format: YYYY-MM-DDTHH:mm:ssZ
The end date for the time range you are interested in. The maximum time range is 31 days. Format: YYYY-MM-DDTHH:mm:ssZ
A more user-friendly way to specify the timespan you want to filter by. More options can be found in the Telnyx API Reference docs.
Filter records on dimensions
Return the aggregations for all Managed Accounts under the user making the request.
Possible values: > 1
Default value: 1
Possible values: <= 5000
Default value: 20
Specifies the sort order for results
Possible values: [csv
, json
]
Specify the response format (csv or json). JSON is returned by default, even if not specified.
Header Parameters
Responses
200: Successful
- application/json
- text/csv
400: Bad Request
- application/json
500: Internal Server Error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/usage_reports' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
Response samples
{
"meta": {
"total_pages": "5",
"total_results": "100",
"page_number": "1",
"page_size": "20"
},
"data": [
{
"product": "messaging",
"cost": 0.012,
"parts": 12,
"count": 8,
"customer_carrier_fee": 0,
"product_name": "long_code",
"country_iso": "LC",
"direction": "outbound"
},
{
"product": "messaging",
"cost": 0.021,
"parts": 21,
"count": 12,
"customer_carrier_fee": 0,
"product_name": "long_code",
"country_iso": "MP",
"direction": "outbound"
}
]
}
{
"errors": [
{
"code": "10003",
"title": "Metrics invalid values",
"detail": "Available metrics values for sip-trunking: connected,cost,completed,call_sec,attempted,billed_sec.",
"source": {
"pointer": "/title",
"parameter": "metrics"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10001"
}
}
]
}
{
"errors": [
{
"code": "10003",
"title": "Metrics invalid values",
"detail": "Available metrics values for sip-trunking: connected,cost,completed,call_sec,attempted,billed_sec.",
"source": {
"pointer": "/title",
"parameter": "metrics"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10001"
}
}
]
}