POST/org/api_keys/{id}/rotate

Rotate an API key. Issues a new key that copies the name and project of the rotated key, and schedules the rotated key to expire after a grace period so in-flight callers can swap over. The new plaintext key is returned once.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

API key ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/org/api_keys/string/rotate" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "created_at": "2019-08-24T14:15:22Z",  "created_by": {    "id": "string",    "email": "user@example.com",    "name": "string"  },  "expires_at": "2019-08-24T14:15:22Z",  "deleted_at": "2019-08-24T14:15:22Z",  "project_id": "string",  "project_name": "string",  "masked_key": "string",  "key": "string"}