Receiving events with webhooks and verifying signatures
Send deal, payment and other events to your server instantly; verify the signature and de-duplicate retries.
14 min · Pour qui: Tous
Dashboard → All tools → Management → Developers → Webhooks
À la fin de cette leçon
You can set up a webhook endpoint, send a test event, verify with the signature that a request really came from Reydoc and know the retry rules on failure.
A webhook is Reydoc sending an HTTPS POST to your server when something happens (for example a deal is funded or a payment is made), so you do not have to poll the API.
Delivery is "at least once": with network issues the same event can arrive more than once, so de-duplicate every event by its event ID.
Pas à pas
- Create an endpoint
In the Webhooks tab choose the environment in the new endpoint form. As the target choose your own HTTPS address, or the Reydoc test receiver (7 days) to experiment.
- Enter the address and events
Enter your server address (up to 500 characters). Choose "*" for all events, group options such as "deal.*", or only webhook.test.v1 to try it. Groups: campaign, deal, payment, payout, order, affiliate, creator, social, media, rights, agency, team, automation, integration, store.
- Store the secret
Add an optional description (up to 200 characters) and create the endpoint. The signing secret is shown only once; put it in your server's secret variables.
- Verify the signature
Each request carries a "Reydoc-Signature: t=<unix seconds>,v1=<hex>" header. On your server compute HMAC-SHA256(secret, t + "." + raw body) and compare it with v1 in constant time. Reject the request if t is more than 300 seconds old (replay protection).
- Send a test event
On the endpoint page send a test event. With the test receiver you see whether the signature is valid and the clock difference. On your own server check that you return 2xx.
- Manage the endpoint
The endpoint page has Resend (repeats a single delivery), Rotate secret (the old secret stops working immediately), Pause, Activate and Close.
Règles et limites
- Up to 10 open endpoints per workspace; the delivery timeout is 10 seconds.
- Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 8 h and 24 h. After the 7th attempt, the delivery goes to the dead-letter queue (DLQ).
- An endpoint with 15 consecutive failures is closed automatically and its owner is emailed.
- The endpoint address must be https.
Conseils
- Return 2xx as soon as you receive the event and queue the heavy work; if you exceed 10 seconds the delivery counts as failed.
- Store processed event IDs in a table; ignore an ID that arrives again.
- After rotating the secret, update the value on your server at the same time; the old secret stops working immediately.
Erreurs fréquentes
- Computing the signature over parsed JSON: the signature covers the raw body, and even a whitespace change breaks it.
- Skipping the timestamp check: you stay open to replays of old requests.
- Processing the same event twice (for example reducing stock twice): no de-duplication.
Leçons associées
- API clients and keysDevelopers: API, webhooks, MCP and integrations
- Request logs and publishing your own appDevelopers: API, webhooks, MCP and integrations