How it works
Send anIdempotency-Key header with POST /v1/email or POST /v1/emails/batch:
- Same key, same body: SendFlit returns the original result and does not send again.
- Same key, different body: the request is rejected with
409. Your client has a bug. Use a new key for a new email.
Choose a good key
The key should identify the business event, so every attempt at the same event uses the same key:
Avoid keys that change on each attempt, such as random values or timestamps, because they defeat the purpose. Avoid keys that are too broad, such as
receipts, because they block unrelated emails.
SDK support
The Node.js and Python SDKs take the key as an argument:Retry safely
- Retry only
429,5xx, and network timeouts. - Reuse the same key on every retry.
- Stop retrying after a sensible limit, and record the failure.
- Treat
409as a bug to fix, not something to retry.