APIAuth

Rotate an API key

Replace an API key's secret, keeping its name, permissions, and expiry.

POST
/api-keys/{key_id}/rotate

Replace an API key's secret, keeping its name, permissions, and expiry.

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

manage_api_keys

Path Parameters

key_id*string
Formatuuid

Response Body

The request has succeeded.

application/json
  1. response

A key together with its secret. The secret is shown only once.

key*

A credential for calling this API from your own application. The key carries its own permissions and can never do more than the person who created it.

token*string

The full API key. Copy it now; it cannot be retrieved later.

curl -X POST "https://example.com/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/rotate"
{  "key": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "permissions": [      "view_agents"    ],    "last_four": "string",    "expires_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z"  },  "token": "string"}