Herald
OpenapiApi keys

Rotate an API Key

Generates a new key for the API key, replacing the old hash. The old key is immediately invalidated. Returns the new plaintext key (shown once).

POST
/api/api-keys/{apiKeyId}/rotate

Generates a new key for the API key, replacing the old hash. The old key is immediately invalidated. Returns the new plaintext key (shown once).

Path Parameters

apiKeyId*string

API Key ID

Response Body

API Key rotated

application/json
  1. response

Response after creating an API Key (plaintext key shown once)

clientAppEnabled*boolean

Whether the bound Client App is enabled — false means the key cannot authenticate until a realm admin re-enables the app.

clientAppId?|

Client App this API key is bound to

Formatuuid
clientAppName?|

Client App display name

createdAt*string

Creation time (ISO 8601)

enabled*boolean

Whether the API key is enabled

expiresAt?|

Optional expiration time (ISO 8601)

id*string

API Key UUID

key*string

Plaintext API key (shown only once, store securely)

name*string

Human-readable name

realmId*string

Realm this API key belongs to

roleBindingError?|

Role binding failure after the key was created. The plaintext key is still returned so the caller never loses the one-time secret.

Example Request
curl -X POST 'https://example.com/api/api-keys/string/rotate'
Example Response
{
  "clientAppEnabled": true,
  "clientAppId": "d386372c-64d9-49da-bb8b-4b5eda60f56c",
  "clientAppName": "string",
  "createdAt": "string",
  "enabled": true,
  "expiresAt": "string",
  "id": "string",
  "key": "string",
  "name": "string",
  "realmId": "string",
  "roleBindingError": "string"
}