Delivery & Retries
finlight sends each delivery once and waits up to 5 seconds for your answer. If the delivery fails, finlight tries again up to 3 times. A webhook that keeps failing is turned off.
What counts as a success
A delivery succeeds when your server answers with any 2xx status within 5 seconds. Everything else is a failure:
- any other status code, such as
400,401,404,429or500 - no full answer within 5 seconds
- a connection error, for example DNS, a refused connection or a TLS problem
Answer first and work afterwards. Put the delivery on a queue, answer 2xx, then do the slow work.
Point the webhook at the final URL of your endpoint. Do not rely on redirects to move an endpoint.
Retries
When a delivery fails, finlight schedules a retry. There are at most 3 retries per event:
| Attempt | When |
|---|---|
| First attempt | When the article matches |
| Retry 1 | 10 minutes after the first attempt failed |
| Retry 2 | 30 minutes after retry 1 failed |
| Retry 3 | 60 minutes after retry 2 failed |
So the last retry comes about 100 minutes after the first attempt. After that, the event is dropped.
Each retry:
- has the same
eventIdandoccurredAtas the first attempt, - has a new
X-Webhook-Timestampand a new signature, - is cut again by your plan at the time of the retry, so the blocks in
datacan differ from the first attempt.
A retry is skipped if the webhook was disabled or deleted in the meantime. A 410 answer gets no retry (see below).
Duplicates and order
Delivery is at least once. You can get the same event twice, for example when your server processed it but answered too late. Drop duplicates by eventId (see Payload).
There is no order guarantee. A retry of an older event can arrive after a newer event. Use occurredAt to order events of the same article.
Automatic disabling
finlight turns a webhook off in two cases:
- Your endpoint answers
410 Gone. finlight reads this as "this endpoint is gone for good" and disables the webhook at once, with no retry. Answer410only when you want to turn the webhook off. If you want a retry, answer5xx. - 10 failed attempts in a row. Every failed attempt counts, retries included. One event can therefore add up to 4 failures, so about 3 events that fail every attempt are enough. Any successful delivery resets the count to 0. The count also starts over 7 days after the first failure in a row.
When a webhook is disabled:
- its status in the dashboard changes to disabled, and the detail page lists the two possible causes,
- finlight sends you an email,
- new matching articles are skipped, not queued, and queued retries are skipped too.
Test deliveries from the dashboard never count toward the 10 failures.
Quota and usage
Webhook deliveries do not use credits. They count against your plan's webhook quota, a monthly number of deliveries. The numbers per plan are on pricing and in the dashboard. See also Rate limits & credits.
What counts:
- Only the first attempt of an event counts against the quota, whether it succeeds or fails.
- Retries do not count against the quota or the daily usage chart in the dashboard.
- Retries still go out after the quota is used up, because their event was already counted.
- Test deliveries do not count against the quota, but they show up in the daily usage chart.
When the quota is used up:
- New first attempts stop. Matching articles are skipped, not queued.
- The webhook stays enabled. In the webhook list its quota status shows Over quota, and a banner on the detail page says that deliveries are paused because the webhook quota is used up.
- finlight sends you an email.
- Deliveries start again when your quota resets at the start of the next billing period, or right away when you upgrade.
The usage chart in the dashboard is updated with a delay. The quota itself is enforced live.
Re-enabling a webhook
A disabled webhook stays off until you turn it on. Webhooks are never re-enabled automatically.
- Open the webhook in the dashboard and look at the Call History to find the cause: the status codes, the response body and the latency of each attempt.
- Fix your endpoint.
- Press Test to send a test delivery and check that it succeeds. Test deliveries are sent even while the webhook is disabled.
- Press Enable.
Articles that matched while the webhook was off are not sent later. To fill the gap, search for them with the REST API, for example with orderBy: "availableAt" and from set to the time the webhook stopped.
Response codes to use
| Situation | Answer |
|---|---|
| Delivery verified and accepted (or queued) | 200 or 204 |
Duplicate eventId you have already handled | 200 or 204 |
| Correctly signed v2 body during a switch | 200 or 204 |
| Bad signature or timestamp | 400 (this counts as a failure) |
| Your server has a temporary problem and you want a retry | 500 or 503 |
| You want finlight to turn the webhook off | 410 |