Submit telco data usage report
Submit a new telco data usage report
POST
/
legacy_reporting
/
usage_reports
/
number_lookup
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const numberLookup = await client.legacy.reporting.usageReports.numberLookup.create();
console.log(numberLookup.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
number_lookup = client.legacy.reporting.usage_reports.number_lookup.create()
print(number_lookup.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
numberLookup, err := client.Legacy.Reporting.UsageReports.NumberLookup.New(context.TODO(), telnyx.LegacyReportingUsageReportNumberLookupNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", numberLookup.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.legacy.reporting.usagereports.numberlookup.NumberLookupCreateParams;
import com.telnyx.sdk.models.legacy.reporting.usagereports.numberlookup.NumberLookupCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
NumberLookupCreateResponse numberLookup = client.legacy().reporting().usageReports().numberLookup().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
number_lookup = telnyx.legacy.reporting.usage_reports.number_lookup.create
puts(number_lookup)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$numberLookup = $client
->legacy
->reporting
->usageReports
->numberLookup
->create(
aggregationType: 'ALL',
endDate: '2025-02-10',
managedAccounts: [
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'6ba7b810-9dad-11d1-80b4-00c04fd430c8',
],
startDate: '2025-02-10',
);
var_dump($numberLookup);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx legacy:reporting:usage-reports:number-lookup create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/legacy_reporting/usage_reports/number_lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '
{
"startDate": "2025-02-10",
"endDate": "2025-02-10",
"aggregationType": "ALL",
"managedAccounts": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]
}
'{
"data": {
"id": "9783f4d7-0bfc-427a-9d6b-bc659ad16e5b",
"start_date": "2025-11-01",
"end_date": "2025-12-01",
"aggregation_type": "ALL",
"status": "COMPLETE",
"report_url": "https://portal-cdrs-usage.s3.amazonaws.com/telco_data_usage_report_2025-12-02.csv",
"created_at": "2025-12-02T20:20:57.196925Z",
"updated_at": "2025-12-02T20:21:08.237091Z",
"managed_accounts": [],
"result": [
{
"user_id": "d37bdd47-f301-42ec-b2ad-5a0465bfb632",
"aggregations": [
{
"type": "CNAM",
"total_dips": 3,
"total_cost": 0.009,
"currency": "USD"
}
],
"record_type": "TelcoDataUsageRecord"
}
],
"record_type": "TelcoDataUsageReport"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
*/*
Telco data usage request data
Start date for the usage report
Example:
"2025-02-10"
End date for the usage report
Example:
"2025-02-10"
Type of aggregation for the report
Available options:
ALL, BY_ORGANIZATION_MEMBER Example:
"ALL"
List of managed accounts to include in the report
Example:
[
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]Response
Successfully submitted telco data usage report
Telco data usage report response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const numberLookup = await client.legacy.reporting.usageReports.numberLookup.create();
console.log(numberLookup.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
number_lookup = client.legacy.reporting.usage_reports.number_lookup.create()
print(number_lookup.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
numberLookup, err := client.Legacy.Reporting.UsageReports.NumberLookup.New(context.TODO(), telnyx.LegacyReportingUsageReportNumberLookupNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", numberLookup.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.legacy.reporting.usagereports.numberlookup.NumberLookupCreateParams;
import com.telnyx.sdk.models.legacy.reporting.usagereports.numberlookup.NumberLookupCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
NumberLookupCreateResponse numberLookup = client.legacy().reporting().usageReports().numberLookup().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
number_lookup = telnyx.legacy.reporting.usage_reports.number_lookup.create
puts(number_lookup)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$numberLookup = $client
->legacy
->reporting
->usageReports
->numberLookup
->create(
aggregationType: 'ALL',
endDate: '2025-02-10',
managedAccounts: [
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'6ba7b810-9dad-11d1-80b4-00c04fd430c8',
],
startDate: '2025-02-10',
);
var_dump($numberLookup);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx legacy:reporting:usage-reports:number-lookup create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/legacy_reporting/usage_reports/number_lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '
{
"startDate": "2025-02-10",
"endDate": "2025-02-10",
"aggregationType": "ALL",
"managedAccounts": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]
}
'{
"data": {
"id": "9783f4d7-0bfc-427a-9d6b-bc659ad16e5b",
"start_date": "2025-11-01",
"end_date": "2025-12-01",
"aggregation_type": "ALL",
"status": "COMPLETE",
"report_url": "https://portal-cdrs-usage.s3.amazonaws.com/telco_data_usage_report_2025-12-02.csv",
"created_at": "2025-12-02T20:20:57.196925Z",
"updated_at": "2025-12-02T20:21:08.237091Z",
"managed_accounts": [],
"result": [
{
"user_id": "d37bdd47-f301-42ec-b2ad-5a0465bfb632",
"aggregations": [
{
"type": "CNAM",
"total_dips": 3,
"total_cost": 0.009,
"currency": "USD"
}
],
"record_type": "TelcoDataUsageRecord"
}
],
"record_type": "TelcoDataUsageReport"
}
}