Receive signed event webhooks

Send saved browser events and completed assessments to your server. Verify the signature, acknowledge the delivery and inspect its result in Oraami.

Updated Oraami Inc

Connect an HTTPS endpoint

Webhooks belong to a registered website in its workspace. Use separate sites and destinations for test and production. A verified workspace owner can configure up to five endpoints per website.

  1. Open Webhooks and choose Create webhook. Enter a public HTTPS hostname and path on port 443. The endpoint must resolve publicly. Keep credentials, query strings and fragments out of the URL.
  2. Choose Saved browser events, Completed assessments or both. Give the endpoint a description so your team can identify its purpose.
  3. Create the webhook and copy its signing key into the receiving server’s secret manager when it is shown. Choose Send test event to check the connection.

Choose the events you need

Oraami sends JSON by HTTP POST after the source has been saved. The queue worker performs delivery in the background. A new endpoint receives newly recorded events for its website.

EventFields in data
event.recordedeventId, type, sessionId, visitorId and observedAt for a saved browser event. Replay records are excluded.
assessment.completedanalysisId, sessionId, visitorId, score, evaluatedEventCount, sourceEventCount and sourceThrough for a completed deterministic assessment with measured events.
webhook.testA synthetic delivery with test set to true. It does not identify a visitor.
{
  "version": 1,
  "event": "webhook.test",
  "id": "delivery-id",
  "workspaceId": "workspace-id",
  "siteId": "site-id",
  "createdAt": "2026-12-02T00:00:00.000Z",
  "data": {
    "test": true
  }
}

Verify the signature before processing

Read the original POST body as bytes exactly as received. Take Oraami-Timestamp as Unix seconds and reject timestamps over five minutes from your server clock in either direction. Keep the clock synchronized.

Compute HMAC-SHA256 with the signing key on the timestamp, a literal period and the raw body. Compare the expected hex digest with the v1= digest from Oraami-Signature in constant time. Parsing and serializing JSON first changes the bytes.

After verification, parse the signed body. Require version 1, the intended workspace and site, and an allowed event. Match body.id to Oraami-Idempotency-Key and body.event to Oraami-Event. Claim the signed delivery ID in durable storage before applying side effects. A unique constraint and a transaction with your own outbox make simultaneous retries safe.

import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(rawBody, timestamp, signature, secret) {
  if (!secret || typeof timestamp !== 'string' || !/^[0-9]{1,12}$/.test(timestamp) ||
      typeof signature !== 'string' || !/^v1=[a-f0-9]{64}$/.test(signature) ||
      Math.abs(Math.floor(Date.now() / 1000) - Number(timestamp)) > 300) return false;
  const expected = createHmac('sha256', secret).update(timestamp + '.').update(rawBody).digest();
  return timingSafeEqual(expected, Buffer.from(signature.slice(3), 'hex'));
}

Verify with Python

Pass request body bytes and the two header strings to this function. Keep the secret on the server.

import hashlib, hmac, re, time

def verify(raw, timestamp, signature, secret):
    if not secret or not re.fullmatch(r'[0-9]{1,12}', timestamp or ''):
        return False
    if not re.fullmatch(r'v1=[a-f0-9]{64}', signature or ''):
        return False
    if abs(int(time.time()) - int(timestamp)) > 300:
        return False
    signed = timestamp.encode('ascii') + b'.' + raw
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature[3:])

Acknowledge and inspect a delivery

Return a small 2xx response within eight seconds after durable acceptance. A duplicate already accepted can receive the same 2xx response. For an unavailable destination, timeout or non-2xx response, the worker makes up to five total attempts with exponential backoff starting at one second. The delivery ID stays stable and each attempt is signed again. Concurrent jobs may arrive out of order.

Webhooks shows the most recent attempt and the last 24 hours of activity, including test deliveries. Inspect recent delivery history for the event, status and attempt count. A cancelled event can indicate that the endpoint changed or that the source data is no longer retained.

To change a URL or replace a signing key, verify a new endpoint before removing the old one. Endpoints have distinct delivery IDs. During an overlap, use the source eventId or analysisId when you need to deduplicate across endpoints.

Related guides