Skip to main content
This page explains how webhook events are delivered, retried, and handled when failures occur.

Delivery Model

Alvys uses an at-least-once delivery model. This means:
  • An event may be delivered more than once.
  • Duplicate deliveries are possible.
  • Exactly-once delivery is not guaranteed.
Each event includes a unique identifier in the header:
Your system must use this value to detect and safely ignore duplicate deliveries.

Delivery Success Criteria

An event is considered successfully delivered when the endpoint returns:
Any other response may trigger retry behavior.

Event Request Format

When a subscribed event occurs, Alvys sends an HTTPS POST request to your configured endpoint. Example request:
Headers:
Header descriptions:
  • X-Alvys-Event — The event type.
  • X-Alvys-Event-Id — Unique identifier for the event. This value remains the same across retry attempts.
  • X-Alvys-Timestamp — Unix timestamp (seconds) used for signature generation.
  • X-Alvys-Signature — HMAC-SHA256 signature (see Security & Signature Verification).
  • X-Alvys-Attempt — The delivery attempt number (starts at 1 and increments on each retry).
Example payload:
The data object contains event-specific fields.

Delivery Attempts

Each event may be delivered up to four times:
  1. Initial delivery
  2. Retry after approximately 10 seconds
  3. Retry after approximately 30 seconds
  4. Final retry after approximately 60 seconds
Retries use the same:
  • Endpoint URL
  • HTTP method
  • Request body — the same id, etag and subsidiaryId on every attempt
  • X-Alvys-Event-Id
The X-Alvys-Attempt, X-Alvys-Timestamp and X-Alvys-Signature headers change on each attempt. Deduplicate on the event id or X-Alvys-Event-Id, not on the signature or timestamp. There is no separate retry endpoint. The delivery attempt number is exposed on every delivery via the X-Alvys-Attempt header, which increments on each retry. From the consumer’s perspective, a retry is simply another delivery of the same event. Alvys builds the request body one time, before the first attempt. Values that depend on time are not refreshed on a retry. For example, the downloadUrl in a document event is valid for 10 minutes from when the event was built, so a late retry can carry an expired link. If the link has expired, get a fresh one from the list-documents endpoint.

Retry Conditions

Retries occur when:
  • The endpoint returns HTTP 500–599
  • The endpoint returns HTTP 408 or 429
  • A connection failure occurs (DNS resolution and TLS errors are not retried)
  • No response is received within 30 seconds
Retries do not occur for other 4xx responses.

Timeout

Each delivery attempt allows up to 30 seconds for your endpoint to respond. If no response is received within this window, the attempt is considered failed and may trigger a retry. To avoid unnecessary retries, endpoints should acknowledge the event promptly after validation and persist processing asynchronously.

HTTP Response Handling

Response code behavior:
  • 200–299 — Delivery acknowledged.
  • 400–499 (except 408/429) — Permanent failure, no retry.
  • 408 or 429 — Retry.
  • 500–599 — Retry.
  • No response within 30 seconds — Retry.

Auto-Disable Policy

A webhook is automatically disabled after:
A failed event means:
  • A single event (identified by X-Alvys-Event-Id)
  • That was attempted up to four times
  • And ultimately did not receive a successful 200–299 response
Important:
  • Failures are counted per event, not per retry attempt.
  • Multiple retry attempts for the same event count as one failed event.
  • The counter increments only after all retry attempts for an event are exhausted.
  • A successful event delivery resets the consecutive failure counter to zero.
When 10 distinct events fail consecutively, the webhook is automatically disabled and must be manually re-enabled. A security violation can disable the webhook immediately, without retries and without waiting for 10 failures. A security violation occurs when the endpoint host resolves to a private or internal network address. Make sure that your endpoint host resolves to a public address, and then re-enable the webhook.

Ordering

Ordering is not guaranteed, including for events about the same tender. Each event is delivered on its own, and a retry of an earlier event can arrive after a later one. Integrations must tolerate:
  • Retries
  • Duplicate deliveries
  • Timing variations
Do not rely on strict ordering guarantees.