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
Resource properties
account_sidtype: SID<AC>Not PII

sidtype: SID<NY>Not PII

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


friendly_nametype: stringNot PII

The string that you assigned to describe the resource.


date_createdtype: string<DATE TIME>Not PII

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


date_updatedtype: string<DATE TIME>Not PII

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


urltype: string<URI>Not PII

The absolute URL of the resource.


linkstype: object<URI MAP>Not PII

The URLs of related resources.


Create a ConnectionPolicy resource

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

Parameters

create-parameters page anchor
Request body parameters
FriendlyNametype: stringNot PII

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}

URI parameters
Sidtype: SID<NY>Not PII
Path Parameter

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

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

URI parameters
PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

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}

URI parameters
Sidtype: SID<NY>Not PII
Path Parameter

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


Request body parameters
FriendlyNametype: stringNot PII

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}

URI parameters
Sidtype: SID<NY>Not PII
Path Parameter

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

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: