Idempotency

Retry any create safely. The same key returns the first answer and never acts twice.

How it works

Send a unique Idempotency-Key header, a UUID for example. The first request with a key runs and its response is kept for 24 hours. The same key with the same request returns that response with Idempotent-Replayed: true.

curl -X POST https://api.omnio.sawego.com/v1/messages \
  -H "Authorization: Bearer $OMNIO_API_KEY" \
  -H "Idempotency-Key: 9f1c2b7e-5d4a-4e8b-a3c6-1f0e2d9b8a77" \
  -H "Content-Type: application/json" \
  -d '{"conversation_id": "b1c7e0a4-52a3-4a3c-8d0e-6c1b9e5f7a20", "type": "text", "content": {"text": "Your order 4821 ships Thursday."}}'

Which routes take it

Sends, reactions, uploads and notes require it and answer 400 idempotency_key_required without one. Every other create takes it optionally. Each page in the API reference says which.

Conflicts

StatusCodeMeaning
409idempotency_conflictThe key was used with a different request
409idempotency_in_progressThe first request with this key is still running

Retrying

Keep the key with the job that sends, and reuse it on every retry of that job. A request that failed frees its key, so a retry after a 4xx or 5xx runs again. Generate a new key only for a new intent.

NextPagination