Idempotency
Retry safely: the same request with the same key never happens twice.
Idempotency keys
Actions that send email or create records need an Idempotency-Key header: creating a document, sending, voiding, reminding, and making or rolling API keys. Use a new random value (a UUID is ideal) for each action, and the same value when you retry it.
- Same key, same body: you get the first response again, with the header Idempotent-Replayed: true. Nothing is repeated.
- Same key, different body: 409 idempotency_key_reused.
- While the first request is still running: 409 request_in_progress.
- If the first request failed, the key is released, so retrying with it runs the request again.