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.

Four panels show transactionally claiming the event ID, applying one downstream effect, acknowledging after commit, and surviving Dosya’s six-attempt retry schedule.
Four panels show transactionally claiming the event ID, applying one downstream effect, acknowledging after commit, and surviving Dosya’s six-attempt retry schedule. Open full-size screenshot.

Steps

  1. Verify X-Dosya-Signature against the raw body and require matching X-Dosya-Event-Id and body id before entering the business transaction.
  2. 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.
  3. On a unique-key conflict, read the committed result and return 2xx without repeating the mutation. Do not use X-Dosya-Delivery-Id as the sole key because Redeliver assigns a new one.
  4. 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.
  5. 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.
  6. 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.

Reference for “Retry webhook deliveries safely”: Dosya REST API overview page with Get API Key and View SDKs links.
Reference for “Retry webhook deliveries safely”: Dosya REST API overview page with Get API Key and View SDKs links. Open full-size screenshot.

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.

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.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.