IncomingPhoneNumber resource
An IncomingPhoneNumber instance resource represents a Twilio phone number provisioned from Twilio, ported or hosted to Twilio.
The IncomingPhoneNumbers 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 subresources of the AvailablePhoneNumbers resource.
You can transfer phone numbers between two Twilio accounts if you're using subaccounts . For details, see Exchanging Numbers Between Subaccounts .
Warning NOTE: The order of the columns in the CSV is not defined and may change when new fields are added to the API response. Your application design should be resilient to changes in the order of the columns in the CSV response.
Resource properties The SID of the Address resource associated with the phone number.
address_requirements
type: enum<STRING> Not PIIPossible values:
none
any
local
foreign
The API version used to start a new TwiML session.
Whether the phone number is new to the Twilio platform. Can be: true
or false
.
capabilities
type: object<PHONE NUMBER CAPABILITIES> Not PIIThe set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are Voice
, SMS
, and MMS
and each capability can be: true
or false
.
date_created
type: string<DATE TIME RFC 2822> Not PIIdate_updated
type: string<DATE TIME RFC 2822> Not PIIThe string that you assigned to describe the resource.
The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations.
phone_number
type: string<PHONE NUMBER> Not PIIThe phone number's origin. twilio
identifies Twilio-owned phone numbers and hosted
identifies hosted phone numbers.
The unique string that that we created to identify this IncomingPhoneNumber resource.
sms_application_sid
type: SID<AP> Not PIIThe SID of the application that handles SMS messages sent to the phone number. If an sms_application_sid
is present, we ignore all sms_*_url
values and use those of the application.
sms_fallback_method
type: enum<HTTP METHOD> Not PIIThe HTTP method we use to call sms_fallback_url
. Can be: GET
or POST
.
sms_fallback_url
type: string<URI> Not PIIThe URL that we call when an error occurs while retrieving or executing the TwiML from sms_url
.
sms_method
type: enum<HTTP METHOD> Not PIIThe HTTP method we use to call sms_url
. Can be: GET
or POST
.
The URL we call when the phone number receives an incoming SMS message.
status_callback
type: string<URI> Not PIIThe URL we call using the status_callback_method
to send status information to your application.
status_callback_method
type: enum<HTTP METHOD> Not PIIThe HTTP method we use to call status_callback
. Can be: GET
or POST
.
The SID of the Trunk that handles calls to the phone number. If a trunk_sid
is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a trunk_sid
will automatically delete your voice_application_sid
and vice versa.
The URI of the resource, relative to https://api.twilio.com
.
voice_receive_mode
type: enum<STRING> Not PII
Possible values:
voice
fax
voice_application_sid
type: SID<AP> Not PIIThe SID of the application that handles calls to the phone number. If a voice_application_sid
is present, we ignore all of the voice urls and use those set on the application. Setting a voice_application_sid
will automatically delete your trunk_sid
and vice versa.
voice_caller_id_lookup
type: boolean Not PIIWhether we look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Can be: true
or false
.
voice_fallback_method
type: enum<HTTP METHOD> Not PIIThe HTTP method we use to call voice_fallback_url
. Can be: GET
or POST
.
voice_fallback_url
type: string<URI> Not PIIThe URL that we call when an error occurs retrieving or executing the TwiML requested by url
.
voice_method
type: enum<HTTP METHOD> Not PIIThe HTTP method we use to call voice_url
. Can be: GET
or POST
.
The URL we call when the phone number receives a call. The voice_url
will not be used if a voice_application_sid
or a trunk_sid
is set.
emergency_status
type: enum<STRING> Not PIIThe parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country.
Possible values:
Active
Inactive
emergency_address_sid
type: SID<AD> Not PIIThe SID of the emergency address configuration that we use for emergency calling from this phone number.
emergency_address_status
type: enum<STRING> Not PIIThe status of address registration with emergency services. A registered emergency address will be used during handling of emergency calls from this number.
Possible values:
registered
unregistered
pending-registration
registration-failure
pending-unregistration
unregistration-failure
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
URI parameters Request body parameters The API version to use for incoming calls made to the new phone number. The default is 2010-04-01
.
A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number.
SmsApplicationSid
type: SID<AP> Not PIIThe SID of the application that should handle SMS messages sent to the new phone number. If an sms_application_sid
is present, we ignore all of the sms_*_url
urls and use those set on the application.
SmsFallbackMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call sms_fallback_url
. Can be: GET
or POST
and defaults to POST
.
SmsFallbackUrl
type: string<URI> Not PIIThe URL that we should call when an error occurs while requesting or executing the TwiML defined by sms_url
.
SmsMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call sms_url
. Can be: GET
or POST
and defaults to POST
.
The URL we should call when the new phone number receives an incoming SMS message.
StatusCallback
type: string<URI> Not PIIThe URL we should call using the status_callback_method
to send status information to your application.
StatusCallbackMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method we should use to call status_callback
. Can be: GET
or POST
and defaults to POST
.
VoiceApplicationSid
type: SID<AP> Not PIIThe SID of the application we should use to handle calls to the new phone number. If a voice_application_sid
is present, we ignore all of the voice urls and use only those set on the application. Setting a voice_application_sid
will automatically delete your trunk_sid
and vice versa.
VoiceCallerIdLookup
type: boolean Not PIIWhether to lookup the caller's name from the CNAM database and post it to your app. Can be: true
or false
and defaults to false
.
VoiceFallbackMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call voice_fallback_url
. Can be: GET
or POST
and defaults to POST
.
VoiceFallbackUrl
type: string<URI> Not PIIThe URL that we should call when an error occurs retrieving or executing the TwiML requested by url
.
VoiceMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call voice_url
. Can be: GET
or POST
and defaults to POST
.
The URL that we should call to answer a call to the new phone number. The voice_url
will not be called if a voice_application_sid
or a trunk_sid
is set.
EmergencyStatus
type: enum<STRING> Not PIIThe parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country.
Possible values:
Active
Inactive
EmergencyAddressSid
type: SID<AD> Not PIIThe SID of the emergency address configuration to use for emergency calling from the new phone number.
The SID of the Trunk we should use to handle calls to the new phone number. If a trunk_sid
is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a trunk_sid
will automatically delete your voice_application_sid
and vice versa.
The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations.
The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations.
VoiceReceiveMode
type: enum<STRING> Not PIIThe configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: fax
or voice
and defaults to voice
.
Possible values:
voice
fax
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
PhoneNumber
type: string<PHONE NUMBER> Not PIIRequired if AreaCode is not passed
The phone number to purchase specified in E.164(link takes you to an external page) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.
Required if PhoneNumber is not passed
The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. You must provide an area_code
or a phone_number
. (US and Canada only).
You will be charged when you provision the number, and the number will appear on the Numbers page in the console.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers
_10 .create({phoneNumber: '+15017122661'})
_10 .then(incoming_phone_number => console.log(incoming_phone_number.sid));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Active",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "friendly_name",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_fallback_method": "GET",
_41 "sms_fallback_url": "https://example.com",
_41 "sms_url": "https://example.com",
_41 "status_callback": "https://example.com",
_41 "status_callback_method": "GET",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_caller_id_lookup": false,
_41 "voice_fallback_method": "GET",
_41 "voice_fallback_url": "https://example.com",
_41 "voice_method": "GET",
_41 "voice_url": "https://example.com",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_receive_mode": "voice",
Provide an AddressSid and a BundleSid for your new IncomingPhoneNumber
_14 // Download the helper library from https://www.twilio.com/docs/node/install
_14 // Find your Account SID and Auth Token at twilio.com/console
_14 // and set the environment variables. See http://twil.io/secure
_14 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14 const authToken = process.env.TWILIO_AUTH_TOKEN;
_14 const client = require('twilio')(accountSid, authToken);
_14 client.incomingPhoneNumbers
_14 addressSid: 'ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_14 bundleSid: 'BUIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_14 phoneNumber: '+15017122661'
_14 .then(incoming_phone_number => console.log(incoming_phone_number.sid));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Active",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "friendly_name",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_fallback_method": "GET",
_41 "sms_fallback_url": "https://example.com",
_41 "sms_url": "https://example.com",
_41 "status_callback": "https://example.com",
_41 "status_callback_method": "GET",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_caller_id_lookup": false,
_41 "voice_fallback_method": "GET",
_41 "voice_fallback_url": "https://example.com",
_41 "voice_method": "GET",
_41 "voice_url": "https://example.com",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_receive_mode": "voice",
Twilio will send a HTTP request to this URL when a call comes in to your phone number
_13 // Download the helper library from https://www.twilio.com/docs/node/install
_13 // Find your Account SID and Auth Token at twilio.com/console
_13 // and set the environment variables. See http://twil.io/secure
_13 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13 const authToken = process.env.TWILIO_AUTH_TOKEN;
_13 const client = require('twilio')(accountSid, authToken);
_13 client.incomingPhoneNumbers
_13 voiceUrl: 'https://www.your-voice-url.com/example',
_13 phoneNumber: '+15017122661'
_13 .then(incoming_phone_number => console.log(incoming_phone_number.sid));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Active",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "friendly_name",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_fallback_method": "GET",
_41 "sms_fallback_url": "https://example.com",
_41 "sms_url": "https://example.com",
_41 "status_callback": "https://example.com",
_41 "status_callback_method": "GET",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_caller_id_lookup": false,
_41 "voice_fallback_method": "GET",
_41 "voice_fallback_url": "https://example.com",
_41 "voice_method": "GET",
_41 "voice_url": "https://www.your-voice-url.com/example",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_receive_mode": "voice",
Twilio will send a HTTP request to this URL when an SMS is sent to your phone number
_13 // Download the helper library from https://www.twilio.com/docs/node/install
_13 // Find your Account SID and Auth Token at twilio.com/console
_13 // and set the environment variables. See http://twil.io/secure
_13 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13 const authToken = process.env.TWILIO_AUTH_TOKEN;
_13 const client = require('twilio')(accountSid, authToken);
_13 client.incomingPhoneNumbers
_13 smsUrl: 'https://www.your-sms-url.com/example',
_13 phoneNumber: '+15017122661'
_13 .then(incoming_phone_number => console.log(incoming_phone_number.sid));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Active",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "friendly_name",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_fallback_method": "GET",
_41 "sms_fallback_url": "https://example.com",
_41 "sms_url": "https://www.your-sms-url.com/example",
_41 "status_callback": "https://example.com",
_41 "status_callback_method": "GET",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_caller_id_lookup": false,
_41 "voice_fallback_method": "GET",
_41 "voice_fallback_url": "https://example.com",
_41 "voice_method": "GET",
_41 "voice_url": "https://example.com",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "voice_receive_mode": "voice",
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Active",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "(808) 925-5327",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "",
_41 "sms_fallback_method": "POST",
_41 "sms_fallback_url": "",
_41 "sms_method": "POST",
_41 "status_callback": "",
_41 "status_callback_method": "POST",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "",
_41 "voice_caller_id_lookup": false,
_41 "voice_fallback_method": "POST",
_41 "voice_fallback_url": null,
_41 "voice_method": "POST",
_41 "voice_receive_mode": "voice",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
URI parameters Query Parameter
Whether to include phone numbers new to the Twilio platform. Can be: true
or false
and the default is true
.
Query Parameter
A string that identifies the IncomingPhoneNumber resources to read.
PhoneNumber
type: string<PHONE NUMBER> Not PIIQuery Parameter
The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.
Query Parameter
Whether to include phone numbers based on their origin. Can be: twilio
or hosted
. By default, phone numbers of all origin are included.
Query Parameter
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Query Parameter
The page index. This value is simply for client state.
Query Parameter
The page token. This is provided by the API.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers
_10 .then(incomingPhoneNumbers => incomingPhoneNumbers.forEach(i => console.log(i.sid)));
_56 "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56 "incoming_phone_numbers": [
_56 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "address_requirements": "none",
_56 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "api_version": "2010-04-01",
_56 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_56 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_56 "emergency_status": "Active",
_56 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "emergency_address_status": "registered",
_56 "friendly_name": "(808) 925-5327",
_56 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "phone_number": "+18089255327",
_56 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "sms_application_sid": "",
_56 "sms_fallback_method": "POST",
_56 "sms_fallback_url": "",
_56 "sms_method": "POST",
_56 "status_callback": "",
_56 "status_callback_method": "POST",
_56 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_56 "voice_application_sid": "",
_56 "voice_caller_id_lookup": false,
_56 "voice_fallback_method": "POST",
_56 "voice_fallback_url": null,
_56 "voice_method": "POST",
_56 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "voice_receive_mode": "voice",
_56 "subresource_uris": {
_56 "assigned_add_ons": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AssignedAddOns.json"
_56 "next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=50",
_56 "previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
Return the set of phone numbers that match exactly (415) 867-5310
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers
_10 .list({phoneNumber: '+14158675310', limit: 20})
_10 .then(incomingPhoneNumbers => incomingPhoneNumbers.forEach(i => console.log(i.sid)));
_56 "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56 "incoming_phone_numbers": [
_56 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "address_requirements": "none",
_56 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "api_version": "2010-04-01",
_56 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_56 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_56 "emergency_status": "Active",
_56 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "emergency_address_status": "registered",
_56 "friendly_name": "(808) 925-5327",
_56 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "phone_number": "+18089255327",
_56 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "sms_application_sid": "",
_56 "sms_fallback_method": "POST",
_56 "sms_fallback_url": "",
_56 "sms_method": "POST",
_56 "status_callback": "",
_56 "status_callback_method": "POST",
_56 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_56 "voice_application_sid": "",
_56 "voice_caller_id_lookup": false,
_56 "voice_fallback_method": "POST",
_56 "voice_fallback_url": null,
_56 "voice_method": "POST",
_56 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "voice_receive_mode": "voice",
_56 "subresource_uris": {
_56 "assigned_add_ons": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AssignedAddOns.json"
_56 "next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=50",
_56 "previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
Return the set of all phone numbers containing the digits 867
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers
_10 .list({phoneNumber: '867', limit: 20})
_10 .then(incomingPhoneNumbers => incomingPhoneNumbers.forEach(i => console.log(i.sid)));
_56 "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56 "incoming_phone_numbers": [
_56 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "address_requirements": "none",
_56 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "api_version": "2010-04-01",
_56 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_56 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_56 "emergency_status": "Active",
_56 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "emergency_address_status": "registered",
_56 "friendly_name": "(808) 925-5327",
_56 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "phone_number": "+18089255327",
_56 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "sms_application_sid": "",
_56 "sms_fallback_method": "POST",
_56 "sms_fallback_url": "",
_56 "sms_method": "POST",
_56 "status_callback": "",
_56 "status_callback_method": "POST",
_56 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_56 "voice_application_sid": "",
_56 "voice_caller_id_lookup": false,
_56 "voice_fallback_method": "POST",
_56 "voice_fallback_url": null,
_56 "voice_method": "POST",
_56 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56 "voice_receive_mode": "voice",
_56 "subresource_uris": {
_56 "assigned_add_ons": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AssignedAddOns.json"
_56 "next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=50",
_56 "previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to update.
Request body parameters The API version to use for incoming calls made to the phone number. The default is 2010-04-01
.
A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number.
SmsApplicationSid
type: SID<AP> Not PIIThe SID of the application that should handle SMS messages sent to the number. If an sms_application_sid
is present, we ignore all of the sms_*_url
urls and use those set on the application.
SmsFallbackMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call sms_fallback_url
. Can be: GET
or POST
and defaults to POST
.
SmsFallbackUrl
type: string<URI> Not PIIThe URL that we should call when an error occurs while requesting or executing the TwiML defined by sms_url
.
SmsMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call sms_url
. Can be: GET
or POST
and defaults to POST
.
The URL we should call when the phone number receives an incoming SMS message.
StatusCallback
type: string<URI> Not PIIThe URL we should call using the status_callback_method
to send status information to your application.
StatusCallbackMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method we should use to call status_callback
. Can be: GET
or POST
and defaults to POST
.
VoiceApplicationSid
type: SID<AP> Not PIIThe SID of the application we should use to handle phone calls to the phone number. If a voice_application_sid
is present, we ignore all of the voice urls and use only those set on the application. Setting a voice_application_sid
will automatically delete your trunk_sid
and vice versa.
VoiceCallerIdLookup
type: boolean Not PIIWhether to lookup the caller's name from the CNAM database and post it to your app. Can be: true
or false
and defaults to false
.
VoiceFallbackMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call voice_fallback_url
. Can be: GET
or POST
and defaults to POST
.
VoiceFallbackUrl
type: string<URI> Not PIIThe URL that we should call when an error occurs retrieving or executing the TwiML requested by url
.
VoiceMethod
type: enum<HTTP METHOD> Not PIIThe HTTP method that we should use to call voice_url
. Can be: GET
or POST
and defaults to POST
.
The URL that we should call to answer a call to the phone number. The voice_url
will not be called if a voice_application_sid
or a trunk_sid
is set.
EmergencyStatus
type: enum<STRING> Not PIIThe parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country.
Possible values:
Active
Inactive
EmergencyAddressSid
type: SID<AD> Not PIIThe SID of the emergency address configuration to use for emergency calling from this phone number.
The SID of the Trunk we should use to handle phone calls to the phone number. If a trunk_sid
is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a trunk_sid
will automatically delete your voice_application_sid
and vice versa.
VoiceReceiveMode
type: enum<STRING> Not PIIThe configuration parameter for the phone number to receive incoming voice calls or faxes. Can be: fax
or voice
and defaults to voice
.
Possible values:
voice
fax
The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations.
The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations.
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
_13 // Download the helper library from https://www.twilio.com/docs/node/install
_13 // Find your Account SID and Auth Token at twilio.com/console
_13 // and set the environment variables. See http://twil.io/secure
_13 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13 const authToken = process.env.TWILIO_AUTH_TOKEN;
_13 const client = require('twilio')(accountSid, authToken);
_13 client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13 addressSid: 'ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_13 bundleSid: 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
_13 .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Inactive",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "(808) 925-5327",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "",
_41 "sms_fallback_method": "POST",
_41 "sms_fallback_url": "",
_41 "sms_method": "POST",
_41 "status_callback": "",
_41 "status_callback_method": "POST",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "",
_41 "voice_caller_id_lookup": true,
_41 "voice_fallback_method": "POST",
_41 "voice_fallback_url": null,
_41 "voice_method": "POST",
_41 "voice_receive_mode": "voice",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Twilio will send a HTTP request to this URL when a call is received by your phone number
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .update({voiceUrl: 'https://www.your-new-voice-url.com/example'})
_10 .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Inactive",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "(808) 925-5327",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "",
_41 "sms_fallback_method": "POST",
_41 "sms_fallback_url": "",
_41 "sms_method": "POST",
_41 "status_callback": "",
_41 "status_callback_method": "POST",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "",
_41 "voice_caller_id_lookup": true,
_41 "voice_fallback_method": "POST",
_41 "voice_fallback_url": null,
_41 "voice_method": "POST",
_41 "voice_url": "https://www.your-new-voice-url.com/example",
_41 "voice_receive_mode": "voice",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Twilio will send a HTTP request to this URL when an SMS is sent to your phone number
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .update({smsUrl: 'https://www.your-new-sms-url.com/example'})
_10 .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));
_41 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "address_requirements": "none",
_41 "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "api_version": "2010-04-01",
_41 "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41 "emergency_status": "Inactive",
_41 "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "emergency_address_status": "registered",
_41 "friendly_name": "(808) 925-5327",
_41 "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "phone_number": "+18089255327",
_41 "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41 "sms_application_sid": "",
_41 "sms_fallback_method": "POST",
_41 "sms_fallback_url": "",
_41 "sms_method": "POST",
_41 "sms_url": "https://www.your-new-sms-url.com/example",
_41 "status_callback": "",
_41 "status_callback_method": "POST",
_41 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41 "voice_application_sid": "",
_41 "voice_caller_id_lookup": true,
_41 "voice_fallback_method": "POST",
_41 "voice_fallback_url": null,
_41 "voice_method": "POST",
_41 "voice_receive_mode": "voice",
_41 "bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
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.
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();