POST with a JSON body. This page covers how to answer it, check that it came from ReachHunt, and handle retries.
Answer quickly
Answer with any2xx status within 10 seconds. Redirects are not followed: a 3xx counts as a failure.
- Answer with
2xxfirst, then do the work. - Skip an
idyou already handled. The same event can arrive more than once, for example when your server worked but answered too late. - Compare
createdAtwhen order matters. Events can arrive out of order, for example when one is retried.
Check that a request came from ReachHunt
ReachHunt doesn’t sign requests. Add a secret header to the webhook instead, then reject any request that doesn’t carry it.1
Add a secret header
In Settings → Webhooks, select Add a secret header when you add or edit a webhook. For example, use
X-Webhook-Secret with a long random value.2
Check it on your server
Compare the header with the value you saved, using a constant-time comparison. Answer
401 when it doesn’t match.Example handler
Retries
ReachHunt tries a delivery again when your server:- does not answer within 10 seconds, or cannot be reached
- answers
408,429or any5xx
400 or 401, fails the delivery at once, without retries.
Turning off
ReachHunt turns a webhook off when:- your server answers
404or410, or the URL points to an address ReachHunt does not send to - an event fails all its retries and nothing else reached your server since that event happened
Testing
Open the menu on your webhook in Settings → Webhooks and select Send test event. It sends a sample of the event you pick, with your headers, and shows how your server answered. A test event’sid starts with test_.