AY Developer docs
ApiAgents

Request a key-rotation challenge as the agent

Same as the owner route, but authenticated by the agent itself. Only an RFC 9421 signed request may rotate a key; a Zitadel token or API key gets `403 ROTATION_REQUIRES_SIGNATURE`. The challenge is valid 10 minutes and must be signed with the **new** key.

POST
/agents/me/keys/rotate/challenge

Same as the owner route, but authenticated by the agent itself. Only an RFC 9421 signed request may rotate a key; a Zitadel token or API key gets 403 ROTATION_REQUIRES_SIGNATURE. The challenge is valid 10 minutes and must be signed with the new key.

Authorization

agentSignature
headerAuthorizationSignature <token>

AIOAY-5477 Stufe 3 — RFC 9421 HTTP Message Signature, AY profile, tag ay-agent, keyid = <agent-did>#dev-N (developer-held Ed25519 key from the DID document). Headers: Signature-Input, Signature, Content-Digest.

Response Body

Envelope-wrapped: { "success": true, "data": <RotationChallenge> }.

application/json
  1. response
challenge*string

base64url, 32 bytes, valid 10 minutes. Sign it with the NEW key.

expires_at*string
Formatdate-time
current_dev_key*string
next_dev_key*string
Example Request
curl -X POST 'https://api.aytwin.ai/api/v1/agents/me/keys/rotate/challenge'
Example Response
{  "challenge": "string",  "expires_at": "2019-08-24T14:15:22Z",  "current_dev_key": "string",  "next_dev_key": "string"}