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

username-and-password page anchor

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

sip-credential-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<CR>Optional
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>Optional

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>Optional

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

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

usernamestringOptional
PII MTL: 30 days

The username for this credential.


date_updatedstring<date-time-rfc-2822>Optional

The date that this resource was last updated, given as GMT in RFC 2822(link takes you to an external page) format.


uristringOptional

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


Create a SIP Credential resource

create-a-sip-credential-resource page anchor
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json

Path parameters

path-parameters page anchor
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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
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 resourceLink to code sample: Create a SIP Credential resource
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createSipCredential() {
11
const credential = await client.sip
12
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.credentials.create({
14
password: "password",
15
username: "username",
16
});
17
18
console.log(credential.sid);
19
}
20
21
createSipCredential();

Output

1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"credential_list_sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
4
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
5
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
6
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
8
"username": "username"
9
}

Fetch a SIP Credential resource

fetch-a-sip-credential-resource page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json

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
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchSipCredential() {
11
const credential = await client.sip
12
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.fetch();
15
16
console.log(credential.sid);
17
}
18
19
fetchSipCredential();

Output

1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"credential_list_sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
4
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
5
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
6
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
7
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
8
"username": "1440013725.28"
9
}

Read multiple SIP Credential resources

read-multiple-sip-credential-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json

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
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.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listSipCredential() {
11
const credentials = await client.sip
12
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.credentials.list({ limit: 20 });
14
15
credentials.forEach((c) => console.log(c.sid));
16
}
17
18
listSipCredential();

Output

1
{
2
"credentials": [
3
{
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"credential_list_sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
7
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
8
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
10
"username": "1440013725.28"
11
}
12
],
13
"end": 0,
14
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0",
15
"next_page_uri": null,
16
"page": 0,
17
"page_size": 50,
18
"previous_page_uri": null,
19
"start": 0,
20
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0"
21
}

Update a SIP Credential resource

update-a-sip-credential-resource page anchor
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.

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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
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)

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateSipCredential() {
11
const credential = await client.sip
12
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.update({ password: "password" });
15
16
console.log(credential.sid);
17
}
18
19
updateSipCredential();

Output

1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"credential_list_sid": "CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
4
"date_created": "Wed, 19 Aug 2015 19:48:45 +0000",
5
"date_updated": "Wed, 19 Aug 2015 19:48:45 +0000",
6
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
7
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
8
"username": "username"
9
}

Delete a SIP Credential resource

delete-a-sip-credential-resource page anchor
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json

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
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteSipCredential() {
11
await client.sip
12
.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
14
.remove();
15
}
16
17
deleteSipCredential();

Rate this page: