Idempotency
Send an Idempotency-Key on every write that costs money so a retry never becomes a second message and a second charge.
How it works
Send an Idempotency-Key header on every write that costs money. If the same key arrives twice — a retry after a timeout, a duplicated job — you get the original response back instead of a second message and a second charge.
text
POST /api/v1/email/messages
Idempotency-Key: 5c9b2a10-4f83-4c2e-9b77-2a1d0e6b8f44Use a fresh UUID per logical send, not per HTTP attempt. Reusing the key across genuinely different messages silently returns the first result and drops the second. Reusing it with a different payload is a 409 conflict, on purpose.