On this page

Idempotency and retries

Send the Idempotency-Key header so a retried request never sends a message twice, and learn how Deliver retries on its side.

Idempotency key

Send the Idempotency-Key header (or the idempotencyKey field), up to 128 characters, with an identifier of the send in your system: for example midivisa:factura:SETP990000123.

If a message with that key already exists, POST /v1/messages answers 200 with the same message and does not send it again. A new message answers 202.

Use a key that means something in your system

An invoice number or an event id works better than a random value: if your process restarts, it will generate the same key again.

Retries on your side

Retry temporary errors (500, 503 and, once send limits apply, 429) or network failures with a growing wait and the same idempotency key. Don’t retry other 4xx errors: they won’t change. See Errors.

Retries on Deliver’s side

Once a message is accepted, if sending fails temporarily Deliver retries after 1, 5, 15 and 60 minutes. If the last attempt fails, the message ends with status failed. Check the result with GET /v1/messages/{id}.