429 rate_limited with a Retry-After header: the number of seconds to wait.
Retrying
- On
429or503, wait forRetry-Afterseconds, then retry. - On
500, retry with a growing delay, such as 1, 2, 4 and 8 seconds, and add some randomness. - Do not retry other
4xxresponses. The request needs to change first. The exception is a409 conflictsaying a request with yourIdempotency-Keyis still in progress: retry that one unchanged, with the same key. - Before retrying a
POST, read Idempotency and safe retries.
Retry-After.
Waiting for a long-running operation
Some operations take minutes. The API starts them and returns202 Accepted without waiting; the Location header is the URL to read for the result.
While the operation is running, reading that URL returns a Retry-After header. Wait that many seconds before reading again. When a 200 response comes without the header, the operation has finished. An error response without it says nothing about the operation: handle the error first.
A status field is open-ended: new values can appear. Treat a status you do not know as “still running” while Retry-After is present.
At launch one operation works this way: an inbox placement test, which takes about 15 minutes.
sender_ids from GET /sender-schedules?channel=EMAIL. When the test has finished, summary holds the result.
Webhooks are planned. Until then, polling with Retry-After is the way to wait.