Skip to content
For LLMsView as Markdown·

For the operator's engineer building the webhook.receive module.

webhook.receive ​

The webhook.receive module is where OneHazel delivers events to you: KYC verdicts, responsible-gaming actions, payment outcomes and the like. It uses OneHazel's existing webhook delivery format unchanged, so a receiver you already run for OneHazel webhooks keeps working.

Who calls whom ​

OneHazel calls you, at POST /webhook under the base URL you register for webhook.receive. The body carries type, data, operatorId, timestamp and deliveryId.

Headers and signature ​

This module uses a different signature from wallet and player, on purpose:

HeaderValue
X-OneHazel-Signaturesha256=<hex>, HMAC-SHA256 of the raw body keyed by your whsec_ signing secret. No timestamp.
X-OneHazel-Eventthe same value as body type
X-OneHazel-Deliverythe same value as body deliveryId

There is no bearer. Live deliveries carry no X-OneHazel-Env; conformance deliveries add X-OneHazel-Env: test, so do not reject a delivery for having or lacking it.

Verify the signature over the raw bytes before parsing and compare in constant time. Answer 401 on a mismatch.

Replays and timing ​

With no timestamp, a replayed delivery verifies. Deduplicate on deliveryId: that is the replay defence. Deliveries are at-least-once, so the same deliveryId can arrive twice; answer 2xx both times and process it once.

Answer 2xx within 5 seconds and do slow work after acknowledging. Anything else, including a timeout, is retried on the subscription's retry policy.

Conformance ​

ScenarioSeverityPassing looks like
deliver.okblocker2xx for a correctly signed delivery
deliver.replay_ignoredmajor2xx both times for the same deliveryId
deliver.tampered_rejectedblockernon-2xx for a body altered after signing
deliver.timeout_5smajorthe 2xx arrives within 5 s

Samples ​

StackSample
TypeScript + Expresswebhook.receive
TypeScript + Fastifywebhook.receive
Python + FastAPIwebhook.receive
PHP (no framework)webhook.receive
PHP + Laravelwebhook.receive

The TypeScript helper @onehazel/connect exports verifyWebhookSignature for this format; see the contract.