Sample - Twilio API
POST/2010-04-01/Accounts/{AccountSid}/Keys.json

Create an API key

Creates a new API Key for an account. Optionally provide FriendlyName to assign a descriptive label, and retain the returned secret because it is exposed only when the key is created.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
AccountSidstringrequired
The account SID that will own the new API Key, matching the 34-character `AC` SID format.

Optional form data for naming the new API Key.

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

1 status code
201Returns the created API Key with its SID, friendly name, creation and update timestamps, and the `secret` used as the basic-auth password. The `secret` is returned only during creation.
sidstringoptional
The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
friendly_namestringoptional
The string that you assigned to describe the resource.
date_createdstringoptional
The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
date_updatedstringoptional
The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
secretstringoptional
The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.**

Error handling

AccountSid must be a 34-character account SID beginning with AC. FriendlyName can contain no more than 64 characters when supplied.