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.
The table below states basic properties of the phone number that associate the number to a unique group within Twilio's inventory system.
Property | Description |
---|---|
PhoneNumber | The phone number, in E.164 (i.e. "+1") format. |
FriendlyName | A 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. |
Type | The type of phone number (i.e., local, mobile, toll-free, short code, etc.). |
Lifecycle | The lifecycle the number is in (i.e., developer-preview, beta, generally-available, exhausted). |
StatusCallback | The URL that Twilio will request to pass status parameters (such as call ended) to your application. |
StatusCallbackMethod | The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST . |
Voice calling is provided by utilizing the Public Switch Telephone Network (PSTN), 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.
Property | Description |
---|---|
Capabilities.Voice.InboundConnectivity | Indicates whether a number has inbound voice connectivity in to Twilio. |
Capabilities.Voice.OutboundConnectivity | Indicates whether a number has outbound voice connectivity out of Twilio. |
Capabilities.Voice.E911 | Emergency 911 connectivity capable number. |
Capabilities.Voice.Fax | Fax capable number. |
Capabilities.Voice.SipTrunking | Sip Trunking capable number. |
Capabilities.Voice.CallsPerSecond | Integer stating how many calls can be initiated per second. Please refer to Twilio's CPS Support article for more information. |
Capabilities.Voice.ConcurrentCallsLimit | Integer stating how many calls can be active at one time. |
Capabilities.Voice.InboundCalledDtmf | Dual-Tone Multi Frequency with inbound called party. |
Capabilities.Voice.InboundCallerDtmf | Dual-Tone Multi Frequency with inbound caller party. |
Capabilities.Voice.InboundCallerIdPreservation | Inbound voice Caller ID (+E.164 format) preservation of a number. Can be - International, Domestic, or None. |
Capabilities.Voice.InboundReachability | Inbound Voice reachability of a number. Can be - Domestic, Foreign, or Global. |
Capabilities.Voice.LongRecordLength | The length in seconds that a number can record a voicemail. |
Short Messaging Service (SMS) is a text messaging service component of most telephone, World Wide Web, and mobile telephony systems.
Property | Description |
---|---|
Capabilities.Sms.InboundConnectivity | Indicates whether a number has inbound sms connectivity in to Twilio. |
Capabilities.Sms.OutboundConnectivity | Indicates whether a number has outbound sms connectivity out of Twilio. |
Capabilities.Sms.Gsm7 | GSM-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. |
Capabilities.Sms.Ucs2 | UCS-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?. |
Capabilities.Sms.Gsm7Concatenation | Concatenated short message service (or concatenated SMS) 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.Ucs2Concatenation | Concatenated short message service (or concatenated SMS) 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.InboundSenderIdPreservation | Inbound sms Sender ID (+E.164 format) preservation of a number. Can be - International, Domestic, or None. |
Capabilities.Sms.InboundReachability | Inbound SMS reachability of a number. Can be - Domestic, Foreign, or Global. |
Capabilities.Sms.InboundMps | Integer showing the SMS inbound message per second limit. Please refer to Twilio's MPS Support article for more information. |
Multimedia Messaging Service (MMS) is a standard way to send messages that include multimedia content to and from a mobile phone over a cellular network.
Property | Description |
---|---|
Capabilities.Mms.Inboundconnectivity | Indicates whether a number has inbound MMS connectivity into Twilio. |
Capabilities.Mms.Outboundconnectivity | Indicates whether a number has outbound MMS connectivity into Twilio. |
Capabilities.Mms.InboundReachability | Inbound MMS reachability of a number. Can be - Domestic, Foreign, or Global. |
Capabilities.Mms.InboundMps | Integer showing the MMS inbound message per second limit. Please refer to Twilio's MPS Support article 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.
Property | Description |
---|---|
Regulatory.AddressRequirements | This indicates whether the phone number requires you or your customer to have an Address registered with Twilio. Possible values are listed below. |
The following are the possible values for the address_required
property.
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.
Property | Description |
---|---|
Geography.IsoCountry | The ISO country code of this phone number. |
Geography.Lata | The LATA of this phone number. Only available for countries in the North American Numbering Plan (NANPA). |
Geography.RateCenter | The rate center of this phone number. Only available for countries in the North American Numbering Plan (NANPA). |
Geography.Latitude | The latitude coordinate of this phone number. |
Geography.Longitude | The longitude coordinate of this phone number. |
Geography.Region | The two-letter state or province abbreviation of this phone number. |
Geography.Locality | The locality/city of this phone number. |
Geography.PostalCode | The postal (zip) code of this phone number. |
A number's voice configuration for the capabilities enabled. These attributes are mutable and can be changed based on differing operations.
Property | Description |
---|---|
Configurations.Voice.ApplicationSid | The 34 character sid of the voice application 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.TrunkSid | The 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.EmergencyStatus | Status determining whether the number is enabled for emergency calling. |
Configurations.Voice.EmergencyAddressSid | EmergencyAddress configuration to leverage emergency calling. |
Configurations.Voice.ReceiveMode | Whether the phone number is configured to receive voice or fax calls. Either voice or fax . |
Configurations.Voice.Url | The 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.Method | The 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.FallbackUrl | The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url . |
Configurations.Voice.FallbackMethod | The HTTP method Twilio will use when requesting the VoiceFallbackUrl . Either GET or POST . |
Configurations.Voice.CallerIdLookup | Do a lookup of a caller's name from the CNAM database and post it to your app. Either true or false . |
A number's sms configuration for the capabilities enabled. These attributes are mutable and can be changed based on differing operations.
Property | Description |
---|---|
Configurations.Sms.ApplicationSid | The 34 character sid of the application 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.Url | The 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.Method | The HTTP method Twilio will use when making requests to the SmsUrl . Either GET or POST . |
Configurations.Sms.FallbackUrl | The 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.FallbackMethod | The HTTP method Twilio will use when requesting the above URL. Either GET or POST . |
1$ curl -G https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy \2-u '<ACCOUNT_SID:AUTH_TOKEN>'
1{2"items": [3{4"phone_number": "+18559728742",5"url": "https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",6"capabilities": {7"voice": {8"inbound_connectivity": true,9"outbound_connectivity": true,10"e911": false,11"fax": true,12"calls_per_second": 20,13"concurrent_calls_limit": 40,14"long_record_length": 30,15"inbound_called_dtmf": true,16"inbound_caller_dtmf": true,17"sip_trunking": true,18"inbound_caller_id_preservation": "international",19"inbound_reachability": "global"20},21"sms": {22"inbound_connectivity": true,23"outbound_connectivity": true,24"gsm7": true,25"ucs2": true,26"inbound_sender_id_preservation": "international",27"inbound_reachability": "global",28"inbound_mps": -129},30"mms": null31},32"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",33"sid": "PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",34"regulatory": {35"address_requirements": "none"36},37"configuration": {38"friendly_name": "(855) 972-8742",39"status_callback_url": "",40"status_callback_method": "POST",41"voice": {42"url": "",43"method": "POST",44"fallback_url": null,45"fallback_method": "POST",46"application_sid": null,47"trunk_sid": null,48"emergency_address_sid": null,49"emergency_status": "Inactive",50"caller_id_lookup": false51},52"sms": {53"url": "",54"method": "POST",55"fallback_url": "",56"fallback_method": "POST",57"application_sid": ""58}59},60"type": "tollfree",61"lifecycle": "generally-available",62"geography": {63"iso_country": "US",64"lata": null,65"rate_center": null,66"latitude": null,67"longitude": null,68"region": null,69"locality": null,70"postal_code": null71}72}73],74"meta": {75"page": 0,76"page_size": 50,77"first_page_url": "https://preview.twilio.com/Numbers/ActiveNumbers&PageSize=50&Page=0",78"previous_page_url": null,79"url": "https://preview.twilio.com/Numbers/ActiveNumbers&PageSize=50&Page=0",80"next_page_url": null,81"key": "items"82}83}
An ActiveNumbers instance represents a Twilio phone number purchased from Twilio, ported to Twilio, or hosted on Twilio in your account.
1https://preview.twilio.com/Numbers/ActiveNumbers/{ActiveNumberSid}2
Look up the capabilities on a specific number using the PhoneNumberSid in the URI.
1$ curl -XPOST https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy \2-d "Configurations.Voice.Url = https://my-voice-url.com" \3-d "Configurations.Sms.Url = https://my-sms-url.com" \4-u '<ACCOUNT_SID:AUTH_TOKEN>'
1{2"phone_number": "+18559728742",3"url": "https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",4"capabilities": {5"voice": {6"inbound_connectivity": true,7"outbound_connectivity": true,8"e911": false,9"fax": true,10"calls_per_second": 20,11"concurrent_calls_limit": 40,12"long_record_length": 30,13"inbound_called_dtmf": true,14"inbound_caller_dtmf": true,15"sip_trunking": true,16"inbound_caller_id_preservation": "international",17"inbound_reachability": "global"18},19"sms": {20"inbound_connectivity": true,21"outbound_connectivity": true,22"gsm7": true,23"ucs2": true,24"inbound_sender_id_preservation": "international",25"inbound_reachability": "global",26"inbound_mps": -127},28"mms": null29},30"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",31"sid": "PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",32"regulatory": {33"address_requirements": "none"34},35"configuration": {36"friendly_name": "(855) 972-8742",37"status_callback_url": "",38"status_callback_method": "POST",39"voice": {40"url": "https://demo.twilio.com/welcome/voice/",41"method": "POST",42"fallback_url": null,43"fallback_method": "POST",44"application_sid": null,45"trunk_sid": null,46"emergency_address_sid": null,47"emergency_status": "Inactive",48"caller_id_lookup": false49},50"sms": {51"url": "",52"method": "POST",53"fallback_url": "",54"fallback_method": "POST",55"application_sid": ""56}57},58"type": "tollfree",59"lifecycle": "generally-available",60"geography": {61"iso_country": "US",62"lata": null,63"rate_center": null,64"latitude": null,65"longitude": null,66"region": null,67"locality": null,68"postal_code": null69}70}
Configure your number using the post method on the phone number instance with the possible optional parameters.
Property | Description |
---|---|
Configurations.StatusCallback | The URL that Twilio will request to pass status parameters (such as call ended) to your application. |
Configurations.StatusCallbackMethod | The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST . |
Property | Description |
---|---|
Configurations.Voice.ApplicationSid | The 34 character sid of the voice application 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.Url | The 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.Method | The 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.FallbackUrl | The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url . |
Configurations.Voice.FallbackMethod | The HTTP method Twilio will use when requesting the VoiceFallbackUrl . Either GET or POST . |
Property | Description |
---|---|
Configurations.Sms.ApplicationSid | The 34 character sid of the application 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.Url | The 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.Method | The HTTP method Twilio will use when making requests to the SmsUrl . Either GET or POST . |
Configurations.Sms.FallbackUrl | The 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.FallbackMethod | The HTTP method Twilio will use when requesting the above URL. Either GET or POST . |
1$ curl -XPOST https://preview.twilio.com/Numbers/ActiveNumbers/PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy.json \2-d "AccountSid=ACzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" \3-u '<ACCOUNT_SID:AUTH_TOKEN>'
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.
1$ curl -G https://preview.twilio.com/Numbers/ActiveNumbers \2-u '<ACCOUNT_SID:AUTH_TOKEN>'
1{2"items": [3{4"phone_number": "+1555223000",5"capabilities": {6"voice": {7"inbound_connectivity": true,8"outbound_connectivity": true,9"e911": true,10"fax": true,11"sip_trunking": true,12"calls_per_second": 30,13"concurrent_calls_limit": 30,14"long_record_length": 30,15"inbound_called_dtmf": true,16"inbound_caller_dtmf": true,17"inbound_caller_id_preservation": "international",18"inbound_reachability": "global",19"codecs": [20"g711u"21]22},23"sms": {24"inbound_connectivity": true,25"outbound_connectivity": true,26"gsm7": true,27"ucs2": true,28"gsm7_concatenation": true,29"ucs2_concatenation": true,30"inbound_sender_id_preservation": "international",31"inbound_reachability": "global",32"inbound_mps": -133},34"mms": {35"inbound_connectivity": true,36"outbound_connectivity": true,37"inbound_reachability": "global",38"inbound_mps": -139}40},41"regulatory": {42"address_requirements": "none"43},44"type": "local",45"lifecycle": "generally-available",46"geography": {47"iso_country": "US",48"lata": 132,49"rate_center": "HUNTINGTON",50"latitude": 40.8719,51"longitude": -73.4347,52"region": "NY",53"locality": "HUNTINGTON",54"postal_code": "11743"55},56"configurations": {57"voice": {58"application_sid": null,59"trunk_sid": null,60"emergency_status": "Inactive",61"emergency_address_sid": null,62"receive_mode": "voice",63"url": null,64"method": null,65"fallback_url": null,66"fallback_method": null,67"caller_id_lookup": false68},69"sms": {70"application_sid": null,71"url": null,72"method": null,73"fallback_url": null,74"fallback_method": null75},76"mms": {77"application_sid": null,78"url": null,79"method": null,80"fallback_url": null,81"fallback_method": null82},83"status_callback": "",84"status_callback_method": "POST"85}86}87],88"meta": {89"page": 0,90"page_size": 50,91"first_page_url": "https://preview.twilio.com/Numbers/ActiveNumbers/US?PhoneNumber=+1552230000&PageSize=50&Page=0",92"previous_page_url": null,93"url": "https://preview.twilio.com/Numbers/ActiveNumbers?PhoneNumber=+16312237469&PageSize=50&Page=0",94"next_page_url": null,95"key": "items"96}97}
1preview.twilio.com/Numbers/ActiveNumbers2
Returns a list of ActiveNumber resource representations, each representing a phone number given to your account. The list includes paging information.
The following parameters are accessible as GET
filters. Note, parameters are case-sensitive:
Property | Description |
---|---|
PhoneNumber | The phone number you want to purchase. The number should be formatted starting with a '+' followed by the country code and the number |
Type | The type of phone number (i.e., local, mobile, toll-free, short code, etc.). |
Capabilities.Voice.InboundCallerIdPreservation | Inbound Voice Caller ID (+E.164 format) preservation of a number. Can be - International, Domestic, or None. |
Capabilities.Voice.InboundReachability | Inbound Voice reachability of a number. Can be - Domestic, Foreign, or Global. |
Capabilities.Sms.InboundSenderIdPreservation | Inbound SMS Sender ID (+E.164 format) preservation of a number. Can be - International, Domestic, or None. |
Capabilities.Sms.InboundReachability | Inbound SMS reachability of a number. Can be - Domestic, Foreign, or Global. |
Capabilities.Mms.InboundReachability | Inbound MMS reachability of a number. Can be - Domestic, Foreign, or Global. |
Geography.IsoCountry | The ISO country code of this phone number. |
Geography.Lata | The LATA of this phone number. Only available for countries in the North American Numbering Plan (NANPA). |
Geography.RateCenter | The rate center of this phone number. Only available for countries in the North American Numbering Plan (NANPA). |
Geography.Latitude | The latitude coordinate of this phone number. |
Geography.Longitude | The longitude coordinate of this phone number. |
Geography.Region | The two-letter state or province abbreviation of this phone number. |
Geography.Locality | The locality/city of this phone number. |
Geography.PostalCode | The postal (zip) code of this phone number. |
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 for more details.
To find an available phone number to POST
, use the AvailableNumbers list resource.
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:
Parameter | Description |
---|---|
PhoneNumber | The 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 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.
1$ curl -XPOST https://preview.twilio.com/Numbers/ActiveNumbers \2-d "PhoneNumber=+14155551234" \3-u '<ACCOUNT_SID:AUTH_TOKEN>'
1{2"items": [3{4"phone_number": "+15552230000",5"capabilities": {6"voice": {7"inbound_connectivity": true,8"outbound_connectivity": true,9"e911": true,10"fax": true,11"sip_trunking": true,12"calls_per_second": 30,13"concurrent_calls_limit": 30,14"long_record_length": 30,15"inbound_called_dtmf": true,16"inbound_caller_dtmf": true,17"inbound_caller_id_preservation": "international",18"inbound_reachability": "global",19"codecs": [20"g711u"21]22},23"sms": {24"inbound_connectivity": true,25"outbound_connectivity": true,26"gsm7": true,27"ucs2": true,28"gsm7_concatenation": true,29"ucs2_concatenation": true,30"inbound_sender_id_preservation": "international",31"inbound_reachability": "global",32"inbound_mps": -133},34"mms": {35"inbound_connectivity": true,36"outbound_connectivity": true,37"inbound_reachability": "global",38"inbound_mps": -139}40},41"regulatory": {42"address_requirements": "none"43},44"type": "local",45"lifecycle": "generally-available",46"geography": {47"iso_country": "US",48"lata": 132,49"rate_center": "HUNTINGTON",50"latitude": 40.8719,51"longitude": -73.4347,52"region": "NY",53"locality": "HUNTINGTON",54"postal_code": "11743"55},56"configurations": {57"voice": {58"application_sid": null,59"trunk_sid": null,60"emergency_status": "Inactive",61"emergency_address_sid": null,62"receive_mode": "voice",63"url": null,64"method": null,65"fallback_url": null,66"fallback_method": null,67"caller_id_lookup": false68},69"sms": {70"application_sid": null,71"url": null,72"method": null,73"fallback_url": null,74"fallback_method": null,75},76"mms": {77"application_sid": null,78"url": null,79"method": null,80"fallback_url": null,81"fallback_method": null,82},83"status_callback": "",84"status_callback_method": "POST"85}86}87}88],89"meta": {90"page": 0,91"page_size": 50,92"first_page_url": "https://preview.twilio.com/Numbers/ActiveNumbers/US?PhoneNumber=+16312237469&PageSize=50&Page=0",93"previous_page_url": null,94"url": "https://preview.twilio.com/Numbers/ActiveNumbers?PhoneNumber=+16312237469&PageSize=50&Page=0",95"next_page_url": null,96"key": "items"97}98}
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.