Which requests are safe to retry
The Idempotency-Key header
- Choose any unique string of 8 to 200 characters, such as a UUID. Keys are scoped to your workspace.
- Sending the same key again returns the original result. Nothing is sent or charged a second time.
- The same key with a different request returns
422 idempotency_key_reused. For a reply, that means a different conversation, thread or text. For a placement test or a new campaign, any change to the request. Do not rely on other differences being caught: use a new key for every new request. - A launch is the exception to “the original result”: the same key returns the campaign as it is now, which may have changed since, and never launches it again. The first request’s
send_window_modestands. - If a launch answers
409 conflict, read the campaign’sstatus.runningtells you the campaign is running, not that your key launched it: someone else may have. - If a retry arrives while the first request is still being processed, wait a moment and retry with the same key. A placement test answers
409 conflictuntil then; a reply answers with the stored message, itsdelivery_statusstillpending.
Sending replies
A reply’sdelivery_status is sent, failed, pending or unknown. unknown means we could not confirm the send. The same key keeps returning that stored message and never sends again, so a retry does not resolve it. The conversation is read from stored history, which can lag behind the mailbox, so a reply missing there is not proof that it was not sent. Check the mailbox itself, or wait and read again, before sending it again with a new key.
A message that ends as failed was not sent, and its key keeps returning that failed message. To try again, send it with a new key.