Skip to main content

Idempotency

A network error can leave you not knowing whether a request was processed. To retry without creating the client twice, send an Idempotency-Key header with each create request:

Idempotency-Key: 7c2f4d1e-signup-4711

Use a value of 1 to 128 characters that is unique to the action, such as a UUID or your own record's id. Send the same value again when you retry the same action.

Within 24 hours, the same key with…Answer
the same bodyThe client the first request created, as it is stored now, with the header Idempotent-Replayed: true.
a different body409 idempotency_key_reused.

After 24 hours, the key counts as new. If two requests with the same key arrive at the same time, the second one waits for the first and then gets the same answer.