Skip to main content
Every write endpoint (POST, PATCH, DELETE) requires the Idempotency-Key header. The header protects you from duplicate side effects on network retries; natural-key upsert on key resources protects you from duplicates across longer time horizons.

The header

  • Client-generated. UUIDs are recommended; any unique string up to 255 characters works.
  • Scoped per (organizationUuid, key). Keys don’t collide across customers.
  • Stored with the response for 24 hours.

Behavior matrix

Example — safe create-then-retry

Pattern rules:
  • Generate one key per logical operation. Not per HTTP attempt.
  • Persist the key if your retry might span a process restart — reuse the same key after restart.
  • Never reuse a key for different data — even small changes trigger 422. Fresh data = fresh key.

Natural-key upsert (second layer)

Some resources are upserted on a business-level natural key independent of the Idempotency-Key header: Behavior:
  • Same body200 OK with existing resource. Idempotent regardless of the Idempotency-Key.
  • Different body409 Conflict with current resource. Use PATCH for explicit updates.
This layer handles the case where the Idempotency-Key cache missed (e.g. 24h elapsed between retries, or a different key was generated).

Why two layers

  • Header handles short-window network-retry dedup with exact-response replay.
  • Natural key handles cross-channel dedup — the same buyer created via API and then “discovered” via web app still converges to one record.
Together they make duplicate-creation vanishingly unlikely.

What happens when I send Idempotency-Key with a GET request?

Nothing — the header is ignored. Reads are naturally idempotent; the header is parsed only on write methods.

Next

Optimistic concurrency

Preventing lost updates on concurrent edits.

Error reference

422 idempotency-key-reused and related problems.