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
Resource properties
sidtype: SID<CR>Not PII

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


friendly_nametype: stringPII MTL: 0 days

The string that you assigned to describe the resource.


date_createdtype: string<DATE TIME>Not PII

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


date_updatedtype: string<DATE TIME>Not PII

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


urltype: string<URI>Not PII

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

Parameters

create-parameters page anchor
Request body parameters
PublicKeytype: stringNot PII
Required

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


FriendlyNametype: stringPII MTL: 0 days

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


AccountSidtype: SID<AC>Not PII

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

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}

URI parameters
Sidtype: SID<CR>Not PII
Path Parameter

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

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

URI parameters
PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

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

_12
{
_12
"credentials": [],
_12
"meta": {
_12
"first_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0",
_12
"key": "credentials",
_12
"next_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=1",
_12
"page": 0,
_12
"page_size": 50,
_12
"previous_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0",
_12
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0"
_12
}
_12
}


Update a CredentialPublicKey resource

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

URI parameters
Sidtype: SID<CR>Not PII
Path Parameter

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


Request body parameters
FriendlyNametype: stringPII MTL: 0 days

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}

URI parameters
Sidtype: SID<CR>Not PII
Path Parameter

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

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: