IDEMPOTENCY_KEY_MISMATCH

The request body changed for the same retry key.

HTTP status: 422

Why this happens

The same Idempotency-Key was reused with a different request body.

How to recover

Mint a fresh idempotency key for the new request body; never reuse keys across distinct requests.

Branching on this code

TypeScript
import { ApiError } from "@firecase/sdk";

try {
  await firecase.someCall();
} catch (e) {
  if (e instanceof ApiError && e.code === "IDEMPOTENCY_KEY_MISMATCH") {
    // recover here
  }
  throw e;
}