Skip to main content
POST
Rotate API Key
Rotation requires Prime UI consensus approval. If your key expires before approval is granted, rotation will fail and you will need to create a new key manually. We recommend rotating at least 24 hours before expiry.
For the full rotation workflow, decryption steps, and error reference, see the API Key Rotation guide.

Body

application/json
duration_seconds
integer<int64>

How long the old key remains active after the new key is approved, in seconds. Set to 0 for immediate expiry on approval. Cannot extend beyond the original key's expiry.

Example:

3600

Response

200 - application/json

A successful response.

encrypted_credentials
string

Base64-encoded encrypted payload containing the new API key credentials. Decrypt using your current secret_key with HKDF-SHA256 + AES-256-GCM.

activity_id
string

The Prime activity ID tracking the consensus approval for this rotation. Use with the Activities endpoints to monitor approval status.

Example:

"e8bbed13-fa33-41de-86d5-4335d8f08166"