The AvailablePhoneNumberTollFree
resource lets you search for toll-free phone numbers that are available for you to purchase. You can search for phone numbers that match a pattern, are in a certain country, are in certain area code (NPA) or exchange (NXX) or are in a specific geography.
Once you've found an available number you want to purchase, make an HTTP POST
request to the IncomingPhoneNumbers list resource passing the number as the 'PhoneNumber' parameter.
We work hard to keep a wide variety of numbers in stock at all times. See our pricing pages for country availability.
The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
The LATA of this phone number. Available for only phone numbers from the US and Canada.
The rate center of this phone number. Available for only phone numbers from the US and Canada.
The latitude of this phone number's location. Available for only phone numbers from the US and Canada.
The longitude of this phone number's location. Available for only phone numbers from the US and Canada.
The two-letter state or province abbreviation of this phone number's location. Available for only phone numbers from the US and Canada.
The postal or ZIP code of this phone number's location. Available for only phone numbers from the US and Canada.
The type of Address resource the phone number requires. Can be: none
, any
, local
, or foreign
. none
means no address is required. any
means an address is required, but it can be anywhere in the world. local
means an address in the phone number's country is required. foreign
means an address outside of the phone number's country is required.
Whether the phone number is new to the Twilio platform. Can be: true
or false
.
The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are: Voice
, SMS
, and MMS
and each capability can be: true
or false
.
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/TollFree.json
The SID of the Account requesting the AvailablePhoneNumber resources.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The ISO-3166-1 country code of the country from which to read phone numbers.
The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
The pattern on which to match phone numbers. Valid characters are *
, 0-9
, a-z
, and A-Z
. The *
character matches any single digit. For examples, see Example 2 and Example 3. If specified, this value must have at least two characters.
Whether the phone numbers can receive text messages. Can be: true
or false
.
Whether the phone numbers can receive MMS messages. Can be: true
or false
.
Whether the phone numbers can receive calls. Can be: true
or false
.
Whether to exclude phone numbers that require an Address. Can be: true
or false
and the default is false
.
Whether to exclude phone numbers that require a local Address. Can be: true
or false
and the default is false
.
Whether to exclude phone numbers that require a foreign Address. Can be: true
or false
and the default is false
.
Whether to read phone numbers that are new to the Twilio platform. Can be: true
or false
and the default is true
.
Given a phone number, find a geographically close number within distance
miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
Given a latitude/longitude pair lat,long
find geographically close numbers within distance
miles. Applies to only phone numbers in the US and Canada.
The search radius, in miles, for a near_
query. Can be up to 500
and the default is 25
. Applies to only phone numbers in the US and Canada.
Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires in_lata
to be set as well. Applies to only phone numbers in the US and Canada.
Limit results to a specific local access and transport area (LATA). Given a phone number, search within the same LATA as that number. Applies to only phone numbers in the US and Canada.
Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listAvailablePhoneNumberTollFree() {11const tollFrees = await client12.availablePhoneNumbers("US")13.tollFree.list({ limit: 20 });1415tollFrees.forEach((t) => console.log(t.friendlyName));16}1718listAvailablePhoneNumberTollFree();
1{2"available_phone_numbers": [3{4"address_requirements": "none",5"beta": false,6"capabilities": {7"mms": true,8"sms": true,9"voice": true10},11"friendly_name": "(800) 100-0052",12"iso_country": "US",13"lata": null,14"latitude": null,15"locality": null,16"longitude": null,17"phone_number": "+18001000052",18"postal_code": null,19"rate_center": null,20"region": null21}22],23"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json"24}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listAvailablePhoneNumberTollFree() {11const tollFrees = await client.availablePhoneNumbers("US").tollFree.list({12contains: "866***EPIC",13limit: 20,14});1516tollFrees.forEach((t) => console.log(t.friendlyName));17}1819listAvailablePhoneNumberTollFree();
1{2"available_phone_numbers": [3{4"address_requirements": "none",5"beta": false,6"capabilities": {7"mms": true,8"sms": true,9"voice": true10},11"friendly_name": "(800) 100-0052",12"iso_country": "US",13"lata": null,14"latitude": null,15"locality": null,16"longitude": null,17"phone_number": "+18001000052",18"postal_code": null,19"rate_center": null,20"region": null21}22],23"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json"24}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listAvailablePhoneNumberTollFree() {11const tollFrees = await client.availablePhoneNumbers("US").tollFree.list({12areaCode: 800,13contains: "KYLO",14limit: 20,15});1617tollFrees.forEach((t) => console.log(t.friendlyName));18}1920listAvailablePhoneNumberTollFree();
1{2"available_phone_numbers": [3{4"address_requirements": "none",5"beta": false,6"capabilities": {7"mms": true,8"sms": true,9"voice": true10},11"friendly_name": "(800) 100-0052",12"iso_country": "US",13"lata": null,14"latitude": null,15"locality": null,16"longitude": null,17"phone_number": "+18001000052",18"postal_code": null,19"rate_center": null,20"region": null21}22],23"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json"24}