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

SIP Credential Resource


The Credential resource stores usernames and password information.


Username and Password

Each Username requires a corresponding password that meets the requirements in the Password parameter's description.

We don't store the passwords you provide in the credential records as cleartext. Instead, they are MD5 hashed in accordance with the digest authentication specification.


SIP Credential properties

Property nameTypePIIDescription
sidSID<CR>
Not PII

A 34 character string that uniquely identifies this resource.

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

account_sidSID<AC>

The unique id of the Account that is responsible for this resource.

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

credential_list_sidSID<CL>

The unique id that identifies the credential list that includes this credential.

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

usernamestring
PII MTL: 30 days

The username for this credential.


date_createdstring<date-time-rfc-2822>

date_updatedstring<date-time-rfc-2822>

The date that this resource was last updated, given as GMT in RFC 2822 format.


uristring

The URI for this resource, relative to https://api.twilio.com


Create a SIP Credential resource

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The unique id of the Account that is responsible for this resource.

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

CredentialListSidSID<CL>required

The unique id that identifies the credential list to include the created credential.

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

Request body parameters

Property nameTypeRequiredPIIDescription
Usernamestringrequired

The username that will be passed when authenticating SIP requests. The username should be sent in response to Twilio's challenge of the initial INVITE. It can be up to 32 characters long.


Passwordstringrequired

The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg IWasAtSignal2018)

Create a SIP Credential resource

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

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function createSipCredential() {
_21
const credential = await client.sip
_21
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_21
.credentials.create({
_21
password: "password",
_21
username: "username",
_21
});
_21
_21
console.log(credential.sid);
_21
}
_21
_21
createSipCredential();

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"credential_list_sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
_10
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
_10
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"username": "username"
_10
}


Fetch a SIP Credential resource

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The unique id of the Account that is responsible for this resource.

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

CredentialListSidSID<CL>required

The unique id that identifies the credential list that contains the desired credential.

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

SidSID<CR>required

The unique id that identifies the resource to fetch.

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

Fetch a SIP Credential resource

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

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function fetchSipCredential() {
_19
const credential = await client.sip
_19
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_19
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_19
.fetch();
_19
_19
console.log(credential.sid);
_19
}
_19
_19
fetchSipCredential();

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"credential_list_sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
_10
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
_10
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"username": "1440013725.28"
_10
}


Read multiple SIP Credential resources

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The unique id of the Account that is responsible for this resource.

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

CredentialListSidSID<CL>required

The unique id that identifies the credential list that contains the desired credentials.

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

Query parameters

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.

Read multiple SIP Credential resources

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

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listSipCredential() {
_18
const credentials = await client.sip
_18
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18
.credentials.list({ limit: 20 });
_18
_18
credentials.forEach((c) => console.log(c.sid));
_18
}
_18
_18
listSipCredential();

Output

_21
{
_21
"credentials": [
_21
{
_21
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"credential_list_sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
_21
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
_21
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_21
"username": "1440013725.28"
_21
}
_21
],
_21
"end": 0,
_21
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0",
_21
"next_page_uri": null,
_21
"page": 0,
_21
"page_size": 50,
_21
"previous_page_uri": null,
_21
"start": 0,
_21
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0"
_21
}


Update a SIP Credential resource

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json

The update action is used to update a user's password.

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The unique id of the Account that is responsible for this resource.

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

CredentialListSidSID<CL>required

The unique id that identifies the credential list that includes this credential.

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

SidSID<CR>required

The unique id that identifies the resource to update.

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

Request body parameters

Property nameTypeRequiredPIIDescription
PasswordstringOptional

The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg IWasAtSignal2018)

Update a SIP Credential resource

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

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function updateSipCredential() {
_19
const credential = await client.sip
_19
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_19
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_19
.update({ password: "password" });
_19
_19
console.log(credential.sid);
_19
}
_19
_19
updateSipCredential();

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"credential_list_sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
_10
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
_10
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"username": "username"
_10
}


Delete a SIP Credential resource

DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The unique id of the Account that is responsible for this resource.

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

CredentialListSidSID<CL>required

The unique id that identifies the credential list that contains the desired credentials.

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

SidSID<CR>required

The unique id that identifies the resource to delete.

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

Delete a SIP Credential resource

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

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_17
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = twilio(accountSid, authToken);
_17
_17
async function deleteSipCredential() {
_17
await client.sip
_17
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_17
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_17
.remove();
_17
}
_17
_17
deleteSipCredential();


Rate this page: