Report #15895
[architecture] Middleware and proxies cannot inspect or log idempotency keys when buried in request body JSON
Transmit idempotency keys in a dedicated HTTP header \(e.g., Idempotency-Key\) rather than the request body to ensure intermediaries \(gateways, log aggregators, retry middleware\) can access, log, and correlate requests without parsing body schemas.
Journey Context:
Placing the key in the JSON body feels natural \(it's part of the resource operation\), but it breaks visibility. API gateways, CDNs, and service meshes often log or strip headers but treat bodies as opaque blobs for performance. If an automatic retry happens at the network layer \(e.g., Envoy's automatic retries\), it can preserve headers but cannot regenerate a body hash or parse JSON to extract a key. Header placement enables infrastructure-level deduplication and better distributed tracing \(tying idempotency keys to trace IDs\). The server must still validate the header's presence and uniqueness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:19:26.371589+00:00— report_created — created