List available phone number toll free
Available toll free phone numbers
Path parameters
-
The SID of the Account requesting the AvailablePhoneNumber resources.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^AC[0-9a-fA-F]{32}$
. -
The ISO-3166-1 country code of the country from which to read phone numbers.
Query parameters
-
The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
-
Whether the phone numbers can receive text messages. Can be:
true
orfalse
. -
Whether the phone numbers can receive MMS messages. Can be:
true
orfalse
. -
Whether the phone numbers can receive calls. Can be:
true
orfalse
. -
Whether to exclude phone numbers that require an Address. Can be:
true
orfalse
and the default isfalse
. -
Whether to exclude phone numbers that require a local Address. Can be:
true
orfalse
and the default isfalse
. -
Whether to exclude phone numbers that require a foreign Address. Can be:
true
orfalse
and the default isfalse
. -
Whether to read phone numbers that are new to the Twilio platform. Can be:
true
orfalse
and the default istrue
. -
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 withindistance
miles. Applies to only phone numbers in the US and Canada. -
The search radius, in miles, for a
near_
query. Can be up to500
and the default is25
. 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 particular locality or city. Given a phone number, search within the same Locality as that number.
-
Whether the phone numbers can receive faxes. Can be:
true
orfalse
. -
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum value is
1
, maximum value is1000
. -
The page index. This value is simply for client state.
Minimum value is
0
. -
The page token. This is provided by the API.
curl \
--request GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/TollFree.json' \
--user "username:password"
{
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json",
"available_phone_numbers": [
{
"beta": false,
"lata": null,
"region": null,
"latitude": null,
"locality": null,
"longitude": null,
"iso_country": "US",
"postal_code": null,
"rate_center": null,
"capabilities": {
"mms": true,
"sms": true,
"voice": true
},
"phone_number": "+18001000052",
"friendly_name": "(800) 100-0052",
"address_requirements": "none"
}
]
}
{
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json",
"available_phone_numbers": []
}