Rotate

POST /v1/rotate

Rotates the agent's badge — generates a new ED25519 keypair, issues a new badge and DID, and permanently invalidates the old badge.

Use rotation to replace a badge that may have been compromised, or as a periodic key hygiene measure.

Auth: Authorization: Bearer AND badge in request body (both required)

Timeout: 30 seconds

Warning: Your old badge stops working immediately. Update all services that use it to the new_badge before making this call.

Request

curl -X POST https://identity.sentryagent.ai/v1/rotate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJFZERTQSIs..." \
  -d '{ "badge": "eyJhbGciOiJFZERTQSIs..." }'

Response

{
  "new_badge": "eyJhbGciOiJFZERTQSIs...-new",
  "new_did": "did:sentryagent:xyz789",
  "rotated_at": "2026-06-01T10:05:00.000Z"
}

Save new_badge immediately — it replaces your old badge for all future operations.