Webhook delivery, retries, and failures
Retry behavior, why a subscription is disabled after repeated failures, who gets notified, and how to recover.
This page describes what Preczn does when your endpoint is slow, returns an error, or can't be reached. It covers retries, duplicate notifications, when Preczn disables a subscription, and how to recover.
Delivery attempts
Preczn sends each event to each matching subscription once, with a few quick retries if the first request fails. All requests for one event share a single 5-second budget.
| Setting | Value |
|---|---|
| Method | POST |
| Requests per event | Up to 4: the first request and up to 3 retries |
| Time budget | 5 seconds for all requests together, including the delays between them |
| Success | Any 2xx response |
| Retried | 5xx, 429, and connection errors such as DNS failures and refused connections |
| Not retried | A timeout, and any 4xx other than 429 |
- Delays: the delay between requests grows after each retry and lasts less than a second. If your endpoint sends a
Retry-Afterheader with a longer delay, Preczn waits that long instead. - Budget: a retry starts only if time remains in the 5-second budget. A slow response near 5 seconds leaves no time for a retry, and a
Retry-Afterlonger than the remaining time cancels the retry. - Timeouts: an endpoint that doesn't respond within the budget fails at once, with no retry.
The following diagram shows one event whose first request gets a 503:
sequenceDiagram
participant P as Preczn
participant E as Your endpoint
Note over P,E: One 5-second budget for every request
P->>E: POST notification
E-->>P: 503
loop Up to 3 retries while time remains
P->>E: POST the same notification, same id
E-->>P: 2xx, or another 5xx or 429
end
Note over P,E: One history entry. The failure counter resets on success, or adds one on failure
When the last request fails, the event has failed for that subscription. Preczn doesn't try a failed event again later. To deliver a failed transaction event, resend it from the Dashboard. Other events can't be resent.
Retries aren't separate entries in your history
Delivery history records one entry for each event, with its final result. An event that failed shows as one failed entry, even if Preczn sent up to 4 requests.
Duplicate notifications
Your endpoint can receive the same event more than once. The retries described above reuse the same notification, with the same id. Two other cases send the event again with a new id:
- Resend: a resend from the Dashboard carries the original
eventTypeanddatawith a newid. - Redelivery: if Preczn hits an internal error after it sends a notification, Preczn can send the same event again with a new
id.
Because the id can change, don't rely on it alone to detect repeats. Make your handler idempotent: processing the same event twice must leave your system in the same state as processing it once. For example, apply the state in data to the record it identifies, rather than counting notifications.
The consecutive failure counter
Every subscription has a counter of consecutive failed events, returned as failedCount by the API.
- A failed event adds one to the counter.
- A successful event resets the counter to 0.
The counter moves once per event, not once per request. An endpoint that fails now and then but succeeds in between never builds up toward the limit.
Automatic disabling
At 25 consecutive failed events, Preczn disables the subscription
When the counter reaches 25, Preczn sets the subscription's
activevalue tofalse, and the subscription stops receiving events.
Who receives the email
The email depends on where the subscription was created:
- Created in the Dashboard: Preczn emails the Dashboard user who created the subscription. If that user no longer exists, Preczn doesn't send an email.
- Created through the API: Preczn doesn't send an email.
The email's subject is Preczn - Webhook Subscription Automatically Disabled. It names the subscription ID, endpoint URL, and description.
Monitor subscriptions created through the API
A subscription created through the API stops with no email. To catch this, check
activeandfailedCounton a schedule withGET /v1/webhooks, which doesn't return signing secrets, and alert whenactiveisfalseorfailedCountkeeps rising.
Recovering from a disabled subscription
- Fix the endpoint first. To find what failed, open the subscription's delivery history. If you re-enable before the fix, 25 more failures disable the subscription again.
- Re-enable the subscription. See Editing or disabling a subscription.
- Reconcile the gap yourself. Events from the time the subscription was disabled aren't delivered later. Read the affected records through the API, such as transactions, merchants, and boarding forms, before you rely on new notifications.
The subscription keeps its ID, signing secret, and delivery history, so your code needs no changes.
How you re-enable the subscription changes the counter:
- In the Dashboard: enabling the subscription resets the counter to 0, so it has 25 failures to spare again.
- Through the API: the counter stays at 25 or more. If the next event fails, Preczn disables the subscription again at once. The counter resets to 0 after the next successful event.
Delivery history
To view a subscription's delivery history, go to Settings → Webhooks, open the subscription's actions menu, and select Webhook Attempts. Each entry records:
- The notification's
idand event type - The endpoint URL it was sent to
- Whether it succeeded, and when
- The request body that was sent
- The response body on success, or the error on failure
The Webhook Attempts page lists a subscription's deliveries. Select an ID to see its request and response.
History is kept for 15 days
Preczn deletes delivery records after 15 days. They're for debugging, not an audit trail. To keep a record of what Preczn sent, store the notifications on your side when you receive them.
A transaction also lists its deliveries on its Webhook deliveries tab. Deliveries older than 15 days show as Archived. They still show Delivered or Failed, but their request and response are gone, so you can't view or resend them.
Resending a notification
You can resend a transaction notification from the Dashboard, for example after you fix a broken endpoint. Resending is available only in the Dashboard and only for transaction events.
- Go to Transactions → Log, and open the transaction.
- Select the Webhook deliveries tab.
- Expand the delivery that you want to resend.
- Select Resend webhook, and then select Resend webhook again to confirm.
A transaction's Webhook deliveries tab, with a failed delivery expanded and ready to resend.
A resend has these rules:
- New
id: the resend carries the originaleventTypeanddatawith a newid. See Duplicate notifications. - Current settings: the resend goes to the subscription's current endpoint URL and custom header.
- Active subscription: the subscription must be active. If it isn't, the resend fails and asks you to re-enable the subscription.
- 15 days: an archived delivery can't be resent.
- Queued: a confirmation means Preczn accepted the resend, not that your endpoint received it. The resend adds its own entry to the delivery history.
FAQ
Why was my subscription disabled?
25 events in a row failed. An event fails when your endpoint returns a non-2xx response, can't be reached, or doesn't respond within 5 seconds.
To see which cause it was, open the subscription's delivery history and read the recorded errors. Common causes are an expired TLS certificate, a firewall or allowlist change, a moved route, and a handler that slows down under load.
I never received the disable email. Why not?
Preczn emails only the Dashboard user who created the subscription. A subscription created through the API never sends an email, and neither does one whose creator no longer exists. Also check your spam filter for the subject Preczn - Webhook Subscription Automatically Disabled.
Can I change who gets the email?
No. The recipient is set when the subscription is created and doesn't change when you edit it. To change the recipient, have that person create a new subscription in the Dashboard with the same URL and events, confirm it delivers, and then disable the old one. While both are active, your endpoint receives each event twice.
Can I raise the 25-failure limit, or turn off automatic disabling?
No. The limit is fixed for every subscription.
Does a slow endpoint count as a failure?
Yes. A response after 5 seconds is a failure, and Preczn doesn't retry it, even if your server finishes the work. Return a 2xx right away and do the work afterward.
If I have several subscriptions, does one failing affect the others?
No. Each subscription has its own counter, status, and history. One subscription being disabled doesn't affect the others, even one that uses the same URL.
Updated 5 days ago
