SIP Credential Resource
On this reference page, you'll learn about the properties, parameters, and methods available for the SIP Credential resource. See Related how-to documentation to learn the steps to use the info on this page.
The Credential resource stores usernames and password information.
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.
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json
The unique id of the Account that is responsible for this resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the credential list to include the created credential.
^CL[0-9a-fA-F]{32}$Min length: 34Max length: 34application/x-www-form-urlencodedThe 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.
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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createSipCredential() {14const credential = await client.sip15.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.credentials.create({17password: "password",18username: "username",19});2021console.log(credential.sid);22}2324createSipCredential();
Response
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}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json
The unique id of the Account that is responsible for this resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the credential list that contains the desired credential.
^CL[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the resource to fetch.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 341// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchSipCredential() {14const credential = await client.sip15.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")17.fetch();1819console.log(credential.sid);20}2122fetchSipCredential();
Response
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}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json
The unique id of the Account that is responsible for this resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the credential list that contains the desired credentials.
^CL[0-9a-fA-F]{32}$Min length: 34Max length: 34How many resources to return in each list page. The default is 50, and the maximum is 1000.
1Maximum: 1000The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function listSipCredential() {14const credentials = await client.sip15.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.credentials.list({ limit: 20 });1718credentials.forEach((c) => console.log(c.end));19}2021listSipCredential();
Response
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}
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.
The unique id of the Account that is responsible for this resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the credential list that includes this credential.
^CL[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the resource to update.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34application/x-www-form-urlencodedThe 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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function updateSipCredential() {14const credential = await client.sip15.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")17.update({ password: "password" });1819console.log(credential.sid);20}2122updateSipCredential();
Response
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 https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json
The unique id of the Account that is responsible for this resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the credential list that contains the desired credentials.
^CL[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique id that identifies the resource to delete.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 341// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function deleteSipCredential() {14await client.sip15.credentialLists("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")17.remove();18}1920deleteSipCredential();