Rotate API Key
POST {{endpoint}}/api-keys/:apiKey/rotate
When you create a new API key, you must specify a name
for the key, you can also specify custom properties for the key
Required properties:
-
name
string with a minimum length of 1 -
projectId
string
Optional properties:
-
customAccountId
string -
customUserId
string -
customMetaData
an object with any attributes, useful for storing additional information -
key
string, use this if you want to use a custom key value -
expiry
ISO 8601 string date (UTC timezone), represents the date the API key expire's at. After this date the API key will be deleted and you will not have access to it anymore (unless you reactivate it, check Reactivate API Key route for more info) -
rateLimitConfigs
object containing the rate limit options for this key-
rateLimit
number of allowed requests per ttl -
rateLimitTtl
number of seconds before consumed points are reset
-
Returns
-
201
if the key was created successfully -
401
if authentication fails -
403
if user has insufficient roles (users withuser
andadmin
roles can create an API key, users withviewer
role cannot)
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
x-api-key | string |
RESPONSES
status: Created
{"key":"live_2UUe7LenJXRfASNDAlWpT4hGkdkYAICfVqEz5hld9wYmCVyX0Wd6McxoPeurRLnY","name":"zapier-test-key-16:11","customMetaData":{},"customAccountId":null,"customUserId":null,"env":"live","createdAt":"2023-09-15T14:25:02.648Z","updatedAt":"2023-09-15T14:25:02.648Z","isActive":true,"expiresAt":null,"rateLimitConfigs":null,"creationContext":{}}