Outgoing Webhooks

An outgoing webhook notifies another service when something happens on your site. For example, a Slack channel gets a message when a post goes live, a Zapier flow stores a new comment, or your CRM gets a new row when a member registers. jekcms sends a signed JSON POST to a URL you own as soon as the event happens.

The Outgoing Webhooks form, with the five events it can send
The checkbox row lists all five events.

This page covers the outgoing direction. For external tools that send content into your site through /api/v1/webhook/{action}, see Webhooks under Automation.

Setting one up

Webhook targets live on the same screen as API keys: Admin → API Keys, in the Outgoing Webhooks box. A target needs a name, a URL that starts with https://, and a set of events to subscribe to. Plain http is refused.

Saving generates a signing secret and shows it once, on that screen. It is stored encrypted. If the install cannot encrypt it, the webhook is not created, because a signing secret stored in plain text is as useful to an attacker as an API key.

A Test button next to each target sends a delivery with the event name test and the body {"hello": "jekcms"}, so you can quickly check that your receiver is reachable and that your signature check works.

The five events

| Event | Fires when | |---|---| | post_published | A post becomes published: on creation, when a draft is published, or when the scheduler publishes a scheduled post | | post_updated | An already-published post is saved again | | post_deleted | A post is moved to trash or permanently deleted | | comment_created | A visitor submits a comment, whether it is approved or pending | | member_registered | A member confirms their email address |

Subscribing to nothing is the same as subscribing to everything: a target with an empty event list receives every event. post_published does not fire again when you edit a live post (post_updated covers that case), so newsletter and social integrations that use it do not send twice.

The envelope

Every delivery has the same four top-level keys:

{
  "event": "post_published",
  "site": "https://yoursite.com",
  "timestamp": "2026-04-21T14:32:17+03:00",
  "data": { }
}

timestamp is ISO 8601 in the site's timezone, not UTC. site is the site's public base URL, so one receiver can serve several jekcms installs.

These headers are sent with it:

Content-Type: application/json
User-Agent: jekcms-webhook/1.0
X-Jek-Event: post_published
X-Jek-Signature: sha256=<64 hex characters>

Payloads

The three post events share one shape:

{
  "id": 123,
  "title": "10 high-protein breakfasts",
  "slug": "high-protein-breakfasts",
  "status": "published",
  "url": "https://yoursite.com/high-protein-breakfasts"
}

comment_created carries the comment and the post it belongs to, with status telling you whether it is already live or waiting in the moderation queue:

{
  "id": 456,
  "post_id": 123,
  "author_name": "Alex",
  "status": "pending"
}

member_registered is the smallest of the three:

{
  "id": 42,
  "name": "Buyer Name",
  "email": "buyer@example.com"
}

These payloads are kept small. They contain an identifier and enough context to decide whether the event is relevant; for the full record, call the REST API with that id.

Verifying the signature

The signature is an HMAC-SHA256 of the raw request body, hex-encoded and prefixed with sha256=, keyed with the secret shown when you created the webhook.

const crypto = require('crypto');

const expected = 'sha256=' + crypto
  .createHmac('sha256', process.env.JEK_WEBHOOK_SECRET)
  .update(rawBody)              // the raw bytes - before JSON.parse
  .digest('hex');

const given = req.headers['x-jek-signature'] || '';
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(given))) {
  return res.status(401).end();
}

Two details matter here. Compute the signature over the bytes you received, not over a re-serialised object, because reformatting the JSON changes the hash. Compare the values in constant time (timingSafeEqual in Node, hmac.compare_digest in Python); a plain === comparison leaks timing information on an endpoint that runs for a long time.

Delivery behaviour and limits

Deliveries are queued while the request runs and sent after the response has been handed to the visitor, so a slow receiver never slows down your site. Connection timeout is 2 seconds and the whole request times out at 4.

A single page load sends at most 20 deliveries and spends at most about 12 seconds doing so. Deliveries beyond that limit are written to the delivery log marked deferred instead of being dropped, so you can see them and re-send them by hand.

There is no automatic retry. A non-2xx response, a timeout or a connection failure is recorded with its status code and error, and the attempt ends there. If delivery is important, make your receiver accept the request quickly and do the work asynchronously, or check the delivery log and re-send. A 410 Gone is treated like any other failure; it does not disable the webhook.

The delivery log

Every attempt is stored with its event, URL, HTTP status, the request body that was sent and a truncated copy of the response. The admin screen shows the most recent eight per webhook, each with a Re-send button that sends the stored payload again to the target's current URL. This is useful after you fix a receiver that was down.

The log keeps the newest hundred rows per webhook and deletes older ones, so it does not keep growing on a busy site. Signing secrets never appear in a stored payload.

Be the first to know

New features, release notes and CMS guides. We send a couple of emails a month.