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

CredentialList Resource


The Credential Lists subresource represents the Credential List instances associated with this Trunk. If an INVITE is received for a domain with a Credential List, Twilio will challenge the request. Your system will need to authenticate with a username and password. The username and password must be in one of the Credential Lists for the INVITE to be accepted.

This API will only allow you to list, add, and remove the Credential Lists associated with your Trunk. To create, remove, or list the Credential Lists in your account, check out the Credential List reference docs.


CredentialList Properties

credentiallist-properties page anchor
Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the CredentialList resource.

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

sidSID<CL>

The unique string that we created to identify the CredentialList resource.

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

trunk_sidSID<TK>

The SID of the Trunk the credential list in associated with.

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

friendly_namestring

The string that you assigned to describe the resource.


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.


Create a CredentialList resource

create-a-credentiallist-resource page anchor
POST https://trunking.twilio.com/v1/Trunks/{TrunkSid}/CredentialLists

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
TrunkSidSID<TK>required

The SID of the Trunk to associate the credential list with.

Pattern: ^TK[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
CredentialListSidSID<CL>required

The SID of the Credential List that you want to associate with the trunk. Once associated, we will authenticate access to the trunk against this list.

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

Create Credential List

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

_13
// Download the helper library from https://www.twilio.com/docs/node/install
_13
// Find your Account SID and Auth Token at twilio.com/console
_13
// and set the environment variables. See http://twil.io/secure
_13
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13
const authToken = process.env.TWILIO_AUTH_TOKEN;
_13
const client = require('twilio')(accountSid, authToken);
_13
_13
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13
.credentialsLists
_13
.create({
_13
credentialListSid: 'CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
_13
})
_13
.then(credential_list => console.log(credential_list.sid));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2018-05-02T17:29:30Z",
_10
"date_updated": "2018-05-02T17:29:30Z",
_10
"friendly_name": "friendly_name",
_10
"sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialLists/CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}


Read multiple CredentialList resources

read-multiple-credentiallist-resources page anchor
GET https://trunking.twilio.com/v1/Trunks/{TrunkSid}/CredentialLists

Property nameTypeRequiredPIIDescription
TrunkSidSID<TK>required

The SID of the Trunk from which to read the credential lists.

Pattern: ^TK[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

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

Minimum: 1Maximum: 1000

PageintegerOptional

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

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.credentialsLists
_11
.list({limit: 20})
_11
.then(credentialsLists => credentialsLists.forEach(c => console.log(c.sid)));

Output

_22
{
_22
"credential_lists": [
_22
{
_22
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"date_created": "2018-04-27T22:02:11Z",
_22
"date_updated": "2018-04-27T22:02:11Z",
_22
"friendly_name": "friendly_name",
_22
"sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialLists/CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_22
}
_22
],
_22
"meta": {
_22
"page": 0,
_22
"page_size": 50,
_22
"first_page_url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialLists?PageSize=50&Page=0",
_22
"previous_page_url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialLists?PageSize=50&Page=0",
_22
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialLists?PageSize=50&Page=0",
_22
"next_page_url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/CredentialLists?PageSize=50&Page=1",
_22
"key": "credential_lists"
_22
}
_22
}


Delete a CredentialList resource

delete-a-credentiallist-resource page anchor
DELETE https://trunking.twilio.com/v1/Trunks/{TrunkSid}/CredentialLists/{Sid}

Property nameTypeRequiredPIIDescription
TrunkSidSID<TK>required

The SID of the Trunk from which to delete the credential list.

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

SidSID<CL>required

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

Pattern: ^CL[0-9a-fA-F]{32}$Min length: 34Max length: 34
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.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.credentialsLists('CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.remove();


Rate this page: