Skip to content
Webhooks
Webhooks

Subscribe an endpoint to a business's domain events and Sessions delivers each one as a signed HTTP POST. Use them to sync bookings, purchases, and opt-ins into your own systems in near real time.

Create and manage endpoints in the business admin under Settings → Webhooks: add a URL, choose which events to receive, and reveal or rotate the signing secret.

Events

The event types you can subscribe to today. The key is what arrives in the payload's type field.

booking.confirmed

A booking was confirmed — paid, free, promoted off the waitlist, or an approved appointment request. One per booking, however many people it admits.

purchase.completed

An order completed. One per order, whatever it contained.

entitlement.created

A pass, membership, or gift card was issued by an order. One per item, so buying three passes sends three.

visit.completed

A person's visit ended: one per person per session, once the session's end time has passed. Carries visitNumber, which visit at the business it was (1 for a first visit). A visit counts a confirmed place in a session that was not cancelled; when staff checked anyone in at that session, only checked-in people count.

challenge.completed

A participant reached a challenge's goal. One per sign-up.

participant.lapsed

A participant has not visited for a number of days (days). Sent once per lapse, for each day count a journey listens for, so a return and a second lapse sends again.

participant.visit_anniversary

A year (or more, in years) since a participant's first visit. One per year.

membership.anniversary

A year (or more, in years) since a bought membership started. One per membership per year; staff-granted and imported memberships are left out.

Renamed events

These keys shipped under older names. They are no longer offered, but an endpoint that already subscribes to one keeps receiving the renamed event under the old key, in the payload shape that key always had — nothing breaks and nothing needs migrating. Switch to the new key when convenient.

activity_registration.confirmed → booking.confirmed

Delivered for every booking.confirmed. Its data.id is now a resolvable Booking GID; it used to name an ActivityRegistration, a type the API no longer has.

product_purchase.completed → purchase.completed

Delivered for every purchase.completed. Its data.id is now the order’s resolvable Purchase GID, pricePaid is the order total, and product.id is set only when the order was for exactly one product.

Payload

Every delivery is a JSON envelope. id is the event id — stable across retries, so you can dedupe on it.

{
  "id": "evt_8f2c1a09b3",
  "type": "participant.marketing_consent_granted",
  "apiVersion": "2026-06-01",
  "occurredAt": "2026-06-01T14:32:08.000Z",
  "resourceReferences": [
    "gid://Sessions/BusinessParticipant/p_91ac"
  ],
  "data": {
    "id": "gid://Sessions/BusinessParticipant/p_91ac",
    "name": "Jordan Vega",
    "email": "jordan@example.com",
    "emailMarketingConsent": {
      "status": "granted",
      "at": "2026-06-01T14:32:08.000Z"
    }
  }
}

data is the event's resource as a minimized node — the same field names and opaque GIDs the GraphQL API uses, with a reduced field set. Take the GID and re-query the API for the full object. previousAttributes is included only for events that change existing state.

Verifying signatures

Every request carries these headers:

Sessions-Signature: t=<unix-seconds>,v1=<hex HMAC-SHA256>
Sessions-Event-Type: booking.confirmed
Sessions-Webhook-Id: <per-delivery id>

The signature is HMAC-SHA256 over "<timestamp>.<rawBody>" using the endpoint's signing secret, hex-encoded. Recompute it over the exact bytes received and compare in constant time.

Language
import {createHmac, timingSafeEqual} from 'node:crypto';

// Express example. `req.rawBody` must be the exact bytes we sent —
// verify before any JSON parsing re-serializes them.
export function verify(req, signingSecret) {
  const header = req.get('Sessions-Signature') ?? ''; // "t=1717250000,v1=abc123…"
  const parts = Object.fromEntries(
    header.split(',').map((part) => part.split('=')),
  );

  const expected = createHmac('sha256', signingSecret)
    .update(`${parts.t}.`)
    .update(req.rawBody)
    .digest('hex');
  const received = parts.v1 ?? '';

  // timingSafeEqual throws on unequal lengths, so check those first.
  const ok =
    received.length === expected.length &&
    timingSafeEqual(Buffer.from(expected), Buffer.from(received));

  // Reject stale timestamps to bound replay (5-minute tolerance).
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return ok && fresh;
}

Also check the timestamp: reject a delivery signed more than five minutes ago, so a captured request can’t be replayed later. Rotate the secret from the endpoint’s page if it ever leaks.

Retries & delivery

Respond with any 2xx status to acknowledge. A timeout, a network error, a 5xx, or a 429 is retried with escalating backoff (1m, 5m, 30m, 2h, 6h). Any other 4xx is treated as a permanent failure and dead-lettered without retrying, since it won't succeed on a retry.

After six failed attempts (or a permanent 4xx) a delivery is dead-lettered and no longer retried. Re-enable or fix the endpoint and future events will deliver normally.

Deliveries are not ordered — retries and backoff can reorder them. Use the envelope's occurredAt to order events, and id to dedupe.