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

CredentialPublicKey Resource



Resource URI

resource-uri page anchor

_10
/Credentials/PublicKeys/


CredentialPublicKey Properties

credentialpublickey-properties page anchor
sidSID<CR>
Not PII

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

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

account_sidSID<AC>

The SID of the Account(link takes you to an external page) that created the Credential that the PublicKey resource belongs to.

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

friendly_namestring
PII MTL: 0 days

The string that you assigned to describe the resource.


date_createdstring<date-time>

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


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 URI for this resource, relative to https://accounts.twilio.com


Create a CredentialPublicKey resource

create-a-credentialpublickey-resource page anchor
POST https://accounts.twilio.com/v1/Credentials/PublicKeys

Request body parameters

request-body-parameters page anchor
PublicKeystringrequired

A URL encoded representation of the public key. For example, -----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----


FriendlyNamestring

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


AccountSidSID<AC>

The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request

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

Create a Public Key

create-a-public-key page anchor
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.accounts.v1.credentials
_11
.publicKey
_11
.create({publicKey: 'publickey'})
_11
.then(public_key => console.log(public_key.sid));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2015-07-31T04:00:00Z",
_10
"date_updated": "2015-07-31T04:00:00Z",
_10
"friendly_name": "friendly_name",
_10
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}


Fetch a CredentialPublicKey resource

fetch-a-credentialpublickey-resource page anchor
GET https://accounts.twilio.com/v1/Credentials/PublicKeys/{Sid}

SidSID<CR>required

The Twilio-provided string that uniquely identifies the PublicKey resource to fetch.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34
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.accounts.v1.credentials
_11
.publicKey('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(public_key => console.log(public_key.friendlyName));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2015-07-31T04:00:00Z",
_10
"date_updated": "2015-07-31T04:00:00Z",
_10
"friendly_name": "friendly_name",
_10
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}


Read multiple CredentialPublicKey resources

read-multiple-credentialpublickey-resources page anchor
GET https://accounts.twilio.com/v1/Credentials/PublicKeys

PageSizeinteger

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

Minimum: 1Maximum: 1000

Pageinteger

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

Minimum: 0

PageTokenstring

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.accounts.v1.credentials
_11
.publicKey
_11
.list({limit: 20})
_11
.then(publicKey => publicKey.forEach(p => console.log(p.sid)));

Output

_21
{
_21
"credentials": [
_21
{
_21
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"date_created": "2015-07-31T04:00:00Z",
_21
"date_updated": "2015-07-31T04:00:00Z",
_21
"friendly_name": "friendly_name",
_21
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_21
}
_21
],
_21
"meta": {
_21
"first_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0",
_21
"key": "credentials",
_21
"next_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=1",
_21
"page": 0,
_21
"page_size": 50,
_21
"previous_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0",
_21
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0"
_21
}
_21
}


Update a CredentialPublicKey resource

update-a-credentialpublickey-resource page anchor
POST https://accounts.twilio.com/v1/Credentials/PublicKeys/{Sid}

SidSID<CR>required

The Twilio-provided string that uniquely identifies the PublicKey resource to update.

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

A descriptive string that you create to describe the resource. It can be up to 64 characters long.

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.accounts.v1.credentials
_11
.publicKey('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.update({friendlyName: 'friendly_name'})
_11
.then(public_key => console.log(public_key.friendlyName));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2015-07-31T04:00:00Z",
_10
"date_updated": "2015-07-31T04:00:00Z",
_10
"friendly_name": "friendly_name",
_10
"sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}


Delete a CredentialPublicKey resource

delete-a-credentialpublickey-resource page anchor
DELETE https://accounts.twilio.com/v1/Credentials/PublicKeys/{Sid}

SidSID<CR>required

The Twilio-provided string that uniquely identifies the PublicKey resource to delete.

Pattern: ^CR[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.accounts.v1.credentials
_10
.publicKey('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.remove();


Rate this page: