Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Active Numbers Resource


(warning)

Warning

Active Numbers API is currently in closed private Developer Preview. Please use the generally available Incoming Phone Numbers API if you do not have access.

The Global Phone Numbers Catalog - Active Numbers resource has the same search and filtering functions as Available Numbers. You can filter based on the attributes of a phone number and see detailed attributes of your current inventory. Some PhoneNumber instances may be null due to missing data. We are working towards a 100% inventory backed resource.


Resource Properties

instance-properties page anchor

Basic Capability Properties

basic-capability-properties page anchor

The table below states basic properties of the phone number that associate the number to a unique group within Twilio's inventory system.

PropertyDescription
PhoneNumberThe phone number, in E.164(link takes you to an external page) (i.e. "+1") format.
FriendlyNameA human-readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number.
TypeThe type of phone number (i.e., local, mobile, tollfree, shortcode, etc.).
LifecycleThe lifecycle the number is in (i.e., developer-preview, beta, generally-available, exhausted).
StatusCallbackThe URL that Twilio will request to pass status parameters (such as call ended) to your application.
StatusCallbackMethodThe HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST.

Voice Capability Properties

voice-capability-properties page anchor

Voice calling is provided by utilizing the Public Switch Telephone Network (PSTN)(link takes you to an external page), the aggregate of the world's circuit-switched telephone networks that are operated by national, regional, or local telephony operators, providing infrastructure and services for public telecommunication.

PropertyDescription
Capabilities.Voice.InboundConnectivityIndicates whether a number has inbound voice connectivity in to Twilio.
Capabilities.Voice.OutboundConnectivityIndicates whether a number has outbound voice connectivity out of Twilio.
Capabilities.Voice.E911Emergency 911(link takes you to an external page) connectivity capable number.
Capabilities.Voice.FaxFax(link takes you to an external page) capable number.
Capabilities.Voice.SipTrunkingSip Trunking(link takes you to an external page) capable number.
Capabilities.Voice.CallsPerSecondInteger stating how many calls can be initiated per second. Please refer to Twilio's CPS Support article(link takes you to an external page) for more information.
Capabilities.Voice.ConcurrentCallsLimitInteger stating how many calls can be active at one time.
Capabilities.Voice.InboundCalledDtmfDual-Tone Multi Frequency(link takes you to an external page) with inbound called party.
Capabilities.Voice.InboundCallerDtmfDual-Tone Multi Frequency(link takes you to an external page) with inbound caller party.
Capabilities.Voice.InboundCallerIdPreservationInbound voice Caller ID (+E.164 format)(link takes you to an external page) preservation of a number. Can be - International, Domestic, or None.
Capabilities.Voice.InboundReachabilityInbound Voice reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Voice.LongRecordLengthThe length in seconds that a number can record a voicemail.

Sms Capability Properties

sms-capability-properties page anchor

Short Messaging Service (SMS)(link takes you to an external page) is a text messaging service component of most telephone, World Wide Web, and mobile telephony systems.

PropertyDescription
Capabilities.Sms.InboundConnectivityIndicates whether a number has inbound sms connectivity in to Twilio.
Capabilities.Sms.OutboundConnectivityIndicates whether a number has outbound sms connectivity out of Twilio.
Capabilities.Sms.Gsm7GSM-7 is a character encoding standard which packs the most commonly used letters and symbols in many languages into 7 bits each for usage on GSM networks. See What is GSM-7 Character Encoding(link takes you to an external page).
Capabilities.Sms.Ucs2UCS-2 is a character encoding standard in which characters are represented by a fixed-length 16 bits (2 bytes). See What is UCS-2 Character Encoding?(link takes you to an external page).
Capabilities.Sms.Gsm7ConcatenationConcatenated short message service (or concatenated SMS)(link takes you to an external page) is used overcome the limitation on the number of characters that can be sent in a single SMS text message transmission (which is usually 160), and split the sms into smaller messages by the sending device and recombined at the receiving end.
Capabilities.Sms.Ucs2ConcatenationConcatenated short message service (or concatenated SMS)(link takes you to an external page) is used overcome the limitation on the number of characters that can be sent in a single SMS text message transmission (which is usually 160), and split the sms into smaller messages by the sending device and recombined at the receiving end.
Capabilities.Sms.InboundSenderIdPreservationInbound sms Sender ID (+E.164 format)(link takes you to an external page) preservation of a number. Can be - International, Domestic, or None.
Capabilities.Sms.InboundReachabilityInbound SMS reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Sms.InboundMpsInteger showing the SMS inbound message per second limit. Please refer to Twilio's MPS Support article(link takes you to an external page) for more information.

Mms Capability Properties

mms-capability-properties page anchor

Multimedia Messaging Service (MMS)(link takes you to an external page) is a standard way to send messages that include multimedia content to and from a mobile phone over a cellular network.

PropertyDescription
Capabilities.Mms.InboundconnectivityIndicates whether a number has inbound MMS connectivity into Twilio.
Capabilities.Mms.OutboundconnectivityIndicates whether a number has outbound MMS connectivity into Twilio.
Capabilities.Mms.InboundReachabilityInbound MMS reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Mms.InboundMpsInteger showing the MMS inbound message per second limit. Please refer to Twilio's MPS Support article(link takes you to an external page) for more information.

Regulations that pertain to this specific number that may deal with Addresses and/or Identities to be required and completed as a pre-request before purchasing.

PropertyDescription
Regulatory.AddressRequirementsThis indicates whether the phone number requires you or your customer to have an Address(link takes you to an external page) registered with Twilio. Possible values are listed below.

Address Requirement Values

address-requirement-values page anchor

The following are the possible values for the address_required property.

StatusDescription
noneAn Address(link takes you to an external page) is not required for this phone number.
anyYour account must have an Address(link takes you to an external page), but it can be anywhere in the world.
localYour account must have an Address(link takes you to an external page) within the phone number's country.
foreignYour account must have an Address(link takes you to an external page) outside the phone number's country.

A phone number's specific geography associated with a number. Some numbers are country level only, and others have specific latitude and longitude associated with them. To understand more, please visit List of Country Codes(link takes you to an external page).

PropertyDescription
Geography.IsoCountryThe ISO country code(link takes you to an external page) of this phone number.
Geography.LataThe LATA(link takes you to an external page) of this phone number. Only available for countries in the North American Numbering Plan (NANPA)(link takes you to an external page).
Geography.RateCenterThe rate center(link takes you to an external page) of this phone number. Only available for countries in the North American Numbering Plan (NANPA)(link takes you to an external page).
Geography.LatitudeThe latitude coordinate of this phone number.
Geography.LongitudeThe longitude coordinate of this phone number.
Geography.RegionThe two-letter state or province abbreviation of this phone number.
Geography.LocalityThe locality/city of this phone number.
Geography.PostalCodeThe postal (zip) code of this phone number.

Voice Configuration Properties

voice-configuration-properties page anchor

A number's voice configuration for the capabilities enabled. These attributes are mutable and can be changed based on differing operations.

PropertyDescription
Configurations.Voice.ApplicationSidThe 34 character sid of the voice application(link takes you to an external page) Twilio should use to handle Voice sent to this number. If an VoiceApplicationSid is present, Twilio will ignore all of the VoiceUrls above and use those set on the application.
Configurations.Voice.TrunkSidThe 34 character sid of the Trunk Twilio should use to handle phone calls to this number. If a TrunkSid is present, Twilio will ignore all of the voice urls and voice applications above and use those set on the Trunk. Setting a TrunkSid will automatically delete your VoiceApplicationSid and vice versa.
Configurations.Voice.EmergencyStatusStatus determining whether the number is enabled for emergency calling.
Configurations.Voice.EmergencyAddressSidEmergencyAddress configuration to leverage emergency calling.
Configurations.Voice.ReceiveModeWhether the phone number is configured to receive voice or fax calls. Either voice or fax.
Configurations.Voice.UrlThe URL Twilio will request when this phone number receives a call. The VoiceURL will no longer be used if a VoiceApplicationSid or a TrunkSid is set.
Configurations.Voice.MethodThe HTTP method Twilio will use when requesting the above Url. Either GET or POST. The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
Configurations.Voice.FallbackUrlThe URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
Configurations.Voice.FallbackMethodThe HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST.
Configurations.Voice.CallerIdLookupDo a lookup of a caller's name from the CNAM database and post it to your app. Either true or false.

Sms Configuration Properties

sms-configuration-properties page anchor

A number's sms configuration for the capabilities enabled. These attributes are mutable and can be changed based on differing operations.

PropertyDescription
Configurations.Sms.ApplicationSidThe 34 character sid of the application(link takes you to an external page) Twilio should use to handle SMSs sent to this number. If an SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application.
Configurations.Sms.UrlThe URL Twilio will request when this phone number receives a message. The SmsUrl will no longer be used if an SmsApplicationSid is set.
Configurations.Sms.MethodThe HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST.
Configurations.Sms.FallbackUrlThe URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl. The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
Configurations.Sms.FallbackMethodThe HTTP method Twilio will use when requesting the above URL. Either GET or POST.

GET ActiveNumbers Instance

get-activenumbers-instance page anchor
curl

_10
$ curl -G https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy \
_10
-u '<ACCOUNT_SID:AUTH_TOKEN>'

Output

_83
{
_83
"items": [
_83
{
_83
"phone_number": "+18559728742",
_83
"url": "https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
_83
"capabilities": {
_83
"voice": {
_83
"inbound_connectivity": true,
_83
"outbound_connectivity": true,
_83
"e911": false,
_83
"fax": true,
_83
"calls_per_second": 20,
_83
"concurrent_calls_limit": 40,
_83
"long_record_length": 30,
_83
"inbound_called_dtmf": true,
_83
"inbound_caller_dtmf": true,
_83
"sip_trunking": true,
_83
"inbound_caller_id_preservation": "international",
_83
"inbound_reachability": "global"
_83
},
_83
"sms": {
_83
"inbound_connectivity": true,
_83
"outbound_connectivity": true,
_83
"gsm7": true,
_83
"ucs2": true,
_83
"inbound_sender_id_preservation": "international",
_83
"inbound_reachability": "global",
_83
"inbound_mps": -1
_83
},
_83
"mms": null
_83
},
_83
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_83
"sid": "PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
_83
"regulatory": {
_83
"address_requirements": "none"
_83
},
_83
"configuration": {
_83
"friendly_name": "(855) 972-8742",
_83
"status_callback_url": "",
_83
"status_callback_method": "POST",
_83
"voice": {
_83
"url": "",
_83
"method": "POST",
_83
"fallback_url": null,
_83
"fallback_method": "POST",
_83
"application_sid": null,
_83
"trunk_sid": null,
_83
"emergency_address_sid": null,
_83
"emergency_status": "Inactive",
_83
"caller_id_lookup": false
_83
},
_83
"sms": {
_83
"url": "",
_83
"method": "POST",
_83
"fallback_url": "",
_83
"fallback_method": "POST",
_83
"application_sid": ""
_83
}
_83
},
_83
"type": "tollfree",
_83
"lifecycle": "generally-available",
_83
"geography": {
_83
"iso_country": "US",
_83
"lata": null,
_83
"rate_center": null,
_83
"latitude": null,
_83
"longitude": null,
_83
"region": null,
_83
"locality": null,
_83
"postal_code": null
_83
}
_83
}
_83
],
_83
"meta": {
_83
"page": 0,
_83
"page_size": 50,
_83
"first_page_url": "https://preview.twilio.com/Numbers/ActiveNumbers&PageSize=50&Page=0",
_83
"previous_page_url": null,
_83
"url": "https://preview.twilio.com/Numbers/ActiveNumbers&PageSize=50&Page=0",
_83
"next_page_url": null,
_83
"key": "items"
_83
}
_83
}


ActiveNumbers Instance Resource

instance page anchor

An ActiveNumbers instance represents a Twilio phone number purchased from Twilio, ported to Twilio, or hosted on Twilio in your account.


_10
https://preview.twilio.com/Numbers/ActiveNumbers/{ActiveNumberSid}

Look up the capabilities on a specific number using the PhoneNumberSid in the URI.

Configure Phone Number Instance

configure-phone-number-instance page anchor
curl

_10
$ curl -XPOST https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy \
_10
-d "Configurations.Voice.Url = https://my-voice-url.com" \
_10
-d "Configurations.Sms.Url = https://my-sms-url.com" \
_10
-u '<ACCOUNT_SID:AUTH_TOKEN>'

Output

_70
{
_70
"phone_number": "+18559728742",
_70
"url": "https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
_70
"capabilities": {
_70
"voice": {
_70
"inbound_connectivity": true,
_70
"outbound_connectivity": true,
_70
"e911": false,
_70
"fax": true,
_70
"calls_per_second": 20,
_70
"concurrent_calls_limit": 40,
_70
"long_record_length": 30,
_70
"inbound_called_dtmf": true,
_70
"inbound_caller_dtmf": true,
_70
"sip_trunking": true,
_70
"inbound_caller_id_preservation": "international",
_70
"inbound_reachability": "global"
_70
},
_70
"sms": {
_70
"inbound_connectivity": true,
_70
"outbound_connectivity": true,
_70
"gsm7": true,
_70
"ucs2": true,
_70
"inbound_sender_id_preservation": "international",
_70
"inbound_reachability": "global",
_70
"inbound_mps": -1
_70
},
_70
"mms": null
_70
},
_70
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_70
"sid": "PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
_70
"regulatory": {
_70
"address_requirements": "none"
_70
},
_70
"configuration": {
_70
"friendly_name": "(855) 972-8742",
_70
"status_callback_url": "",
_70
"status_callback_method": "POST",
_70
"voice": {
_70
"url": "https://demo.twilio.com/welcome/voice/",
_70
"method": "POST",
_70
"fallback_url": null,
_70
"fallback_method": "POST",
_70
"application_sid": null,
_70
"trunk_sid": null,
_70
"emergency_address_sid": null,
_70
"emergency_status": "Inactive",
_70
"caller_id_lookup": false
_70
},
_70
"sms": {
_70
"url": "",
_70
"method": "POST",
_70
"fallback_url": "",
_70
"fallback_method": "POST",
_70
"application_sid": ""
_70
}
_70
},
_70
"type": "tollfree",
_70
"lifecycle": "generally-available",
_70
"geography": {
_70
"iso_country": "US",
_70
"lata": null,
_70
"rate_center": null,
_70
"latitude": null,
_70
"longitude": null,
_70
"region": null,
_70
"locality": null,
_70
"postal_code": null
_70
}
_70
}

Configure your number using the post method on the phone number instance with the possible optional parameters.

Basic Configuration Properties

basic-configuration-properties page anchor
PropertyDescription
Configurations.StatusCallbackThe URL that Twilio will request to pass status parameters (such as call ended) to your application.
Configurations.StatusCallbackMethodThe HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST.

Voice Configuration Properties

voice-configuration-properties-2 page anchor
PropertyDescription
Configurations.Voice.ApplicationSidThe 34 character sid of the voice application(link takes you to an external page) Twilio should use to handle Voice sent to this number. If an VoiceApplicationSid is present, Twilio will ignore all of the VoiceUrls above and use those set on the application.
Configurations.Voice.UrlThe URL Twilio will request when this phone number receives a call. The VoiceURL will no longer be used if a VoiceApplicationSid or a TrunkSid is set.
Configurations.Voice.MethodThe HTTP method Twilio will use when requesting the above Url. Either GET or POST. The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
Configurations.Voice.FallbackUrlThe URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
Configurations.Voice.FallbackMethodThe HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST.

Sms Configuration Properties

sms-configuration-properties-2 page anchor
PropertyDescription
Configurations.Sms.ApplicationSidThe 34 character sid of the application(link takes you to an external page) Twilio should use to handle SMSs sent to this number. If an SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application.
Configurations.Sms.UrlThe URL Twilio will request when this phone number receives a message. The SmsUrl will no longer be used if an SmsApplicationSid is set.
Configurations.Sms.MethodThe HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST.
Configurations.Sms.FallbackUrlThe URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl. The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
Configurations.Sms.FallbackMethodThe HTTP method Twilio will use when requesting the above URL. Either GET or POST.

Transfer number to subaccount

transfer-number-to-subaccount page anchor

_10
$ curl -XPOST https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy.json \
_10
-d "AccountSid=ACzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" \
_10
-u '<ACCOUNT_SID:AUTH_TOKEN>'

Example: Transfer number to subaccount

example-transfer-number-to-subaccount page anchor

You can transfer phone numbers between two Twilio accounts if you're using subaccounts. For details, see Exchanging Numbers Between Subaccounts.

Release this phone number from your account. Twilio will no longer answer calls to this number, and you will stop being billed the monthly phone number fee. The phone number will eventually be recycled and potentially given to another customer, so use with care. If you make a mistake, contact us. We may be able to give you the number back.

If successful, returns an HTTP 204 response with no body.

curl

_10
$ curl -G https://preview.twilio.com/Numbers/ActiveNumbers \
_10
-u '<ACCOUNT_SID:AUTH_TOKEN>'

Output

_97
{
_97
"items": [
_97
{
_97
"phone_number": "+1555223000",
_97
"capabilities": {
_97
"voice": {
_97
"inbound_connectivity": true,
_97
"outbound_connectivity": true,
_97
"e911": true,
_97
"fax": true,
_97
"sip_trunking": true,
_97
"calls_per_second": 30,
_97
"concurrent_calls_limit": 30,
_97
"long_record_length": 30,
_97
"inbound_called_dtmf": true,
_97
"inbound_caller_dtmf": true,
_97
"inbound_caller_id_preservation": "international",
_97
"inbound_reachability": "global",
_97
"codecs": [
_97
"g711u"
_97
]
_97
},
_97
"sms": {
_97
"inbound_connectivity": true,
_97
"outbound_connectivity": true,
_97
"gsm7": true,
_97
"ucs2": true,
_97
"gsm7_concatenation": true,
_97
"ucs2_concatenation": true,
_97
"inbound_sender_id_preservation": "international",
_97
"inbound_reachability": "global",
_97
"inbound_mps": -1
_97
},
_97
"mms": {
_97
"inbound_connectivity": true,
_97
"outbound_connectivity": true,
_97
"inbound_reachability": "global",
_97
"inbound_mps": -1
_97
}
_97
},
_97
"regulatory": {
_97
"address_requirements": "none"
_97
},
_97
"type": "local",
_97
"lifecycle": "generally-available",
_97
"geography": {
_97
"iso_country": "US",
_97
"lata": 132,
_97
"rate_center": "HUNTINGTON",
_97
"latitude": 40.8719,
_97
"longitude": -73.4347,
_97
"region": "NY",
_97
"locality": "HUNTINGTON",
_97
"postal_code": "11743"
_97
},
_97
"configurations": {
_97
"voice": {
_97
"application_sid": null,
_97
"trunk_sid": null,
_97
"emergency_status": "Inactive",
_97
"emergency_address_sid": null,
_97
"receive_mode": "voice",
_97
"url": null,
_97
"method": null,
_97
"fallback_url": null,
_97
"fallback_method": null,
_97
"caller_id_lookup": false
_97
},
_97
"sms": {
_97
"application_sid": null,
_97
"url": null,
_97
"method": null,
_97
"fallback_url": null,
_97
"fallback_method": null
_97
},
_97
"mms": {
_97
"application_sid": null,
_97
"url": null,
_97
"method": null,
_97
"fallback_url": null,
_97
"fallback_method": null
_97
},
_97
"status_callback": "",
_97
"status_callback_method": "POST"
_97
}
_97
}
_97
],
_97
"meta": {
_97
"page": 0,
_97
"page_size": 50,
_97
"first_page_url": "https://preview.twilio.com/Numbers/ActiveNumbers/US?PhoneNumber=+1552230000&PageSize=50&Page=0",
_97
"previous_page_url": null,
_97
"url": "https://preview.twilio.com/Numbers/ActiveNumbers?PhoneNumber=+16312237469&PageSize=50&Page=0",
_97
"next_page_url": null,
_97
"key": "items"
_97
}
_97
}


ActiveNumbers List Resource

list page anchor

_10
preview.twilio.com/Numbers/ActiveNumbers

Returns a list of ActiveNumber resource representations, each representing a phone number given to your account. The list includes paging information(link takes you to an external page).

The following parameters are accessible as GET filters. Note, parameters are case-sensitive:

PropertyDescription
PhoneNumberThe phone number you want to purchase. The number should be formatted starting with a '+' followed by the country code and the number
TypeThe type of phone number (i.e., local, mobile, tollfree, shortcode, etc.).
Capabilities.Voice.InboundCallerIdPreservationInbound Voice Caller ID (+E.164 format)(link takes you to an external page) preservation of a number. Can be - International, Domestic, or None.
Capabilities.Voice.InboundReachabilityInbound Voice reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Sms.InboundSenderIdPreservationInbound SMS Sender ID (+E.164 format)(link takes you to an external page) preservation of a number. Can be - International, Domestic, or None.
Capabilities.Sms.InboundReachabilityInbound SMS reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Mms.InboundReachabilityInbound MMS reachability of a number. Can be - Domestic, Foreign, or Global.
Geography.IsoCountryThe ISO country code(link takes you to an external page) of this phone number.
Geography.LataThe LATA(link takes you to an external page) of this phone number. Only available for countries in the North American Numbering Plan (NANPA)(link takes you to an external page).
Geography.RateCenterThe rate center(link takes you to an external page) of this phone number. Only available for countries in the North American Numbering Plan (NANPA)(link takes you to an external page).
Geography.LatitudeThe latitude coordinate of this phone number.
Geography.LongitudeThe longitude coordinate of this phone number.
Geography.RegionThe two-letter state or province abbreviation of this phone number.
Geography.LocalityThe locality/city of this phone number.
Geography.PostalCodeThe postal (zip) code of this phone number.

Example: List all Active Numbers

example-list-all-active-numbers page anchor

You can manage your numbers by creating a list of all numbers that meet your search criteria filters.

Purchases a new phone number for your account. If a phone number is found for your request, Twilio will add it to your account and bill you for the first month's cost of the phone number. If Twilio cannot find a phone number to match your request, you will receive an HTTP 400 with Twilio error code 21452.

If the number you are trying to purchase requires an identity document on file and you don't have a verified identity document associated with your account, you will receive an HTTP 400 with Twilio error code 21650. See this support article(link takes you to an external page) for more details.

To find an available phone number to POST, use the AvailableNumbers list resource.

(warning)

Warning

You cannot request numbers via the API while you are using a Free Trial account. You must upgrade your account to purchase a Twilio phone number programmatically.

Your request must include the following parameter:

ParameterDescription
PhoneNumberThe phone number you want to purchase. The number should be formatted starting with a '+' followed by the country code and the number in E.164(link takes you to an external page) format e.g., '+15105555555'. You must include this parameter to have your POST succeed.

Your request may include the following parameters that are referenced as resource properties. If successful, Twilio responds with a representation of the new phone number that was assigned to your account.

curl

_10
$ curl -XPOST https://preview.twilio.com/Numbers/ActiveNumbers \
_10
-d "PhoneNumber=+14155551234" \
_10
-u '<ACCOUNT_SID:AUTH_TOKEN>'

Output

_98
{
_98
"items": [
_98
{
_98
"phone_number": "+15552230000",
_98
"capabilities": {
_98
"voice": {
_98
"inbound_connectivity": true,
_98
"outbound_connectivity": true,
_98
"e911": true,
_98
"fax": true,
_98
"sip_trunking": true,
_98
"calls_per_second": 30,
_98
"concurrent_calls_limit": 30,
_98
"long_record_length": 30,
_98
"inbound_called_dtmf": true,
_98
"inbound_caller_dtmf": true,
_98
"inbound_caller_id_preservation": "international",
_98
"inbound_reachability": "global",
_98
"codecs": [
_98
"g711u"
_98
]
_98
},
_98
"sms": {
_98
"inbound_connectivity": true,
_98
"outbound_connectivity": true,
_98
"gsm7": true,
_98
"ucs2": true,
_98
"gsm7_concatenation": true,
_98
"ucs2_concatenation": true,
_98
"inbound_sender_id_preservation": "international",
_98
"inbound_reachability": "global",
_98
"inbound_mps": -1
_98
},
_98
"mms": {
_98
"inbound_connectivity": true,
_98
"outbound_connectivity": true,
_98
"inbound_reachability": "global",
_98
"inbound_mps": -1
_98
}
_98
},
_98
"regulatory": {
_98
"address_requirements": "none"
_98
},
_98
"type": "local",
_98
"lifecycle": "generally-available",
_98
"geography": {
_98
"iso_country": "US",
_98
"lata": 132,
_98
"rate_center": "HUNTINGTON",
_98
"latitude": 40.8719,
_98
"longitude": -73.4347,
_98
"region": "NY",
_98
"locality": "HUNTINGTON",
_98
"postal_code": "11743"
_98
},
_98
"configurations": {
_98
"voice": {
_98
"application_sid": null,
_98
"trunk_sid": null,
_98
"emergency_status": "Inactive",
_98
"emergency_address_sid": null,
_98
"receive_mode": "voice",
_98
"url": null,
_98
"method": null,
_98
"fallback_url": null,
_98
"fallback_method": null,
_98
"caller_id_lookup": false
_98
},
_98
"sms": {
_98
"application_sid": null,
_98
"url": null,
_98
"method": null,
_98
"fallback_url": null,
_98
"fallback_method": null,
_98
},
_98
"mms": {
_98
"application_sid": null,
_98
"url": null,
_98
"method": null,
_98
"fallback_url": null,
_98
"fallback_method": null,
_98
},
_98
"status_callback": "",
_98
"status_callback_method": "POST"
_98
}
_98
}
_98
}
_98
],
_98
"meta": {
_98
"page": 0,
_98
"page_size": 50,
_98
"first_page_url": "https://preview.twilio.com/Numbers/ActiveNumbers/US?PhoneNumber=+16312237469&PageSize=50&Page=0",
_98
"previous_page_url": null,
_98
"url": "https://preview.twilio.com/Numbers/ActiveNumbers?PhoneNumber=+16312237469&PageSize=50&Page=0",
_98
"next_page_url": null,
_98
"key": "items"
_98
}
_98
}

Example: Purchase new phone number

example-purchase-new-phone-number page anchor

The ActiveNumbers list resource represents an account's Twilio phone numbers. You can POST to the list resource to provision a new Twilio number. To find a new number to provision use the resources the AvailableNumbers resource.

Not Supported.

Not Supported.


Rate this page: