Skip to main content
Because your webhook endpoint is a public URL, anyone could send requests to it. To confirm that a request genuinely came from Openlayer and was not tampered with, every delivery is signed. Your endpoint should verify the signature before processing the payload. Openlayer follows the Standard Webhooks specification, so you can verify signatures with any compatible library.

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:
The key is your subscription’s signing secret with the 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 against the raw request body exactly as received. Parsing the JSON and re-serializing it can change the bytes (key order, whitespace) and cause verification to fail.
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

The webhook-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. The webhook-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.