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
| Parameter | Type | Description |
|---|---|---|
id | string | Agent 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
| Field | Type | Description |
|---|---|---|
agentId | string | Agent UUID |
oldKey | string | Previous key (truncated for safety) |
newKey | string | New API key (full value) |
rotated_at | string | ISO 8601 timestamp |
Errors
| Status | Code | Description |
|---|---|---|
| 404 | NOT_FOUND | Agent not found |