Idempotency
Safely retry write requests without creating duplicates.
Write requests can be made idempotent by sending an Idempotency-Key header
on POST, PATCH, PUT, and DELETE requests. If a request fails
partway — a dropped connection, a timeout — you can safely retry it with the
same key without risking a duplicate.
The header is optional on most writes, but mandatory on
POST /bookings/{id}/payments — a missing header returns 422
(idempotency_key_required).
curl https://api.myeasol.com/bookings \
-X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Content-Type: application/json" \
-d '{}'Use a V4 UUID, or any random string with enough entropy to avoid collisions (up to 255 characters). Keys are stored for 24 hours; within that window an identical request returns the original response. After 24 hours the key is forgotten. Never put sensitive data in a key.
Two cases return an error instead:
- Reusing a key with a different request body returns
400(idempotency_key_in_use). - Retrying while the original request is still in flight returns
409(idempotency_key_in_progress).
If the idempotency store is unavailable, the request returns 503
(idempotency_store_unavailable) — see Errors.
Safe to retry after a short backoff.