Skip to content

API idempotency

Send an Idempotency-Key on every POST so a retry replays the first result instead of repeating the action.

Send Idempotency-Key on every POST. Avaloi stores the first response for 24 hours and replays it for the same key and body, so a retry never creates a second invitation, site, or job.

Send a key

curl -s -X POST https://api.avaloi.com/v1/companies/me/invitations \
  -H "Authorization: Bearer hk_live_YOUR_SECRET" \
  -H "Idempotency-Key: 8f2c-retry-1" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","role":"developer"}'

A second POST with the same key and body returns the first response. No second invitation is created.

Rules

  • The same key with a different body returns 422.
  • Use a new key for each new operation. UUIDs work well.
  • The stored response lasts 24 hours.

Quick answers

My network dropped during a POST. Did it go through? Send the same request with the same Idempotency-Key. You get the stored response if it did, or a fresh result if it did not.

I changed the body and got 422. A key belongs to one body. Use a new key for the new request.

Do GET, PATCH, PUT, and DELETE need a key? No. Send it on POST.

Still stuck?

Email [email protected] with your site name and what you tried, or send us a message.