Find available phone numbers
GET {{2010-04-01-Accounts-AccountSid-AvailablePhoneNumbers-CountryCode-Local.json-Url}}/2010-04-01/Accounts/:AccountSid/AvailablePhoneNumbers/:CountryCode/Local.json?SmsEnabled=true
To send an SMS with Twilio you'll first need to buy a phone number. For that you have to search the catalog of available phone numbers.
Once you have the list of available phone numbers, pick one and use it in the next request to buy the number.
Learn more about this in the Twilio Docs.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
AreaCode | string | The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. | |
Contains | string | 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. | |
SmsEnabled | boolean | Whether the phone numbers can receive text messages. Can be: true or false . | |
MmsEnabled | string | Whether the phone numbers can receive MMS messages. Can be: true or false . | |
VoiceEnabled | string | Whether the phone numbers can receive calls. Can be: true or false . | |
ExcludeAllAddressRequired | string | Whether to exclude phone numbers that require an Address. Can be: true or false and the default is false . | |
ExcludeLocalAddressRequired | string | Whether to exclude phone numbers that require a local Address. Can be: true or false and the default is false . | |
ExcludeForeignAddressRequired | string | Whether to exclude phone numbers that require a foreign Address. Can be: true or false and the default is false . | |
Beta | string | Whether to read phone numbers that are new to the Twilio platform. Can be: true or false and the default is true . | |
NearNumber | string | 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 within distance miles. Applies to only phone numbers in the US and Canada. | |
Distance | string | 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. | |
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 | 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. | |
InLocality | string | Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. | |
FaxEnabled | string | Whether the phone numbers can receive faxes. Can be: true or false . | |
PageSize | string | How many resources to return in each list page. The default is 50, and the maximum is 1000. |
RESPONSES
status: OK
{"available_phone_numbers":[{"address_requirements":"aute eiusmod","beta":true,"capabilities":{},"friendly_name":"nisi do","iso_country":"voluptate","lata":"minim cillum","latitude":4649799.109687477,"locality":"in Duis ut anim irure","longitude":-94614168.65959848,"phone_number":"amet labore","postal_code":"deserunt esse cillum ut","rate_center":"velit","region":"ipsum pariatur cupidatat dolor"},{"address_requirements":"Ut","beta":true,"capabilities":{},"friendly_name":"ullamco","iso_country":"in incididunt","lata":"cillum dolor velit sed","latitude":-21235506.84035504,"locality":"sint","longitude":-25668838.90140347,"phone_number":"non adipisicing enim incididunt deserunt","postal_code":"ut voluptate minim","rate_center":"velit aliqua","region":"Excepteur aliquip in nisi"}],"end":3504435,"first_page_uri":"http://nnYdJBuOCqryvmKnbvBPBnaNMbCqrxw.tdvyHFVoZISsFUqJvqFT0cg+","next_page_uri":"http://PoqRnDNQHgsSAILsyYutOtNGDj.qqhjm8TRty6qyZnDJAQcH1Djqzpuv,w5pf+hzR.4snyBz","page":90555719,"page_size":88924560,"previous_page_uri":"https://ArZjnsEHjpSMJWeIOQAYyTOm.ispdr0ZozBph6JkyS4wCN4KsLijal5vGd-yowauXTc55dxOb","start":-60781383,"uri":"http://BJmswSvlkWlnMst.fiODjnzufdg.eBwAEpkSmwiU.e-Ygm,OFGiH"}