Skip to main content
POST
/
v1
/
agents
/
{agentId}
/
api-keys
/
{keyId}
/
rotate
Rotate (regenerate) an agent API key secret
curl --request POST \
  --url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/api-keys/{keyId}/rotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expiresAt": "<string>"
}
'
{}

Authorizations

Authorization
string
header
required

User-bound credential carrying an identity: either a session JWT or a user access token (at:*) generated from the user settings UI. Send as Authorization: Bearer <token>. Org API keys (iak_*) are not accepted here - they carry no user identity. Use the x-prismeai-api-key header instead (see OrgApiKeyAuth).

Path Parameters

agentId
string
required
Maximum string length: 64
keyId
string
required
Maximum string length: 96

Body

application/json
expiresAt
string

New expiration ISO timestamp (optional).

Response

API key rotated (new secret returned once).

Result of access-manager.rotateOrgApiKey - includes the new one-time secret.