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.
Changes to this resource may take up to 5 minutes to take effect.
A 34 character string that uniquely identifies the Inbound Processing Region assignments for this phone number.
^QQ[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A human readable description of the Inbound Processing Region assignments for this phone number, up to 64 characters.
The Inbound Processing Region used for this phone number for voice.
The date that this phone number was assigned an Inbound Processing Region, given in ISO 8601 format.
The date that the Inbound Processing Region was updated for this phone number, given in ISO 8601 format.
GET https://routes.twilio.com/v2/PhoneNumbers/{PhoneNumber}
The phone number in E.164 format
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchPhoneNumber() {11const phoneNumber = await client.routes.v212.phoneNumbers("+18001234567")13.fetch();1415console.log(phoneNumber.phoneNumber);16}1718fetchPhoneNumber();
1{2"phone_number": "+18001234567",3"url": "https://routes.twilio.com/v2/PhoneNumbers/+18001234567",4"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"friendly_name": "friendly_name",7"voice_region": "au1",8"date_created": "2015-07-30T20:00:00Z",9"date_updated": "2015-07-30T20:00:00Z"10}
POST https://routes.twilio.com/v2/PhoneNumbers/{PhoneNumber}
The phone number in E.164 format
application/x-www-form-urlencoded
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updatePhoneNumber() {11const phoneNumber = await client.routes.v212.phoneNumbers("+18001234567")13.update({ voiceRegion: "au1" });1415console.log(phoneNumber.voiceRegion);16}1718updatePhoneNumber();
1{2"phone_number": "+18001234567",3"url": "https://routes.twilio.com/v2/PhoneNumbers/+18001234567",4"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"friendly_name": "friendly_name",7"voice_region": "au1",8"date_created": "2015-07-30T20:00:00Z",9"date_updated": "2015-07-30T20:00:00Z"10}