Skip to main content
HTTP status: 400 · Title: “Idempotency key too long”

When it fires

The Idempotency-Key header value is longer than 255 characters.

Why it happens

  • Several identifiers were concatenated into the key (user id, market id, timestamp, nonce) and the result exceeded 255 characters.
  • A library generated an unusually long token (for example a JWT instead of a UUID).

How to fix

  • Use a UUID v4 (uuidgen, crypto.randomUUID()) or a ULID. Both are 26 to 36 characters, well under the limit.
  • If you need to encode meaning in the key, hash it, for example sha256(your-blob).slice(0, 32), instead of concatenating raw values.
  • Allowed characters are [A-Za-z0-9_\-:.]; see IDEMPOTENCY_KEY_FORMAT_INVALID.
See Idempotency.