Outbound webhooks
Subscribe to published content changes and verify signed deliveries
Basker sends an HTTPS POST to your endpoint when a subscribed content type is created, updated, or deleted. A webhook fires only for a published change. Saving a draft does not send an event.
Create a webhook
- Open Settings → API → Webhooks. Access depends on your plan and API settings permission.
- Choose Add webhook. Enter a label, an HTTPS endpoint, and the content types and
create,update, ordeleteevents you want. - Save the webhook and copy its
whsec_signing secret. Store it in your receiver's secrets manager. The full secret is shown only at creation or rotation. - Send a test ping and check your endpoint's response in the delivery log.
The endpoint must have a public HTTPS address on port 443. Basker rejects private, loopback, and link-local destinations, including addresses returned by DNS. It checks the address when you save the webhook and again before each delivery. Redirects are not followed.
Event format
Each request contains a JSON envelope:
{
"id": "4e76b3a0-63e4-4f10-b4a7-f2164b482537",
"version": "2026-10-01",
"event": "pages.update",
"tenant": "tenant-id",
"createdAt": "2026-10-03T12:00:00.000Z",
"data": {
"collection": "pages",
"id": "page-id",
"doc": { "id": "page-id", "title": "Updated page" }
}
}Content-change event values have the form <content-type>.<create|update|delete>. A test delivery uses ping. data.doc is the content snapshot for a content event, without internal or sharing metadata. A delete event contains the last known snapshot. Treat version as the payload format version and handle future versions explicitly.
Use id to make processing idempotent. The same value is also sent in the Basker-Delivery header. Retries and manual redelivery can repeat an event, so record successfully processed IDs before applying side effects again.
Verify the signature
The Basker-Signature header contains a Unix timestamp and one or more SHA-256 signatures:
Basker-Signature: t=1791028800,v1=<hex-hmac-sha256>Each v1 is the HMAC of the exact UTF-8 bytes timestamp + "." + raw request body, using the webhook's whsec_ secret as the key. Verify the signature before parsing JSON. Reject a missing or malformed header, a timestamp more than five minutes from your clock, or a request for which no signature matches. Keep your server clock synchronized.
This Node.js example accepts any matching v1 value. During secret rotation, Basker sends signatures for both the new and previous secrets for the grace period, so a receiver can keep both secrets temporarily:
import { createHmac, timingSafeEqual } from "node:crypto";
function verifyBaskerWebhook(rawBody, header, secrets, now = Date.now()) {
const parts = header?.split(",") ?? [];
const timestampPart = parts.find((part) => part.startsWith("t="));
const timestamp = timestampPart?.slice(2);
if (!timestamp || !/^\d+$/.test(timestamp)) return false;
const seconds = Number(timestamp);
if (!Number.isSafeInteger(seconds) || Math.abs(now - seconds * 1000) > 300_000) return false;
const signatures = parts
.filter((part) => part.startsWith("v1="))
.map((part) => part.slice(3))
.filter((hex) => /^[a-f0-9]{64}$/.test(hex))
.map((hex) => Buffer.from(hex, "hex"));
if (signatures.length === 0) return false;
const signedBody = Buffer.concat([
Buffer.from(`${timestamp}.`, "utf8"),
rawBody,
]);
return secrets.some((secret) => {
const expected = createHmac("sha256", secret).update(signedBody).digest();
return signatures.some((signature) => timingSafeEqual(signature, expected));
});
}
// In an HTTP handler, obtain the body as a Buffer before JSON parsing.
// Return a 2xx response only after you have safely accepted the event.Pass the original request body as a Buffer; re-serializing parsed JSON changes the bytes and invalidates the signature. Never log the secret or the full signature header.
Rotation, retries, and delivery history
Rotate the secret from the webhook's detail view. The previous secret remains valid for a configurable grace period, which defaults to 24 hours. Update your receiver with the new secret during that window and then remove the old one. While the grace period is active, Basker includes both signatures in the header.
A 2xx response marks a delivery successful. Other responses and timeouts are retried up to six total attempts, with delays of 1 minute, 5 minutes, 30 minutes, 2 hours, and 6 hours. Each request has a 10-second timeout. Make your receiver respond promptly and process longer work asynchronously.
The Delivery log shows request and response details, attempt history, and status for the last 30 days. You can filter by event or status and redeliver an event after fixing a problem. A webhook is automatically disabled after 20 consecutive failures; Basker emails tenant administrators. An administrator must re-enable it. You can also pause a webhook to stop deliveries temporarily, then resume it, or delete it when the integration is no longer needed.