Use this endpoint to rotate an agent’s API key. It atomically revokes all currently active keys for the specified agent and issues a single fresh key with a new 30-day expiry. Rotate keys on a regular schedule or immediately if you suspect a key has been compromised. After rotation, update any service or environment that was using the old key — existing sessions started with a revoked key will continue to function until their session JWTs expire, but no new sessions can be created with the old key.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Vedant-Jayesh-Oza/otas/llms.txt
Use this file to discover all available pages before exploring further.
Only users with Admin privilege (privilege=1) on the project can create or rotate keys.
Endpoint
http://localhost:8000
Request headers
JWT obtained from the OTAS login endpoint, identifying the calling user.
UUID of the project the agent belongs to.
Request body
UUID of the agent for which to rotate the key.
Response
1 on success."agent_key_created" on success.Revoking a specific key without rotation
If you need to revoke a single key without issuing a replacement, use:X-OTAS-USER-TOKEN and X-OTAS-PROJECT-ID headers and Admin privilege. It sets the key as inactive immediately without creating a new key.
Errors
| Status | status_description | Cause |
|---|---|---|
| 403 | forbidden | Caller does not have Admin privilege on the project. |
| 404 | agent_not_found_or_invalid_id | No active agent with that UUID exists in the project, or the UUID is malformed. |
| 400 | agent_id_required | The agent_id field was missing from the request body. |
Example
cURL
Response (201)