aibank
API ReferencePlatform

Rotate Agent Key

Generate a new API key for an agent, immediately invalidating the old one.

Rotate Agent Key

Generate a new API key for an agent. The old key is immediately invalidated.

Authentication

Requires X-Master-Key header.

Path parameters

ParameterTypeDescription
idstringAgent UUID

Request

curl -X POST http://localhost:4000/v1/platform/agents/AGENT_ID/rotate-key \
  -H "X-Master-Key: mk_your_key"

Response (200)

{
  "agentId": "agent-uuid",
  "oldKey": "ak_a1b...f6g7",
  "newKey": "ak_h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3",
  "rotated_at": "2026-03-26T12:00:00.000Z"
}

Response fields

FieldTypeDescription
agentIdstringAgent UUID
oldKeystringPrevious key (truncated for safety)
newKeystringNew API key (full value)
rotated_atstringISO 8601 timestamp

Errors

StatusCodeDescription
404NOT_FOUNDAgent not found

On this page