Signature headers
Every webhook request includes the following headers:
Requests are also sent with
Content-Type: application/json and a
User-Agent of Openlayer-Webhooks/1.0.
How the signature is computed
The signature is an HMAC-SHA256 over the webhook id, timestamp, and the raw request body, joined with periods:whsec_ prefix removed
and the remainder Base64-decoded. The result is Base64-encoded and prefixed with
v1, to form the value sent in the webhook-signature header:
Verify with a library (recommended)
The Standard Webhooks libraries handle signature construction, Base64 decoding, constant-time comparison, and timestamp checks for you. Pass the signing secret returned when you created the subscription.Verify manually
If you prefer not to add a dependency, you can reproduce the signature yourself and compare it to the header using a constant-time comparison.Replay protection
Thewebhook-timestamp header lets you reject stale requests. Compare it to the
current time and discard requests whose timestamp is outside a tolerance window
(for example, more than 5 minutes old). The Standard Webhooks libraries perform
this check for you.
Idempotency
Because deliveries are retried, your endpoint may receive the same event more than once. Thewebhook-id header is
constant across retries of the same event, so you can use it as an idempotency
key — record the IDs you’ve already processed and skip duplicates.
