Retry webhook deliveries safely
Build transactional event-ID idempotency around Dosya’s six-attempt retry schedule so repeated requests change downstream state only once safely.
Last reviewed
Retries are normal delivery behavior, so the receiver must make one event safe to execute more than once. Dosya’s stable business identifier is the event ID; a delivery ID identifies an attempt record and can change during manual replay.

Steps
- Verify
X-Dosya-Signatureagainst the raw body and require matchingX-Dosya-Event-Idand bodyidbefore entering the business transaction. - Insert the event ID into a uniquely constrained idempotency table inside the same transaction that applies the downstream mutation. Store processing status and a safe result reference for recovery.
- On a unique-key conflict, read the committed result and return 2xx without repeating the mutation. Do not use
X-Dosya-Delivery-Idas the sole key because Redeliver assigns a new one. - Commit durable work before acknowledging. A receiver crash before commit causes a safe retry; committing a side effect and its marker separately creates a window where the next attempt can duplicate state.
- Exercise the failure path once. Dosya sends an initial attempt and, while failure continues, schedules five more after 30 seconds, 2 minutes, 10 minutes, 1 hour, and 6 hours; the sweep may run later than each due time.
- Let the retry succeed and inspect Deliveries. Confirm one business result, one shared event ID, the attempt count, and Success with no next retry.
Any 2xx ends retry. A non-2xx response, network error, disallowed redirect, or ten-second timeout increments the endpoint’s consecutive-failure counter; 15 such failed attempts auto-disable the endpoint.

Expected result
Repeated requests for the same event either create the single intended downstream result or return its committed result. Delivery attempts remain observable without becoming additional business actions.
The effect happened twice. Move the idempotency claim and mutation into one atomic boundary, then repair existing duplicates before replaying the event.
A poison event retries repeatedly. Quarantine its verified payload durably and choose a deliberate acknowledgement policy; returning failure consumes the six-attempt schedule and contributes to auto-disable.
Related guides
Was this helpful?
Loading helpfulness results…
Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.
Questions and replies
Ask about the steps in this guide. Questions are reviewed before publication.
Keep account details, credentials and private files out of public questions. Use private support for those.
Loading questions…
Sign in to your Dosya account to ask a question.