- Symptom
- 409 invalid_idempotent_request409 concurrent_idempotent_requests during a fast retry400 invalid_idempotency_key for keys longer than 256 characters
- Cause
- An Idempotency-Key is bound to the exact payload for 24 hours, so a retry that rebuilds the body differently, such as a new timestamp in the HTML, is refused. A second request while the first is still running gets a concurrency 409.
- Fix
- Derive the key from a stable event id, build the payload deterministically, retry concurrent 409s after a pause, and keep keys under 256 characters.
- Apply
await resend.emails.send(payload, { idempotencyKey: `welcome/${user.id}` });- Affected
- Resend API send and batch endpoints, keys kept 24 hours, as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders