[metadata]
article:modified_time: 2026-03-09T18:47:22.000Z
dcterms.modified: 2026-03-09T18:47:22.000Z
description: Full API reference for the API Key resource in the Twilio API. Learn how to create, fetch (get), read (list), and update API keys to authenticate to the REST API and create and revoke access tokens.
og:updated_time: 2026-03-09T18:47:22.000Z
viewport: width=device-width
x-twilio-docs-origin: otk
x-twilio-docs-source: primary

[canonical-links]
https://www.twilio.com/docs/iam/api-keys/key-resource-v2010

[document-links]
/Accounts/{SID}/Keys: /docs/iam/api-keys/key-resource-v2010
/Accounts: /docs/iam/api-keys/keys-in-console
/docs
/v1/Keys: /docs/iam/api-keys/key-resource-v1
API Keys Overview: /docs/iam/api-keys
Access Tokens: /docs/iam/access-tokens
Account OAuth Apps: /docs/iam/oauth-apps/account-oauth-apps
Account and Key Management with API Keys: /docs/iam/pkcv/account-and-key-management-api-keys
Account: /docs/iam/api/account
All docs...: /docs
Build with AI: /docs/ai
C#/.NET: /docs/iam/connect/quickstart/csharp
Connect your AI agent: /docs/ai/mcp
Conversations: /docs/conversations
Create API Keys in the Console: /docs/iam/api-keys/keys-in-console
Developer Hub: https://www.twilio.com/en-us/developers
Domains: /docs/iam/organizations/domains
Entra ID SCIM integration: /docs/iam/scim/entra-integration
FAQs: /docs/iam/oauth-apps/faqs
Flex: /docs/flex
Getting Started: /docs/iam/pkcv/quickstart
HIPAA Accounts: /docs/iam/twilio-editions/hippa
Help Center: https://help.twilio.com
Identity and Access Management (IAM): /docs/iam
Install Twilio Skills: /docs/ai/skills
Java: /docs/iam/connect/quickstart/java
Key resource v1: /docs/iam/api-keys/key-resource-v1
Log in: https://www.twilio.com/login
Managed Accounts: /docs/iam/organizations/managed-accounts
Managed Users: /docs/iam/organizations/managed-users
Messaging: /docs/messaging
Not PII: /docs/glossary/what-is-personally-identifiable-information-pii#fields-marked-not-pii
OAuth Token API: /docs/iam/oauth-apps/oauth-access-token
Okta SCIM integration: /docs/iam/scim/okta-integration
Open in ChatGPT: https://chatgpt.com/?hint=search&q=Read%20https%3A%2F%2Fwww.twilio.com%2Fdocs%2Fiam%2Fapi-keys%2Fkey-resource-v2010.md%20so%20I%20can%20ask%20questions%20about%20it
Open in Claude: https://claude.ai/new?q=Read%20https%3A%2F%2Fwww.twilio.com%2Fdocs%2Fiam%2Fapi-keys%2Fkey-resource-v2010.md%20so%20I%20can%20ask%20questions%20about%20it
Open in Cursor: https://cursor.com/link/prompt?text=Read%20https%3A%2F%2Fwww.twilio.com%2Fdocs%2Fiam%2Fapi-keys%2Fkey-resource-v2010.md%20so%20I%20can%20ask%20questions%20about%20it
Open in Perplexity: https://www.perplexity.ai/search?q=Read%20https%3A%2F%2Fwww.twilio.com%2Fdocs%2Fiam%2Fapi-keys%2Fkey-resource-v2010.md%20so%20I%20can%20ask%20questions%20about%20it
Organization OAuth Apps: /docs/iam/oauth-apps/org-oauth-apps
Organizations: /docs/iam/organizations
Overview: /docs/iam/access-control/overview
Overview: /docs/iam/api
Overview: /docs/iam/connect
Overview: /docs/iam/oauth-apps/overview
Overview: /docs/iam/pkcv
Overview: /docs/iam/single-sign-on
Overview: /docs/iam/twilio-editions
PHP: /docs/iam/connect/quickstart/php
PII MTL: 30 days: /docs/glossary/what-is-personally-identifiable-information-pii#pii-fields
Privacy Policy: /en-us/legal/privacy
Python: /docs/iam/connect/quickstart/python
RBAC in Legacy Console (Beta): /docs/iam/access-control/rbac-legacy-console
RBAC in Twilio Console: /docs/iam/access-control/rbac-twilio-console
REST API: Accounts Resource: /docs/iam/api/account
REST API: Auth Token: /docs/iam/api/authtoken
REST API: AuthorizedConnectApps Resource: /docs/iam/authorized-connect-apps/api
REST API: ConnectApps Resource: /docs/iam/connect-apps/api
REST API: CredentialAWS Resource: /docs/iam/credentialaws-resource
REST API: CredentialPublicKey Resource: /docs/iam/credentialpublickey-resource
REST API: Credentials: /docs/iam/credentials/api
REST API: Key Resource v1: /docs/iam/api-keys/key-resource-v1
REST API: Key Resource v2010: /docs/iam/api-keys/key-resource-v2010
REST API: Role Assignment Resource: /docs/iam/access-control/role-assignment-resource
REST API: Role Resource: /docs/iam/access-control/role-resource
REST API: Secondary Auth Token: /docs/iam/api/secondary_authtoken
RFC 2822: https://www.ietf.org/rfc/rfc2822.txt
Restricted API Keys: /docs/iam/api-keys/restricted-api-keys
Restricted API keys: /docs/iam/api-keys/restricted-api-keys
Ruby: /docs/iam/connect/quickstart/ruby
SCIM API overview: /docs/iam/scim
SCIM API reference: /docs/iam/scim/api-reference
SDKs: /docs/libraries
Sign up: https://www.twilio.com/try-twilio
Static Proxy for Webhooks: /docs/iam/twilio-editions/twilio-static-proxy
Studio: /docs/studio
Subaccounts: /docs/iam/api/subaccounts
Terms of service: /en-us/legal/tos
Test Credentials: /docs/iam/test-credentials
Twilio Console: https://www.twilio.com/console/runtime/api-keys/create
Twilio Docs: /docs
Twilio tag: https://stackoverflow.com/questions/tagged/twilio
Types of Roles: /docs/iam/access-control/types-of-roles
Video: /docs/video
View as markdown: /docs/iam/api-keys/key-resource-v2010.md
Voice: /docs/voice
authenticate to Twilio's REST API: /docs/usage/requests-to-twilio
fetch a Key resource endpoint: /docs/iam/api-keys/key-resource-v2010#fetch-a-key-resource
paging information: /docs/usage/twilios-response#pagination
support team: https://help.twilio.com

[structured-data]
{"@context":"https://schema.org","@id":"https://www.twilio.com/docs/iam/api-keys/key-resource-v2010#article","@type":"TechArticle","author":{"@type":"Organization","name":"Twilio Developer Education Team"},"dateModified":"2026-03-09T18:47:22.000Z","description":"Full API reference for the API Key resource in the Twilio API. Learn how to create, fetch (get), read (list), and update API keys to authenticate to the REST API and create and revoke access tokens.","headline":"REST API: Key Resource v2010","inLanguage":"en","publisher":{"@type":"Organization","name":"Twilio"},"url":"https://www.twilio.com/docs/iam/api-keys/key-resource-v2010"}

[content]
REST API: Key Resource v2010 | Twilio
Skip to content
Skip to navigation
Skip to topbar
Twilio Docs
Identity and Access Management (IAM)
Getting Started
Overview
Test Credentials
REST API: Auth Token
REST API: Secondary Auth Token
Accounts
REST API: Accounts Resource
Subaccounts
Organizations
Organizations
Managed Accounts
Managed Users
Domains
SCIM API
SCIM API overview
Okta SCIM integration
Entra ID SCIM integration
SCIM API reference
Keys and Tokens
API Keys Overview
Create API Keys in the Console
REST API: Key Resource v1
REST API: Key Resource v2010
Restricted API Keys
Access Tokens
OAuth Apps
Overview
Account OAuth Apps
Organization OAuth Apps
OAuth Token API
FAQs
Credentials
REST API: Credentials
REST API: CredentialPublicKey Resource
REST API: CredentialAWS Resource
Public Key Client Validation
Overview
Getting Started
Account and Key Management with API Keys
Access Control
Overview
RBAC in Twilio Console
RBAC in Legacy Console (Beta)
Types of Roles
REST API: Role Assignment Resource
REST API: Role Resource
Single Sign-On
Overview
Twilio Editions
Overview
HIPAA Accounts
Static Proxy for Webhooks
Twilio Connect
Overview
REST API: ConnectApps Resource
REST API: AuthorizedConnectApps Resource
Quickstarts
C#/.NET
Java
PHP
Python
Ruby
Twilio Docs
Search
Search
Messaging
Voice
Video
Conversations
Flex
Studio
All docs...
Build with AI
SDKs
Help Center
Search
Log in
Sign up
Page tools
Copy as markdown
Useful for sharing or LLM
Copy and view
Copy as markdown
View as markdown
Open in assistant
Open in ChatGPT
Open in Claude
Open in Cursor
Open in Perplexity
Build with AI
Connect your AI agent
Install Twilio Skills
Accelerate development with AI
On this page
Types of keys
Key Properties
Create an API key
Path parameters
Request body parameters
Fetch a Key resource
Path parameters
List Key resources
Path parameters
Query parameters
Update a Key resource
Path parameters
Request body parameters
Delete a Key Resource
Path parameters
Looking for more inspiration?
Visit the
Developer Hub
On this page
Types of keys
Key Properties
Create an API key
Path parameters
Request body parameters
Fetch a Key resource
Path parameters
List Key resources
Path parameters
Query parameters
Update a Key resource
Path parameters
Request body parameters
Delete a Key Resource
Path parameters
Copy as markdown
Copy and view
Copy as markdown
View as markdown
Open in assistant
Open in ChatGPT
Open in Claude
Open in Cursor
Open in Perplexity
Build with AI
Connect your AI agent
Install Twilio Skills
REST API: Key Resource v2010
(warning)
Key resource v2010 limitations
The Key resource v2010 doesn't support creating
Restricted API keys
. The latest version of the Key resource
Key resource v1
. The Key resource v1 supports all the features of Key resource v2010 and adds the ability to create Restricted API keys.
Use the Key resource to create and manage Standard API keys.
API keys represent the required credentials that you'll use to
authenticate to Twilio's REST API
and to create and revoke
Access Tokens
.
(information)
Info
If your API key requires access to the Accounts (
/Accounts
) or Keys (
/Accounts/{SID}/Keys
,
/v1/Keys
) endpoints, then you'll need to use a Main key. You can create Main keys only in the
Twilio Console
.
Types of keys
The API key types are
Main
,
Standard
, and
Restricted
(Key resource v1 only). The following table describes each type:
Key type
Access permissions
Create in Console
Create with REST API
Main
Full access to all Twilio API resources. Equivalent to using your Account SID and Auth Token for API requests.
Yes
No
Standard
Access to all Twilio API resources, except for Accounts (
/Accounts
) or Keys (
/Accounts/{SID}/Keys
,
/v1/Keys
) resources.
Yes
Yes
Restricted
Customized, fine-grained access to specific Twilio API resources. Learn more about
Restricted API keys
.
Yes
Yes (
v1 only
)
Key Properties
Property name
Type
Required
PII
Description
Child properties
end
integer
Optional
Not PII
firstPageUri
string<uri>
Optional
Not PII
nextPageUri
string<uri>
Optional
Not PII
page
integer
Optional
Not PII
pageSize
integer
Optional
Not PII
previousPageUri
string<uri>
Optional
Not PII
start
integer
Optional
Not PII
uri
string<uri>
Optional
Not PII
keys
array[object]
Optional
Not PII
Show keys properties
Property name
Type
Required
PII
Description
Child properties
sid
SID<SK>
Optional
Not PII
The unique string that that we created to identify the Key resource.
Pattern:
^SK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
friendlyName
string
Optional
PII MTL: 30 days
The string that you assigned to describe the resource.
dateCreated
string<date-time-rfc-2822>
Optional
Not PII
The date and time in GMT that the resource was created specified in
RFC 2822
format.
dateUpdated
string<date-time-rfc-2822>
Optional
Not PII
The date and time in GMT that the resource was last updated specified in
RFC 2822
format.
Create an API key
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Keys.json
(warning)
Warning
To create Standard API keys with the API, you must use one of the following credentials: your Account SID and Auth Token, a Main API key, or a Restricted API key with the permission for
/twilio/iam/api-keys/create
.
Path parameters
Property name
Type
Required
PII
Description
accountSid
SID<AC>
required
Not PII
The SID of the
Account
that will be responsible for the new Key resource.
Pattern:
^AC[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Request body parameters
Encoding type:
application/x-www-form-urlencoded
Schema
Example
Property name
Type
Required
PII
Description
Child properties
friendlyName
string
Optional
PII MTL: 30 days
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
Copy code block
{
"FriendlyName"
:
"foo"
}
The response contains a
sid
property and a
secret
property. Store the
secret
in a secure location, because you won't be able to retrieve it again. Twilio uses the Key resource's
sid
and the
secret
as the credentials when making API requests.
Create an API key
.css-1raivgc{box-sizing:border-box;background-color:inherit;color:inherit;font-family:inherit;line-height:1.75rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.25rem;}
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
Report code block
Copy code block
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
createNewKey
() {
11
const
newKey
= await
client.newKeys.
create
({
12
friendlyName:
"Mario's API key"
,
13
});
14
15
console.
log
(newKey.sid);
16
}
17
18
createNewKey
();
Response
Copy response
1
{
2
"sid"
:
"SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
,
3
"friendly_name"
:
"Mario's API key"
,
4
"date_created"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
,
5
"date_updated"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
,
6
"secret"
:
"foobar"
7
}
Fetch a Key resource
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json
Returns a representation of the API key.
(warning)
Warning
For security reasons, Twilio returns the
secret
field only when the API key is first created and never includes the
secret
field when you fetch the resource. Your application should store the API key's SID and secret in a secure location to authenticate to the API.
Path parameters
Property name
Type
Required
PII
Description
accountSid
SID<AC>
required
Not PII
The SID of the
Account
that created the Key resource to fetch.
Pattern:
^AC[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
sid
SID<SK>
required
Not PII
The Twilio-provided string that uniquely identifies the Key resource to fetch.
Pattern:
^SK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Fetch an API key
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
Report code block
Copy code block
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
fetchKey
() {
11
const
key
= await
client.
keys
(
"SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
).
fetch
();
12
13
console.
log
(key.sid);
14
}
15
16
fetchKey
();
Response
Copy response
1
{
2
"sid"
:
"SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
,
3
"friendly_name"
:
"foo"
,
4
"date_created"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
,
5
"date_updated"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
6
}
List Key resources
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Keys.json
Returns a list of API keys associated with a given Account, sorted by
DateUpdated
.
The list includes all API keys and
paging information
.
Path parameters
Property name
Type
Required
PII
Description
accountSid
SID<AC>
required
Not PII
The SID of the
Account
that created the Key resources to read.
Pattern:
^AC[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Query parameters
Property name
Type
Required
PII
Description
pageSize
integer<int64>
Optional
Not PII
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum:
1
Maximum:
1000
page
integer
Optional
Not PII
The page index. This value is simply for client state.
Minimum:
0
pageToken
string
Optional
Not PII
The page token. This is provided by the API.
Read a Key resource
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
Report code block
Copy code block
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
listKey
() {
11
const
keys
= await
client.keys.
list
({ limit:
20
});
12
13
keys.
forEach
((
k
)
=>
console.
log
(k.end));
14
}
15
16
listKey
();
Response
Copy response
1
{
2
"keys"
: [
3
{
4
"sid"
:
"SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
,
5
"friendly_name"
:
"foo"
,
6
"date_created"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
,
7
"date_updated"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
8
}
9
],
10
"first_page_uri"
:
"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0"
,
11
"end"
:
0
,
12
"previous_page_uri"
:
null
,
13
"uri"
:
"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0"
,
14
"page_size"
:
50
,
15
"start"
:
0
,
16
"next_page_uri"
:
null
,
17
"page"
:
0
18
}
Update a Key resource
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json
Attempts to update the fields of an API Key resource.
If successful, Twilio returns the updated resource representation. The response is identical to that of the
fetch a Key resource endpoint
.
Path parameters
Property name
Type
Required
PII
Description
accountSid
SID<AC>
required
Not PII
The SID of the
Account
that created the Key resources to update.
Pattern:
^AC[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
sid
SID<SK>
required
Not PII
The Twilio-provided string that uniquely identifies the Key resource to update.
Pattern:
^SK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Request body parameters
Encoding type:
application/x-www-form-urlencoded
Schema
Example
Property name
Type
Required
PII
Description
Child properties
friendlyName
string
Optional
PII MTL: 30 days
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
Copy code block
{
"FriendlyName"
:
"foo"
}
Update a Key resource
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
Report code block
Copy code block
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
updateKey
() {
11
const
key
= await
client
12
.
keys
(
"SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
)
13
.
update
({ friendlyName:
"friendly_name"
});
14
15
console.
log
(key.sid);
16
}
17
18
updateKey
();
Response
Copy response
1
{
2
"sid"
:
"SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
,
3
"friendly_name"
:
"friendly_name"
,
4
"date_created"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
,
5
"date_updated"
:
"Mon, 13 Jun 2016 22:50:08 +0000"
6
}
Delete a Key Resource
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json
Deletes an API key. Deleting an API key revokes the authorization to authenticate to the REST API and invalidates all Access Tokens generated using the API key's secret.
If the deletion is successful, Twilio returns an HTTP 204 response with no body.
(warning)
Warning
You may only delete keys by authenticating with the account's
AccountSid
and
AuthToken
or API keys that have the Main key flag set in the console.
Path parameters
Property name
Type
Required
PII
Description
accountSid
SID<AC>
required
Not PII
The SID of the
Account
that created the Key resources to delete.
Pattern:
^AC[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
sid
SID<SK>
required
Not PII
The Twilio-provided string that uniquely identifies the Key resource to delete.
Pattern:
^SK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Delete a Key resource
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
Report code block
Copy code block
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
deleteKey
() {
11
await
client.
keys
(
"SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
).
remove
();
12
}
13
14
deleteKey
();
Need some help?
We all do sometimes; code is hard. Get help now from our
support team
, or lean on the wisdom of the crowd by browsing the
Twilio tag
on Stack Overflow.
Terms of service
Privacy Policy
Copyright © 2026 Twilio Inc.
