Rotate API key
Replaces an existing credential with a new secret while preserving its project assignment and label. Update your deployment before invalidating the old value.
Authentication
Send a project-scoped NovaAI API key in the Authorization header using the Bearer scheme. Requests without valid credentials return 401 Unauthorized.
Authorization
string
required
Request properties
api_key_id
string
required
Identifier of the credential being rotated.
grace_period_seconds
integer
optional
Optional overlap period before the previous secret is invalidated.
reason
string
optional
Audit note explaining why the credential was rotated.
Response behavior
A successful PUT request returns a structured NovaAI resource response. Validate the returned identifier before persisting it, and handle 400 Bad Request for malformed input or 401 Unauthorized for invalid project credentials.
Integration notes
Use PUT /v1/api-keys/{api_key_id} from a trusted server environment. Keep your NovaAI API key out of browser bundles and pass only the data required for rotate api key in each request.
Validate inputs before sending the request, log the returned request identifier for troubleshooting, and use exponential backoff for temporary failures or rate-limit responses. Treat malformed payloads and authorization failures as non-retryable until corrected.
Error handling
Inspect the error type and code returned by NovaAI before retrying. Correct invalid parameters for 400 responses, refresh or replace credentials for 401 responses, and wait before retrying requests that are temporarily limited.