List available phone number toll free
Available toll free phone numbers
Path parameters
-
The SID of the Account requesting the AvailablePhoneNumber resources.
-
The ISO-3166-1 country code of the country from which to read phone numbers.
Query parameters
-
AreaCode integer
The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
-
Contains string
-
SmsEnabled boolean
Whether the phone numbers can receive text messages. Can be:
true
orfalse
. -
MmsEnabled boolean
Whether the phone numbers can receive MMS messages. Can be:
true
orfalse
. -
VoiceEnabled boolean
Whether the phone numbers can receive calls. Can be:
true
orfalse
. -
ExcludeAllAddressRequired boolean
Whether to exclude phone numbers that require an Address. Can be:
true
orfalse
and the default isfalse
. -
ExcludeLocalAddressRequired boolean
Whether to exclude phone numbers that require a local Address. Can be:
true
orfalse
and the default isfalse
. -
ExcludeForeignAddressRequired boolean
Whether to exclude phone numbers that require a foreign Address. Can be:
true
orfalse
and the default isfalse
. -
Beta boolean
Whether to read phone numbers that are new to the Twilio platform. Can be:
true
orfalse
and the default istrue
. -
NearNumber string(phone-number)
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. -
NearLatLong string
Given a latitude/longitude pair
lat,long
find geographically close numbers withindistance
miles. Applies to only phone numbers in the US and Canada. -
Distance integer
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. -
InPostalCode string
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.
-
InRegion string
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.
-
InRateCenter string
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. -
InLata string
-
InLocality string
Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
-
FaxEnabled boolean
Whether the phone numbers can receive faxes. Can be:
true
orfalse
. -
PageSize integer
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
.
curl \
-X GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/TollFree.json \
--user "username:password"
{
"available_phone_numbers": [
{
"address_requirements": "string",
"beta": true,
"capabilities": {
"fax": true,
"mms": true,
"sms": true,
"voice": true
},
"friendly_name": "string",
"iso_country": "string",
"lata": "string",
"latitude": "string",
"locality": "string",
"longitude": "string",
"phone_number": "string",
"postal_code": "string",
"rate_center": "string",
"region": "string"
}
],
"end": 42,
"first_page_uri": "https://example.com",
"next_page_uri": "https://example.com",
"page": 42,
"page_size": 42,
"previous_page_uri": "https://example.com",
"start": 42,
"uri": "https://example.com"
}
{
"available_phone_numbers": [
{
"address_requirements": "string",
"beta": true,
"capabilities": {
"fax": true,
"mms": true,
"sms": true,
"voice": true
},
"friendly_name": "string",
"iso_country": "string",
"lata": "string",
"latitude": "string",
"locality": "string",
"longitude": "string",
"phone_number": "string",
"postal_code": "string",
"rate_center": "string",
"region": "string"
}
],
"end": 42,
"first_page_uri": "https://example.com",
"next_page_uri": "https://example.com",
"page": 42,
"page_size": 42,
"previous_page_uri": "https://example.com",
"start": 42,
"uri": "https://example.com"
}