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.
- GET
/webhooks/eventsList webhook events - GET
/webhooksList webhooks - POST
/webhooksCreate a webhook - GET
/webhooks/{webhookId}Get a webhook - PATCH
/webhooks/{webhookId}Update a webhook - DELETE
/webhooks/{webhookId}Delete a webhook - POST
/webhooks/{webhookId}/testSend a test event - GET
/webhooks/{webhookId}/deliveriesList deliveries - POST
/webhooks/{webhookId}/deliveries/{deliveryId}/retryRedeliver now
localhost or 10.0.0.0/8) are refused. To test locally, use a tunnelling service that gives you a public URL.Events
| Event | When | data contains |
|---|---|---|
tool.completed | A tool run finished successfully. | executionId, tool, projectId, summary |
tool.failed | A tool run failed. | executionId, tool, error |
report.ready | A report was generated. | reportId, title, projectId, sections, href |
project.created | A project was created. | id, name, domain, country, language |
content.published | A document was published to a website. | documentId, title, projectId, target, postId, link |
audit.completed | An SEO audit finished (including scheduled audits). | projectId, auditId, siteId, kind, score, summary |
site.connected | A website was connected. | projectId, site |
site.disconnected | A website was disconnected. | projectId, site { id, url, name } |
site.synced | A connected website finished a full page sync. | projectId, siteId, removed, pageCount, collections |
change.proposed | A change was proposed for a connected website and is waiting for approval. | projectId, siteId, change |
change.approved | A proposed change was approved. | projectId, siteId, change |
change.rejected | A proposed change was rejected. | projectId, siteId, change |
change.applied | An approved change was applied on the website. | projectId, siteId, change |
change.failed | The website could not apply an approved change. | projectId, siteId, change |
change.reverted | An applied change was undone on the website. | projectId, siteId, change |
change.revert_requested | Someone 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_rejected | The 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:
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | SemanticsOn-Webhooks/1.0 |
X-SemanticsOn-Event | The event type, e.g. change.applied |
X-SemanticsOn-Delivery | The delivery id (same as id in the body) |
X-SemanticsOn-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256> |
{
"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": ""
},
…
}
}
}| Field | Description |
|---|---|
id | Delivery id. Stays the same when a delivery is retried or redelivered, so use it to ignore duplicates. |
type | The event. |
created | When the event happened (ISO 8601). |
data | Event 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 ) )- Read the raw body before any JSON parsing. Re-serialised JSON will not match.
- Split
X-SemanticsOn-Signatureon commas intotandv1. - Reject the request if
tis more than 5 minutes from your clock. This stops replayed deliveries. - Compute the HMAC with your secret (the whole
whsec_…string) and compare it tov1in 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
2xxstatus 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 exampleGET /changes/{changeId}).
Retries
A failed delivery is retried automatically, up to 6 attempts in total:
| Attempt | Sent |
|---|---|
| 1 | As soon as the event happens |
| 2 | 1 minute after attempt 1 |
| 3 | 5 minutes after attempt 2 |
| 4 | 30 minutes after attempt 3 |
| 5 | 2 hours after attempt 4 |
| 6 | 12 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}/deliveriesand send one again withPOST /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.