Skip to content

Webhooks

Webhooks push events to your server as they happen: a tool run finished, an audit completed, a change was approved or applied on a website. Each delivery is signed, logged, and retried when your endpoint does not answer.

Creating a webhook

Add a webhook in the dashboard under Integrations → Outgoing webhooks, or with the API (POST /webhooks, scope webhooks:write). Choose the events to receive and enter a public https URL. Webhooks belong to your workspace and receive events from all of its projects.

The signing secret (whsec_…) is shown once, when the webhook is created. Store it with your receiver. Send a test ping event from the dashboard or with POST /webhooks/{webhookId}/test to check your endpoint.

Endpoints must be reachable from the public internet. Private and local addresses (such as localhost or 10.0.0.0/8) are refused. To test locally, use a tunnelling service that gives you a public URL.

Events

EventWhendata contains
tool.completedA tool run finished successfully.executionId, tool, projectId, summary
tool.failedA tool run failed.executionId, tool, error
report.readyA report was generated.reportId, title, projectId, sections, href
project.createdA project was created.id, name, domain, country, language
content.publishedA document was published to a website.documentId, title, projectId, target, postId, link
audit.completedAn SEO audit finished (including scheduled audits).projectId, auditId, siteId, kind, score, summary
site.connectedA website was connected.projectId, site
site.disconnectedA website was disconnected.projectId, site { id, url, name }
site.syncedA connected website finished a full page sync.projectId, siteId, removed, pageCount, collections
change.proposedA change was proposed for a connected website and is waiting for approval.projectId, siteId, change
change.approvedA proposed change was approved.projectId, siteId, change
change.rejectedA proposed change was rejected.projectId, siteId, change
change.appliedAn approved change was applied on the website.projectId, siteId, change
change.failedThe website could not apply an approved change.projectId, siteId, change
change.revertedAn applied change was undone on the website.projectId, siteId, change
change.revert_requestedSomeone asked to undo an applied change. When the site approves changes in its own admin, the undo waits for that approval.projectId, siteId, change
change.revert_rejectedThe site admin rejected a request to undo an applied change; it stays applied.projectId, siteId, change

Change events carry the full change object. A test delivery uses the event type ping with data.message. New event types may be added; ignore types you do not handle.

Payload

Each delivery is an HTTP POST with a JSON body and these headers:

HeaderValue
Content-Typeapplication/json
User-AgentSemanticsOn-Webhooks/1.0
X-SemanticsOn-EventThe event type, e.g. change.applied
X-SemanticsOn-DeliveryThe delivery id (same as id in the body)
X-SemanticsOn-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256>
Body
{
  "id": "cm8dlv0x1000208l4f0c7h2kd",
  "type": "change.applied",
  "created": "2026-11-29T10:42:17.031Z",
  "data": {
    "projectId": "cm8prj0a1000108l4ab12cd34",
    "siteId": "cm8site0b1000308l4ef56gh78",
    "change": {
      "object": "change",
      "id": "cm8chg0c1000408l4ij90kl12",
      "kind": "meta.update",
      "title": "Update meta description on “Espresso guide”",
      "status": "applied",
      "target": {
        "externalId": "42",
        "url": "https://example.com/espresso-guide"
      },
      "payload": {
        "metaDescription": "How to pull a balanced espresso shot at home."
      },
      "previous": {
        "metaDescription": ""
      },
      …
    }
  }
}
FieldDescription
idDelivery id. Stays the same when a delivery is retried or redelivered, so use it to ignore duplicates.
typeThe event.
createdWhen the event happened (ISO 8601).
dataEvent details. Project events include projectId.

Verifying signatures

The signature proves a request came from SemanticsOn and was not altered. It is computed over the timestamp and the raw request body:

signed_payload = "<t>.<raw request body>"
v1 = hex( HMAC-SHA256( key = your webhook secret, message = signed_payload ) )
  1. Read the raw body before any JSON parsing. Re-serialised JSON will not match.
  2. Split X-SemanticsOn-Signature on commas into t and v1.
  3. Reject the request if t is more than 5 minutes from your clock. This stops replayed deliveries.
  4. Compute the HMAC with your secret (the whole whsec_… string) and compare it to v1 in constant time.
import crypto from "node:crypto";
import http from "node:http";

const SECRET = process.env.SEMANTICSON_WEBHOOK_SECRET; // whsec_…
const TOLERANCE_SECONDS = 300;

/** Returns true when the raw body was signed by SemanticsOn with your secret. */
export function verifySemanticsOn(rawBody, signatureHeader, secret = SECRET) {
  const parts = Object.fromEntries(
    String(signatureHeader ?? "").split(",").map((p) => p.trim().split("=", 2)),
  );
  const t = Number(parts.t);
  if (!Number.isInteger(t) || !/^[0-9a-f]{64}$/.test(parts.v1 ?? "")) return false;
  if (Math.abs(Date.now() / 1000 - t) > TOLERANCE_SECONDS) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
  return crypto.timingSafeEqual(expected, Buffer.from(parts.v1, "hex"));
}

// Example with Node's built-in HTTP server: read the body as raw text before parsing.

http.createServer((req, res) => {
  let raw = "";
  req.setEncoding("utf8");
  req.on("data", (chunk) => (raw += chunk));
  req.on("end", () => {
    if (!verifySemanticsOn(raw, req.headers["x-semanticson-signature"])) {
      res.writeHead(400).end("invalid signature");
      return;
    }
    const event = JSON.parse(raw);
    res.writeHead(200).end("ok"); // acknowledge first, then work
    queueMicrotask(() => handleEvent(event));
  });
}).listen(3001);

async function handleEvent(event) {
  // event.id is the delivery id: it stays the same on retries, so use it to skip duplicates.
  if (event.type === "change.applied") {
    console.log("Applied on site", event.data.siteId, event.data.change.title);
  }
}

Timestamp tolerance

Keep your server clock synchronised (NTP). Five minutes is a sensible tolerance; a redelivery is signed again with a fresh timestamp, so it is not rejected.

Responding

  • Answer with any 2xx status within 10 seconds. Anything else, a timeout or a redirect counts as a failure (redirects are not followed).
  • Acknowledge first and do slow work in the background.
  • Deliveries can arrive more than once and out of order. Make handlers idempotent using id, and read the current state from the API when order matters (for example GET /changes/{changeId}).

Retries

A failed delivery is retried automatically, up to 6 attempts in total:

AttemptSent
1As soon as the event happens
21 minute after attempt 1
35 minutes after attempt 2
430 minutes after attempt 3
52 hours after attempt 4
612 hours after attempt 5

After the last attempt the delivery is marked failed. Disabled webhooks receive nothing. The time from the event to the last retry is roughly 15 hours, so a short outage on your side loses nothing.

Delivery log & redelivery

Every delivery is logged with its status (pending while retries remain, succeeded, failed), number of attempts, your endpoint's response status and the first 2,000 characters of its response body.

  • In the dashboard, open the webhook under Integrations to see recent deliveries and redeliver one.
  • With the API, list deliveries with GET /webhooks/{webhookId}/deliveries and send one again with POST /webhooks/{webhookId}/deliveries/{deliveryId}/retry. A manual redelivery is a single attempt.

In the OpenAPI document

Webhook payloads are also described in the webhooks section of the OpenAPI document.