WoyraDocs
Get an API key

Retry safely with idempotency keys

Every request that spends money takes a key, honoured for 24 hours, and a retry replays the original response verbatim.

About 4 minutes · Every example runs against a test key, which costs nothing.

The hard case in messaging is not the request that fails. It is the one that succeeds and whose response you never see. Without a key, your retry sends a second message; with one, it returns the first response byte for byte, and the customer receives one message.

curl -X POST https://api.woyra.io/v1/messages \
  -H "Authorization: Bearer $WOYRA_KEY" \
  -H 'Idempotency-Key: order-4821-otp' \
  -H 'Content-Type: application/json' \
  -d '{"channel":"sms","to":"+251911234567","from":"WOYRA","body":"Your code is 483920"}'

Choosing a key

What the two conflicts mean

Retry on these, and nothing elseRetry 429 after the Retry-After header says, 503 route_unavailable with backoff, and 500. A 4xx other than 429 will fail again identically, and retrying it only makes your logs harder to read.

Questions

How long is a key remembered?

24 hours, which is far longer than any sensible retry window.

Is the key required?

On requests that spend money, yes. It is required rather than optional exactly because the endpoint spends money, and an optional safety mechanism is one that is missing when it matters.

Next

Get a test key and run any of this in about ninety seconds.