import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const availablePhoneNumbers = await client.availablePhoneNumbers.list();
console.log(availablePhoneNumbers.data);{
"data": [
{
"record_type": "available_phone_number",
"phone_number": "+19705555098",
"vanity_format": "",
"best_effort": false,
"quickship": true,
"reservable": true,
"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: 'My API Key',
});
const availablePhoneNumbers = await client.availablePhoneNumbers.list();
console.log(availablePhoneNumbers.data);{
"data": [
{
"record_type": "available_phone_number",
"phone_number": "+19705555098",
"vanity_format": "",
"best_effort": false,
"quickship": true,
"reservable": true,
"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[phone_number], filter[locality], filter[administrative_area], filter[country_code], filter[national_destination_code], filter[rate_center], filter[phone_number_type], filter[features], filter[limit], filter[best_effort], filter[quickship], filter[reservable], filter[exclude_held_numbers]
Show child attributes
Filter phone numbers by pattern matching.
Show child attributes
Filter numbers starting with a pattern (excludes NDC if used with national_destination_code filter).
Filter numbers ending with a pattern (excludes NDC if used with national_destination_code filter).
Filter numbers containing a pattern (excludes NDC if used with national_destination_code filter).
Filter phone numbers by city.
Find numbers in a particular US state or CA province.
Filter phone numbers by country.
Filter by the national destination code of the number.
Filter phone numbers by rate center. This filter is only applicable to USA and Canada numbers.
Filter phone numbers by number type.
local, toll_free, mobile, national, shared_cost Filter phone numbers with specific features.
sms, mms, voice, fax, emergency, hd_voice, international_sms, local_calling Limits the number of results.
Filter to determine if best effort results should be included. Only available in USA/CANADA.
Filter to exclude phone numbers that need additional time after to purchase to activate. Only applicable for +1 toll_free numbers.
Filter to ensure only numbers that can be reserved are included in the results.
Filter to exclude phone numbers that are currently on hold/reserved for your account.
Successful response with a list of available phone numbers.
Show child attributes
available_phone_number "available_phone_number"
"+19705555098"
Specifies whether the phone number is an exact match based on the search criteria or not.
false
Specifies whether the phone number can receive calls immediately after purchase or not.
true
Specifies whether the phone number can be reserved before purchase or not.
true
Was this page helpful?