Delivery and retries
What a delivery looks like on the wire, when it is retried, and when an endpoint is turned off.
Early access
The REST API, webhooks and embedded signing are open to accounts in early access. If Settings, Developers is not in your account yet, write to contact@docudetect.com. What these pages describe can still change; breaking changes are announced on this site first.
Each event is a POST of the payload to your endpoint with these headers:
| Header | Carries |
|---|---|
Content-Type | application/json |
User-Agent | DocuDetect-Webhooks/1 (+https://docudetect.com/settings?section=developers&tab=reference) |
DocuDetect-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256>. Two v1 values while an old secret still signs after a rotation. |
DocuDetect-Event-Id | The event id (evt_…), the same on every retry. Use it to drop duplicates. |
DocuDetect-Event-Type | The event type, for example document.completed. |
DocuDetect-Delivery-Id | This delivery. Sending it again by hand makes a new one. |
DocuDetect-Delivery-Attempt | The attempt number, from 1. |
What counts as delivered
A 2xx answer. Everything else is a failed attempt: another status, a redirect (redirects are not followed), no connection within 5 seconds, or no complete answer within 10 seconds. The delivery log keeps the status, the time taken and the start of your answer.
Retries
A failed delivery is tried again on this schedule, 8 attempts in all:
| Attempt | Waits after the one before | Time since the first attempt |
|---|---|---|
| 1 | none | 0 |
| 2 | 1 minute | about 1 minute |
| 3 | 5 minutes | about 6 minutes |
| 4 | 15 minutes | about 21 minutes |
| 5 | 1 hour | about 81 minutes |
| 6 | 3 hours | about 261 minutes |
| 7 | 6 hours | about 621 minutes |
| 8 | 12 hours | about 1341 minutes |
A 429 or 503 with a Retry-After longer than the next wait is honored, up to 12 hours. The body stays byte for byte the same on every attempt; the signature is made afresh for each.
Why an attempt failed
| Error | The delivery log says |
|---|---|
blocked_address | This address can't receive webhooks (it isn't a public internet address) |
dns | The host name could not be found |
connect | Could not connect |
tls | Secure connection failed |
timeout | No answer in time |
redirect | Answered with a redirect (redirects aren't followed) |
http_status | Answered with an error |
secret_unreadable | We can't read this webhook's signing secret. Make a new one |
Turned off automatically
An endpoint is turned off, and the account owner is emailed, when:
- it answers
410 Gone, or - it has failed 20 times in a row over at least 72 hours, or
- the API key that made it is revoked or expires.
While an endpoint is off, its events are held for 72 hours and sent when you turn it back on. Nothing is delivered while the account's email is unverified or the account is suspended; those events are dropped, not held.
The log
Settings, Developers, Webhooks shows each endpoint's deliveries for 30 days. Send again delivers any of them now, with the same event id. Send test event sends a document.sent with made-up ids and "test": true.