With Twilio Proxy, you associate phone numbers and short codes (this resource) directly with a Proxy Service. All added numbers go into the Proxy Number Pool associated with a given Proxy Service. For more information on managing the phone numbers in your number pool, refer to our Phone Number Management guide.
A Twilio short code associated with a Proxy Service cannot be associated with other Proxy Services in the same account.
The unique string that we created to identify the ShortCode resource.
^SC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the ShortCode resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the ShortCode resource's parent Service resource.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The ISO 8601 date and time in GMT when the resource was created.
The ISO 8601 date and time in GMT when the resource was last updated.
The capabilities of the short code.
Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See Reserved Phone Numbers for more information.
POST https://proxy.twilio.com/v1/Services/{ServiceSid}/ShortCodes
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 createShortCode() {11const shortCode = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.shortCodes.create({ sid: "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" });1415console.log(shortCode.sid);16}1718createShortCode();
1{2"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"date_created": "2015-07-30T20:00:00Z",6"date_updated": "2015-07-30T20:00:00Z",7"short_code": "12345",8"iso_country": "US",9"capabilities": {10"sms_outbound": true,11"voice_inbound": false12},13"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"is_reserved": false15}
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/ShortCodes/{Sid}
The SID of the parent Service to fetch the resource from.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the ShortCode resource to fetch.
^SC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 fetchShortCode() {11const shortCode = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.fetch();1516console.log(shortCode.sid);17}1819fetchShortCode();
1{2"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"date_created": "2015-07-30T20:00:00Z",6"date_updated": "2015-07-30T20:00:00Z",7"short_code": "12345",8"iso_country": "US",9"capabilities": {10"sms_outbound": true,11"voice_inbound": false12},13"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"is_reserved": false15}
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/ShortCodes
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
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 listShortCode() {11const shortCodes = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.shortCodes.list({ limit: 20 });1415shortCodes.forEach((s) => console.log(s.sid));16}1718listShortCode();
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0",6"previous_page_url": null,7"next_page_url": null,8"key": "short_codes",9"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0"10},11"short_codes": [12{13"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",16"date_created": "2015-07-30T20:00:00Z",17"date_updated": "2015-07-30T20:00:00Z",18"short_code": "12345",19"iso_country": "US",20"capabilities": {21"sms_outbound": true,22"voice_inbound": false23},24"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"is_reserved": false26}27]28}
POST https://proxy.twilio.com/v1/Services/{ServiceSid}/ShortCodes/{Sid}
The SID of the parent Service of the resource to update.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the ShortCode resource to update.
^SC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See Reserved Phone Numbers for more information.
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 updateShortCode() {11const shortCode = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.update({ isReserved: false });1516console.log(shortCode.sid);17}1819updateShortCode();
1{2"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"date_created": "2015-07-30T20:00:00Z",6"date_updated": "2015-07-30T20:00:00Z",7"short_code": "12345",8"iso_country": "US",9"capabilities": {10"sms_outbound": true,11"voice_inbound": false12},13"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"is_reserved": false15}
DELETE https://proxy.twilio.com/v1/Services/{ServiceSid}/ShortCodes/{Sid}
The SID of the parent Service resource to delete the ShortCode resource from.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the ShortCode resource to delete.
^SC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 deleteShortCode() {11await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.remove();15}1617deleteShortCode();