Skip to content

Developers

Safe retries

A request that changes data through the apps API must carry an Idempotency-Key header, so that sending it again after a lost answer does not do it twice. Sending positions keeps its own rule, described in its guide.

Header
Idempotency-Key: 4f8a2c1e-9d3b-4a7e-b1c0-2e5d6f7a8b90

The key is 8 to 100 characters: letters, digits and . _ : - . Use a new random value for each action, and the same value when you repeat that same action.

Repeat the same request with the same key within 72 hours and you get the first answer again, with the header Idempotency-Replayed: true; nothing is done a second time.

The same key with a different body, or on another route, returns 409 with the code idempotency_conflict. Two requests with the same key at the same moment: the second waits up to 3 seconds and then returns 409 with Retry-After: 1; send it again.

Only a successful answer is kept. When a request fails the key is free again and you may send it again. An answer larger than 256 KiB is not kept.

A missing or malformed key returns 422 with Idempotency-Key as the field in error.details.

A key belongs to whoever sends it, their company and the route, so the same value used by another person or on another route is a different key.