The ConnectionPolicyTarget
resource describes the individual URI entries that make up the BYOC Origination ConnectionPolicies list.
The SID of the Account that created the Target resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Connection Policy that owns the Target.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the Target resource.
^NE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SIP address you want Twilio to route your calls to. This must be a sip:
schema. sips
is NOT supported.
The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target.
0
The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority.
0
The date and time in GMT when the resource was created specified in RFC 2822 format.
The date and time in GMT when the resource was last updated specified in RFC 2822 format.
The absolute URL of the resource.
POST https://voice.twilio.com/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets
The SID of the Connection Policy that owns the Target.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
The SIP address you want Twilio to route your calls to. This must be a sip:
schema. sips
is NOT supported.
A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target.
The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority.
Whether the Target is enabled. The default is true
.
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 createConnectionPolicyTarget() {11const target = await client.voice.v112.connectionPolicies("NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.targets.create({ target: "https://www.example.com" });1415console.log(target.accountSid);16}1718createConnectionPolicyTarget();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"friendly_name": "friendly_name",6"target": "https://www.example.com",7"priority": 1,8"weight": 20,9"enabled": true,10"date_created": "2020-03-18T23:31:36Z",11"date_updated": "2020-03-18T23:31:36Z",12"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets/NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}
GET https://voice.twilio.com/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}
The SID of the Connection Policy that owns the Target.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the Target resource to fetch.
^NE[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 fetchConnectionPolicyTarget() {11const target = await client.voice.v112.connectionPolicies("NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.targets("NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.fetch();1516console.log(target.accountSid);17}1819fetchConnectionPolicyTarget();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"friendly_name": "friendly_name",6"target": "sip:sip-box.com:1234",7"priority": 1,8"weight": 20,9"enabled": true,10"date_created": "2020-03-18T23:31:36Z",11"date_updated": "2020-03-18T23:31:37Z",12"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets/NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}
GET https://voice.twilio.com/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets
The SID of the Connection Policy from which to read the Targets.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 listConnectionPolicyTarget() {11const targets = await client.voice.v112.connectionPolicies("NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.targets.list({ limit: 20 });1415targets.forEach((t) => console.log(t.accountSid));16}1718listConnectionPolicyTarget();
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets?PageSize=50&Page=0",6"previous_page_url": null,7"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets?PageSize=50&Page=0",8"next_page_url": null,9"key": "targets"10},11"targets": [12{13"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"sid": "NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",16"friendly_name": "friendly_name",17"target": "sip:sip-box.com:1234",18"priority": 1,19"weight": 20,20"enabled": true,21"date_created": "2020-03-18T23:31:36Z",22"date_updated": "2020-03-18T23:31:37Z",23"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets/NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"24}25]26}
POST https://voice.twilio.com/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}
The SID of the Connection Policy that owns the Target.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the Target resource to update.
^NE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
The SIP address you want Twilio to route your calls to. This must be a sip:
schema. sips
is NOT supported.
The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target.
The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority.
Whether the Target is enabled.
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 updateConnectionPolicyTarget() {11const target = await client.voice.v112.connectionPolicies("NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.targets("NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.update({ friendlyName: "FriendlyName" });1516console.log(target.accountSid);17}1819updateConnectionPolicyTarget();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"friendly_name": "FriendlyName",6"target": "sip:sip-updated.com:4321",7"priority": 2,8"weight": 10,9"enabled": false,10"date_created": "2020-03-18T23:31:36Z",11"date_updated": "2020-03-18T23:31:37Z",12"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets/NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}
DELETE https://voice.twilio.com/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}
The SID of the Connection Policy that owns the Target.
^NY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the Target resource to delete.
^NE[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 deleteConnectionPolicyTarget() {11await client.voice.v112.connectionPolicies("NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.targets("NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.remove();15}1617deleteConnectionPolicyTarget();