import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const availablePhoneNumberBlocks = await client.availablePhoneNumberBlocks.list();
console.log(availablePhoneNumberBlocks.data);{
"data": [
{
"record_type": "available_phone_number_block",
"phone_number": "+19705555000",
"range": 10,
"region_information": [
{
"region_type": "country_code",
"region_name": "US"
}
],
"cost_information": {
"upfront_cost": "3.21",
"monthly_cost": "6.54",
"currency": "USD"
},
"features": [
{
"name": "sms"
},
{
"name": "voice"
}
]
}
],
"meta": {
"total_results": 100,
"best_effort_results": 50
}
}import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const availablePhoneNumberBlocks = await client.availablePhoneNumberBlocks.list();
console.log(availablePhoneNumberBlocks.data);{
"data": [
{
"record_type": "available_phone_number_block",
"phone_number": "+19705555000",
"range": 10,
"region_information": [
{
"region_type": "country_code",
"region_name": "US"
}
],
"cost_information": {
"upfront_cost": "3.21",
"monthly_cost": "6.54",
"currency": "USD"
},
"features": [
{
"name": "sms"
},
{
"name": "voice"
}
]
}
],
"meta": {
"total_results": 100,
"best_effort_results": 50
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Consolidated filter parameter (deepObject style). Originally: filter[locality], filter[country_code], filter[national_destination_code], filter[phone_number_type]
Show child attributes
Filter phone numbers by city.
Filter phone numbers by country.
Filter by the national destination code of the number.
Filter phone numbers by number type.
local, toll_free, mobile, national, shared_cost Successful response with a list of available phone numbers blocks.
Show child attributes
available_phone_number_block "available_phone_number_block"
"+19705555000"
10
Was this page helpful?