Loading...
Loading...
Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides REST API (curl) examples.
npx skill4agent add team-telnyx/skills telnyx-account-reports-curl# curl is pre-installed on macOS, Linux, and Windows 10+export TELNYX_API_KEY="YOUR_API_KEY_HERE"$TELNYX_API_KEY# Check HTTP status code in response
response=$(curl -s -w "\n%{http_code}" \
-X POST "https://api.telnyx.com/v2/messages" \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | sed '$d')
case $http_code in
2*) echo "Success: $body" ;;
422) echo "Validation error — check required fields and formats" ;;
429) echo "Rate limited — retry after delay"; sleep 1 ;;
401) echo "Authentication failed — check TELNYX_API_KEY" ;;
*) echo "Error $http_code: $body" ;;
esac401403404422429page[number]page[size]meta.total_pagesoccurred_atleg_idapplication_session_idGET /call_eventscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/call_events"call_leg_idcall_session_idevent_timestampmetadatanamerecord_typetypePOST /ledger_billing_group_reportsmonthyearcurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"year": 2019,
"month": 10
}' \
"https://api.telnyx.com/v2/ledger_billing_group_reports"created_atidorganization_idrecord_typereport_urlstatusupdated_atGET /ledger_billing_group_reports/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/ledger_billing_group_reports/f5586561-8ff0-4291-a0ac-84fe544797bd"created_atidorganization_idrecord_typereport_urlstatusupdated_atGET /legacy/reporting/batch_detail_records/messagingcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/messaging"connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atPOST /legacy/reporting/batch_detail_records/messagingstart_timeend_timeconnectionsdirectionsfiltersinclude_message_bodymanaged_accountsprofilesrecord_typesreport_nameselect_all_managed_accountstimezonecurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_time": "2024-02-01T00:00:00Z",
"end_time": "2024-02-12T23:59:59Z"
}' \
"https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/messaging"connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atGET /legacy/reporting/batch_detail_records/messaging/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/messaging/550e8400-e29b-41d4-a716-446655440000"connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atDELETE /legacy/reporting/batch_detail_records/messaging/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/messaging/550e8400-e29b-41d4-a716-446655440000"connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atGET /legacy/reporting/batch_detail_records/voicecurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/voice"call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atPOST /legacy/reporting/batch_detail_records/voicestart_timeend_timecall_typesconnectionsfieldsfiltersinclude_all_metadatamanaged_accountsrecord_typesreport_nameselect_all_managed_accountssourcetimezonecurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_time": "2024-02-01T00:00:00Z",
"end_time": "2024-02-12T23:59:59Z"
}' \
"https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/voice"call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atGET /legacy/reporting/batch_detail_records/voice/fieldscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/voice/fields"BillingInteraction DataNumber InformationTelephony DataGET /legacy/reporting/batch_detail_records/voice/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/voice/550e8400-e29b-41d4-a716-446655440000"call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atDELETE /legacy/reporting/batch_detail_records/voice/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/legacy/reporting/batch_detail_records/voice/550e8400-e29b-41d4-a716-446655440000"call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atGET /legacy/reporting/usage_reports/messagingcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/usage_reports/messaging"aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atPOST /legacy/reporting/usage_reports/messagingcurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/legacy/reporting/usage_reports/messaging"aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atGET /legacy/reporting/usage_reports/messaging/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/usage_reports/messaging/550e8400-e29b-41d4-a716-446655440000"aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atDELETE /legacy/reporting/usage_reports/messaging/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/legacy/reporting/usage_reports/messaging/550e8400-e29b-41d4-a716-446655440000"aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atGET /legacy/reporting/usage_reports/number_lookupcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/usage_reports/number_lookup"aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_atPOST /legacy/reporting/usage_reports/number_lookupcurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/legacy/reporting/usage_reports/number_lookup"aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_atGET /legacy/reporting/usage_reports/number_lookup/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/usage_reports/number_lookup/550e8400-e29b-41d4-a716-446655440000"aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_atDELETE /legacy/reporting/usage_reports/number_lookup/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/legacy/reporting/usage_reports/number_lookup/550e8400-e29b-41d4-a716-446655440000"GET /legacy/reporting/usage_reports/voicecurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/usage_reports/voice"aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atPOST /legacy/reporting/usage_reports/voicecurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/legacy/reporting/usage_reports/voice"aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atGET /legacy/reporting/usage_reports/voice/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/legacy/reporting/usage_reports/voice/550e8400-e29b-41d4-a716-446655440000"aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atDELETE /legacy/reporting/usage_reports/voice/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/legacy/reporting/usage_reports/voice/550e8400-e29b-41d4-a716-446655440000"aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atGET /phone_numbers/csv_downloadscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/phone_numbers/csv_downloads"idrecord_typestatusurlPOST /phone_numbers/csv_downloadscurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/phone_numbers/csv_downloads"idrecord_typestatusurlGET /phone_numbers/csv_downloads/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/phone_numbers/csv_downloads/550e8400-e29b-41d4-a716-446655440000"idrecord_typestatusurlGET /reports/cdr_usage_reports/synccurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/reports/cdr_usage_reports/sync?start_date=2020-07-01T00:00:00-06:00&end_date=2020-07-01T00:00:00-06:00&aggregation_type=NO_AGGREGATION&product_breakdown=NO_BREAKDOWN&connections=[1234567890123]"aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atGET /reports/mdr_usage_reportscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/reports/mdr_usage_reports"aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atPOST /reports/mdr_usage_reportscurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/reports/mdr_usage_reports"aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atGET /reports/mdr_usage_reports/synccurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/reports/mdr_usage_reports/sync?start_date=2020-07-01T00:00:00-06:00&end_date=2020-07-01T00:00:00-06:00&aggregation_type=PROFILE&profiles=['My profile']"aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atGET /reports/mdr_usage_reports/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/reports/mdr_usage_reports/550e8400-e29b-41d4-a716-446655440000"aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atDELETE /reports/mdr_usage_reports/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/reports/mdr_usage_reports/550e8400-e29b-41d4-a716-446655440000"aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atGET /reports/mdrscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/reports/mdrs?id=e093fbe0-5bde-11eb-ae93-0242ac130002&direction=INBOUND&profile=My profile&cld=+15551237654&cli=+15551237654&status=DELIVERED&message_type=SMS"cldclicostcreated_atcurrencydirectionidmessage_typepartsprofile_nameraterecord_typestatusGET /reports/wdrscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/reports/wdrs?start_date=2021-05-01T00:00:00Z&end_date=2021-06-01T00:00:00Z&id=e093fbe0-5bde-11eb-ae93-0242ac130002&mcc=204&mnc=01&imsi=123456&sim_group_name=sim name&sim_group_id=f05a189f-7c46-4531-ac56-1460dc465a42&sim_card_id=877f80a6-e5b2-4687-9a04-88076265720f&phone_number=+12345678910&sort=['created_at']"costcreated_atdownlink_dataduration_secondsidimsimccmncphone_numberraterecord_typesim_card_idsim_group_idsim_group_nameuplink_dataGET /session_analysis/metadatacurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/session_analysis/metadata"metaquery_parametersrecord_typesGET /session_analysis/metadata/{record_type}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/session_analysis/metadata/{record_type}"aliaseschild_relationshipseventexamplesmetaparent_relationshipsproductrecord_typeGET /session_analysis/{record_type}/{event_id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/session_analysis/{record_type}/{event_id}"completed_atcostcreated_atmetarootsession_idstatusGET /usage_reportscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/usage_reports"datametaGET /usage_reports/optionscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/usage_reports/options"productproduct_dimensionsproduct_metricsrecord_typesGET /wireless/detail_records_reportscurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless/detail_records_reports"created_atend_timeidrecord_typereport_urlstart_timestatusupdated_atPOST /wireless/detail_records_reportsend_timestart_timecurl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/wireless/detail_records_reports"created_atend_timeidrecord_typereport_urlstart_timestatusupdated_atGET /wireless/detail_records_reports/{id}curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/wireless/detail_records_reports/6a09cdc3-8948-47f0-aa62-74ac943d6c58"created_atend_timeidrecord_typereport_urlstart_timestatusupdated_atDELETE /wireless/detail_records_reports/{id}curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/wireless/detail_records_reports/6a09cdc3-8948-47f0-aa62-74ac943d6c58"created_atend_timeidrecord_typereport_urlstart_timestatusupdated_at