Idempotency-Key lets Sendmux return the first result instead of running the operation again.
How it works
Send a stable key
Add
Idempotency-Key to the original mutating request. Use a value that
identifies the logical action, such as an order or invoice ID.Retry with the same body
If the same key and body arrive again within 24 hours, Sendmux returns the
original response.
Example
Where it applies
Use the header on mutating endpoints such as sending email, creating domains, creating mailboxes, suspending or resuming mailboxes, creating mailbox keys, creating sending accounts, activating or deactivating sending accounts, requesting sending-account limit increases, creating webhooks, rotating webhook secrets, and sending webhook test events.GET endpoints do not need it. Update and delete requests use their documented concurrency controls instead.
Key rules
- Keep keys between 1 and 255 characters.
- Reuse the same key for retries of the same operation.
- Do not generate a new random key for each retry.
- Do not put idempotency keys in the JSON body.
- Treat
409 idempotency_conflicton an in-flight request as retryable after a short wait.
Related guides
Send by HTTP
Use idempotency with single and batch sends.
API errors
Handle
idempotency_conflict responses.