Webhooks

Neaten tells your systems when a tour breaks or recovers, when a fix is proposed or applied, and when a tour is published or rolled back. Add an address under Settings → Integrations (Webhooks), or with POST /v1/webhooks. Webhooks are part of Pro and the trial.

Deliveries

Each event is a POST of JSON to your address with two headers: neaten-event (the event type) and neaten-signature (t=<unix seconds>,v1=<hex HMAC-SHA256 of "t.body" with your signing secret>).

{
  "id": "whd_7d1c0a",
  "type": "incident.opened",
  "created_at": "2026-11-22T09:14:03.000Z",
  "data": {
    "id": "inc_8f2k1",
    "tour": "first-invoice",
    "tourName": "Send your first invoice",
    "stepId": "pick-customer",
    "env": "live",
    "source": "runtime",
    "sessions": 14,
    "failures": 9,
    "path": "/invoices/new"
  }
}

Answer with any 2xx. Anything else, or no answer, is tried again after 1 min, 5 min, 30 min, 2 h, 12 h: 6 attempts over about 15 hours. A retry has the same id, so use it to ignore a delivery you've already handled. Addresses must be https:// and reachable from the internet; redirects aren't followed.

Check the signature

Compute the HMAC over the raw body, before parsing it, and compare in constant time:

// Check that a webhook came from Neaten (Node 18+). `body` is the raw request body as text, before JSON.parse;
// `header` is the neaten-signature header; `secret` is your endpoint's signing secret (whsec_…).
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyNeatenSignature(body, header, secret, now = Date.now()) {
  const parts = Object.fromEntries(
    String(header)
      .split(",")
      .map((p) => p.split("=", 2)),
  );
  const t = Number(parts.t);
  // Missing, or older than 5 minutes (a replay). Every retry is signed afresh.
  if (!t || !parts.v1 || Math.abs(now / 1000 - t) > 300) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex");
  return parts.v1.length === expected.length && timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}

Events

incident.opened

A step stopped finding its element for real people, or the daily check couldn't find it.

{
  "id": "inc_8f2k1",
  "tour": "first-invoice",
  "tourName": "Send your first invoice",
  "stepId": "pick-customer",
  "env": "live",
  "source": "runtime",
  "sessions": 14,
  "failures": 9,
  "path": "/invoices/new"
}

incident.resolved

The step works again: people get past it, a fix was applied, or the tour changed.

{
  "id": "inc_8f2k1",
  "tour": "first-invoice",
  "tourName": "Send your first invoice",
  "stepId": "pick-customer",
  "env": "live",
  "source": "runtime",
  "sessions": 0,
  "failures": 0,
  "path": "/invoices/new"
}

tour.published

A version of a tour went live in an environment, from the dashboard, the API, the CLI or an automatic fix.

{
  "tour": "first-invoice",
  "tourName": "Send your first invoice",
  "env": "live",
  "version": 7,
  "by": "Ana Lopez"
}

tour.rolled_back

An earlier version went live again, by someone or because an automatic fix didn't hold.

{
  "tour": "first-invoice",
  "tourName": "Send your first invoice",
  "env": "live",
  "version": 8,
  "by": "Neaten",
  "reason": "automatic fix didn't hold"
}

fix.proposed

Neaten found the element a broken step should point at and is waiting for a decision.

{
  "id": "fix_3m9q",
  "incident": "inc_8f2k1",
  "tour": "first-invoice",
  "stepId": "pick-customer",
  "confidence": 0.82
}

fix.applied

A fix went live, approved by someone or applied automatically.

{
  "id": "fix_3m9q",
  "tour": "first-invoice",
  "stepId": "pick-customer",
  "version": 8,
  "automatic": true
}

tour is the tour's id, as in the tour JSON and /v1/tours/:tour. The incident's id (id on incident events, incident on fix.proposed) works with GET /v1/incidents/:id.