HTTP 422

idempotency_key_reused — Shorty API error

Idempotency key reused (HTTP 422): when the Shorty API returns the idempotency_key_reused error, why, and how to fix it.

Open in ClaudeOpen in ChatGPT
CodeHTTP statusType URI
idempotency_key_reused422https://aishorty.com/docs/api/errors/idempotency_key_reused

When it happens

An Idempotency-Key was reused with a DIFFERENT request body. Keys bind to the exact payload they first succeeded with.

Example response

{
  "type": "https://aishorty.com/docs/api/errors/idempotency_key_reused",
  "title": "Idempotency key reused",
  "status": 422,
  "detail": "This idempotency key was already used with a different request body.",
  "instance": "urn:request:req_01J9Z8ABCDEFGH0123456789",
  "code": "idempotency_key_reused",
  "request_id": "req_01J9Z8ABCDEFGH0123456789"
}

How to fix it

Generate a new key when the body changes. Reuse a key only for byte-identical retries of the same operation.