Skip to content

Usage Rotation Without Usage Limit

URI: https://docs.ankatech.co/errors/usage-rotation-without-usage-limit
HTTP Status: 422 Unprocessable Content

When you see this

A key's rotation schedule was written turning rotateOnUsageExhaustion on (from false), and the key's current material has no maximum usage limit (maxUsageLimit absent or 0, which means unlimited). Nothing was stored: the key's schedule is unchanged.

The option rotates the key when its usage count reaches its maximum usage limit. The usage of an uncapped key is never exhausted, so the option could never act.

The check runs after the soft-limit check.

Response Example

{
  "type": "https://docs.ankatech.co/errors/usage-rotation-without-usage-limit",
  "title": "Usage Rotation Without Usage Limit",
  "status": 422,
  "detail": "rotateOnUsageExhaustion: the key has no maximum usage limit, so its usage can never be exhausted. Set a maximum usage limit on the key first, or send false.",
  "instance": "/api/v3/admin/tenants/550e8400-e29b-41d4-a716-446655440000/keys/payments-data-key/rotation-schedule",
  "timestamp": 1790000000,
  "extensions": {
    "requestId": "c4a8e2f1-6b3d-4970-a1e5-8f0d9b2c6e17"
  }
}

Content-Type: application/problem+json — the response follows RFC 9457 Problem Details. The detail names the option and the remedy, never the key or the tenant.

How to Resolve

  1. Set a maximum usage limit on the key with the metadata update (PATCH /api/v3/admin/tenants/{tenantId}/keys/{kid}, a positive maxUsageLimit above the uses already counted), then write the schedule again.
  2. Or send rotateOnUsageExhaustion: false and keep the key on a time-based cadence.

An option stored before a later metadata update removed the maximum is kept: it acts on nothing until the key has a maximum again.

Operations that emit it

Method Endpoint
PUT /api/v3/admin/tenants/{tenantId}/keys/{kid}/rotation-schedule

For full schema definitions, examples, and interactive testing, see the Developer Hub Reference.