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

ConnectionPolicy Resource


The ConnectionPolicies resource describes a list of URI Entries that are used to route Origination traffic to a PSTN Carrier over a BYOC Trunk.


ConnectionPolicy Properties

connectionpolicy-properties page anchor
account_sidSID<AC>
Not PII

The SID of the Account(link takes you to an external page) that created the Connection Policy resource.

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

sidSID<NY>

The unique string that we created to identify the Connection Policy resource.

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

friendly_namestring

The string that you assigned to describe the resource.


date_createdstring<date-time>

The date and time in GMT when the resource was created specified in RFC 2822(link takes you to an external page) format.


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in RFC 2822(link takes you to an external page) format.


urlstring<uri>

The absolute URL of the resource.


linksobject<uri-map>

The URLs of related resources.


Create a ConnectionPolicy resource

create-a-connectionpolicy-resource page anchor
POST https://voice.twilio.com/v1/ConnectionPolicies

Request body parameters

request-body-parameters page anchor
FriendlyNamestring

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

Create a ConnectionPolicy

create-a-connectionpolicy page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_10
client.voice.v1.connectionPolicies
_10
.create()
_10
.then(connection_policy => console.log(connection_policy.sid));

Output

_11
{
_11
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"sid": "NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"friendly_name": "friendly_name",
_11
"date_created": "2020-03-18T23:31:36Z",
_11
"date_updated": "2020-03-18T23:31:36Z",
_11
"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"links": {
_11
"targets": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Targets"
_11
}
_11
}


Fetch a ConnectionPolicy resource

fetch-a-connectionpolicy-resource page anchor
GET https://voice.twilio.com/v1/ConnectionPolicies/{Sid}

SidSID<NY>required

The unique string that we created to identify the Connection Policy resource to fetch.

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

Fetch a ConnectionPolicy

fetch-a-connectionpolicy page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_10
client.voice.v1.connectionPolicies('NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(connection_policy => console.log(connection_policy.friendlyName));

Output

_11
{
_11
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"sid": "NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"friendly_name": "friendly_name",
_11
"date_created": "2020-03-18T23:31:36Z",
_11
"date_updated": "2020-03-18T23:31:37Z",
_11
"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"links": {
_11
"targets": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Targets"
_11
}
_11
}


Read multiple ConnectionPolicy resources

read-multiple-connectionpolicy-resources page anchor
GET https://voice.twilio.com/v1/ConnectionPolicies

PageSizeinteger

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

Pageinteger

The page index. This value is simply for client state.

Minimum: 0

PageTokenstring

The page token. This is provided by the API.

List multiple ConnectionPolicys

list-multiple-connectionpolicys page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_10
client.voice.v1.connectionPolicies
_10
.list({limit: 20})
_10
.then(connectionPolicies => connectionPolicies.forEach(c => console.log(c.sid)));

Output

_24
{
_24
"meta": {
_24
"page": 0,
_24
"page_size": 50,
_24
"first_page_url": "https://voice.twilio.com/v1/ConnectionPolicies?PageSize=50&Page=0",
_24
"previous_page_url": "https://voice.twilio.com/v1/ConnectionPolicies?PageSize=50&Page=0",
_24
"url": "https://voice.twilio.com/v1/ConnectionPolicies?PageSize=50&Page=0",
_24
"next_page_url": "https://voice.twilio.com/v1/ConnectionPolicies?PageSize=50&Page=1",
_24
"key": "connection_policies"
_24
},
_24
"connection_policies": [
_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"sid": "NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"friendly_name": "friendly_name",
_24
"date_created": "2020-03-18T23:31:36Z",
_24
"date_updated": "2020-03-18T23:31:37Z",
_24
"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"links": {
_24
"targets": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Targets"
_24
}
_24
}
_24
]
_24
}


Update a ConnectionPolicy resource

update-a-connectionpolicy-resource page anchor
POST https://voice.twilio.com/v1/ConnectionPolicies/{Sid}

SidSID<NY>required

The unique string that we created to identify the Connection Policy resource to update.

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

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

Update a ConnectionPolicy

update-a-connectionpolicy page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_10
client.voice.v1.connectionPolicies('NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({friendlyName: 'friendly_name'})
_10
.then(connection_policy => console.log(connection_policy.friendlyName));

Output

_11
{
_11
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"sid": "NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"friendly_name": "updated_name",
_11
"date_created": "2020-03-18T23:31:36Z",
_11
"date_updated": "2020-03-18T23:31:37Z",
_11
"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_11
"links": {
_11
"targets": "https://voice.twilio.com/v1/ConnectionPolicies/NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Targets"
_11
}
_11
}


Delete a ConnectionPolicy resource

delete-a-connectionpolicy-resource page anchor
DELETE https://voice.twilio.com/v1/ConnectionPolicies/{Sid}

SidSID<NY>required

The unique string that we created to identify the Connection Policy resource to delete.

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

Delete a ConnectionPolicy

delete-a-connectionpolicy page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_10
client.voice.v1.connectionPolicies('NYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.remove();


Rate this page: