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

Inbound Processing Region API - PhoneNumber


In the context of the Inbound Processing Region API, a PhoneNumber resource represents the routing configuration for a particular IncomingPhoneNumber.

By adjusting the value of the voice_region property, you can control which Twilio Region will process and store data related to inbound calls for the phone number.

(warning)

Warning

Changes to this resource may take up to 5 minutes to take effect.


PhoneNumber Properties

phonenumber-properties page anchor
Property nameTypePIIDescription
phone_numberstring
Not PII

The phone number in E.164 format


urlstring<uri>

The absolute URL of the resource.


sidSID<QQ>

A 34 character string that uniquely identifies the Inbound Processing Region assignments for this phone number.

Pattern: ^QQ[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The unique SID identifier of the Account.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

A human readable description of the Inbound Processing Region assignments for this phone number, up to 64 characters.


voice_regionstring

The Inbound Processing Region used for this phone number for voice.


date_createdstring<date-time>

The date that this phone number was assigned an Inbound Processing Region, given in ISO 8601 format.


date_updatedstring<date-time>

The date that the Inbound Processing Region was updated for this phone number, given in ISO 8601 format.


Fetch a PhoneNumber's current Inbound Processing Region configuration

fetch-a-phonenumbers-current-inbound-processing-region-configuration page anchor
GET https://routes.twilio.com/v2/PhoneNumbers/{PhoneNumber}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
PhoneNumberstringrequired

The phone number in E.164 format

Fetch a PhoneNumber's current Inbound Processing Region configuration

fetch-a-phonenumbers-current-inbound-processing-region-configuration-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
import twilio from "twilio";
_12
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = twilio(accountSid, authToken);
_12
_12
const phoneNumber = await client.routes.v2.phoneNumbers("+18001234567").fetch();
_12
_12
console.log(phoneNumber.phoneNumber);

Output

_10
{
_10
"phone_number": "+18001234567",
_10
"url": "https://routes.twilio.com/v2/PhoneNumbers/+18001234567",
_10
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "friendly_name",
_10
"voice_region": "au1",
_10
"date_created": "2015-07-30T20:00:00Z",
_10
"date_updated": "2015-07-30T20:00:00Z"
_10
}


Update a PhoneNumber's Inbound Processing Region configuration

update-a-phonenumbers-inbound-processing-region-configuration page anchor
POST https://routes.twilio.com/v2/PhoneNumbers/{PhoneNumber}

Property nameTypeRequiredPIIDescription
PhoneNumberstringrequired

The phone number in E.164 format

Property nameTypeRequiredPIIDescription
VoiceRegionstringOptional

The Inbound Processing Region used for this phone number for voice


FriendlyNamestringOptional

A human readable description of this resource, up to 64 characters.

Update a PhoneNumber's Inbound Processing Region configuration

update-a-phonenumbers-inbound-processing-region-configuration-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_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 = twilio(accountSid, authToken);
_14
_14
const phoneNumber = await client.routes.v2
_14
.phoneNumbers("+18001234567")
_14
.update({ voiceRegion: "au1" });
_14
_14
console.log(phoneNumber.voiceRegion);

Output

_10
{
_10
"phone_number": "+18001234567",
_10
"url": "https://routes.twilio.com/v2/PhoneNumbers/+18001234567",
_10
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "friendly_name",
_10
"voice_region": "au1",
_10
"date_created": "2015-07-30T20:00:00Z",
_10
"date_updated": "2015-07-30T20:00:00Z"
_10
}


Rate this page: