Idempotency
Networks fail and agents retry. Send an Idempotency-Key header on any write so a retried request happens only once.
curl -sS https://api.mailshake.com/2017-04-01/recipients/add \
-H "Authorization: Bearer $MAILSHAKE_API_KEY" \
-H "Idempotency-Key: 4f0c9b8e-add-prospects-2026-11-10" \
-H "Content-Type: application/json" \
-d '{"campaignID": 123, "addresses": [{"emailAddress": "jane@example.com"}]}'
- The key is 1 to 64 printable characters. Use a new random value (a UUID) per intended action, and reuse it only for retries of that action.
- Same key, same request: the first answer is returned again, with the header
Idempotent-Replayed: true. Nothing happens twice. - Same key, different request (or another operation):
409 idempotency_conflict. - Retried while the first is still running: the retry waits up to 30 seconds for the first, then returns its answer. If the first is still running after that, the retry gets
409 idempotency_conflict; retry again a little later with the same key. - Keys are kept for 24 hours. A
5xxanswer is not kept, so you can retry it with the same key. - Keys are per API client and are case-sensitive.
- The header is ignored on reads.