Webhooks reference

Webhooks push events from the platform to your own HTTPS endpoints: an action was applied, an object changed, a writeback failed, an agent finished its run. Each event is signed with HMAC-SHA256, delivered at least once, retried with backoff for 72 hours and ordered per subject, so a receiver can be both simple and correct

SignatureHMAC-SHA256 over id, timestamp and body, with two secrets during rotation
DeliveryAt least once, ordered per subject, stable event ids for deduplication
RetriesExponential backoff with jitter for 72 hours, then manual redelivery
TimeoutRespond with a 2xx within 10 s; process the event afterwards

In the platform today

Built
  • Signed webhooks run in the platform service, beside email, Slack and Teams notifications
  • Events are read from the operational tables the platform already writes in the same commit as each change, proposals and agent runs from the audit log, with times on the platform clock
  • They are signed with the three headers below, retried on the schedule below for 72 hours with jitter, then copied to a dead-letter table from which they can be replayed with their original id and sequence
  • Per-subject order, the one hour head-of-line limit, 410 Gone, Retry-After, the 24 hour secret overlap, runAs access checks and the limit of 50 subscriptions work as described
  • Every event type and filter in the tables below, including monitor.alert.opened, monitor.alert.escalated and monitor.alert.resolved from monitors, the filters actionType, objectType, agent, group, user and objectChanged, and the endpoints under managing subscriptions
  • object.changed (op created, modified or summary) and object.deleted come from the object tables, with before and after values as the subscription's runAs may see them and the object's version; they are opt-in, needing an event pattern that starts with object and an object type, and a commit over 500 objects is one summary event
  • Up to maxConcurrency subjects are in flight per subscription (10 by default, 50 at most), and finished deliveries, attempts, dead letters and events are removed after 30 days (retentionDays)
  • Subscriptions are managed in Admin, then Webhooks and notifications
On request
  • The other event types, the site filter, the envelope's traceparent, the payload href, mutual TLS and egress addresses

How webhooks work

Events are produced inside the same transaction as the change they describe. When the action service commits an action, it writes the event to an outbox table in the same commit, so an event exists if and only if the change exists. A dispatcher reads the outbox, matches each event against your subscriptions, signs it with the subscription's secret and delivers it. Nothing about a slow or failing receiver can delay or roll back the change itself

Producers Action service Sync · writeback Agents · edge Outbox Same transaction Dispatcher Match subscriptions Order per subject Sign with HMAC-SHA256 Your endpoint 2xx within 10 s retry for 72 h Delivery log Every attempt, 30 days
Because events come from an outbox written in the same commit, a webhook never reports a change that did not happen and never misses one that did

A subscription names an HTTPS URL, the event types it wants and optional filters. Create it in Admin, then Webhooks and notifications, or through the API as an administrator or a member of a group in webhooks.managers

  • events takes event types or glob patterns such as action.*
  • runAs names the person or service account whose access shapes what the subscription receives, and defaults to the caller; only an administrator can set someone else
  • Events about an object type or row that runAs cannot see are skipped, and the skip is recorded in the delivery log
  • On request, the API adds a webhooks:manage scope for OAuth clients
POST /api/v2/webhooks HTTP/1.1
Authorization: Bearer <access token>
Content-Type: application/json

{
  "name": "maintenance-board",
  "url": "https://hooks.example.com/ontology",
  "description": "Maintenance board and MIS reconciliation",
  "events": ["action.applied", "writeback.failed", "agent.run.completed"],
  "filter": {
    "actionType": ["ground-aircraft", "swap-aircraft"],
    "objectType": ["aircraft", "flight"]
  },
  "runAs": "mc.lee"
}

HTTP/1.1 201 Created
{
  "webhook": {
    "id": "wh_01JB2S0D9E7K4Q",
    "name": "maintenance-board",
    "origin": "api",
    "url": "https://hooks.example.com/ontology",
    "description": "Maintenance board and MIS reconciliation",
    "events": ["action.applied", "writeback.failed", "agent.run.completed"],
    "filter": {
      "actionType": ["ground-aircraft", "swap-aircraft"],
      "objectType": ["aircraft", "flight"]
    },
    "runAs": "mc.lee",
    "status": "active",
    "maxConcurrency": 10,
    "secret": { "generation": 1, "overlapUntil": null },
    "createdBy": "mc.lee",
    "createdAt": "2026-10-24T13:50:12Z"
  },
  "secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Subscriptions can also be declared in ontology.yaml under webhooks.subscriptions, with the secret named as an environment variable, and webhooks.allowHosts limits where any destination may point. A subscription also takes the objectChanged filters below and maxConcurrency, the subjects in flight at once

{
  "url": "https://hooks.creamery.example/ontology",
  "events": ["object.changed"],
  "filter": {
    "objectChanged": {
      "objectType": "delivery",
      "properties": ["status", "eta", "crossing"]
    }
  },
  "maxConcurrency": 10
}
The secret is shown once

Store the secret in your secret manager when the subscription is created. It cannot be read back later; if it is lost, rotate it

Event types

Event type names are lower case and dotted: the resource, then what happened. New event types are added without notice and are never delivered to existing subscriptions unless you add them, so a receiver is never surprised by a type it did not ask for

Event typeEmitted whenSubject
action.appliedAn action commits, from any client, app or approved agent proposalThe action's first object parameter, or the action log entry if it has none
object.changedAn object matching the filter is created or changes in a watched property, from a source sync or an actionThe object
object.deletedAn object matching the filter is removed, by its source or by an actionThe object
writeback.deliveredA system of record accepted the edits of an actionThe action log entry
writeback.failedWriteback exhausted its retries or got a permanent error, and the edits moved to the dead-letter queueThe action log entry
action.proposedAn agent, automation or person staged an action for approvalThe object, or the proposal
proposal.approved, proposal.rejectedA person decided a staged actionThe object, or the proposal
proposal.expiredA staged action passed its expiry before anyone decided itThe object, or the proposal
agent.run.completedA run ended, with its status, mode and proposalsThe run
pipeline.build.failedA pipeline build failed, including a failed data quality gateThe dataset
sync.failedAn object type's sync run failedThe object type
alert.firedAn alert or a time series alert openedThe object, or the alert
monitor.alert.openedA monitor rule's condition held and an alert opened, such as a pipeline failing twice in a row or a dataset arriving lateThe alert
monitor.alert.escalatedAn open alert moved to a higher severity, after escalateAfter failing evaluations or when a dataset is far outside its usual boundsThe alert
monitor.alert.resolvedThe condition behind an alert cleared and the alert resolved on its own. Sent when monitors.sendResolved is trueThe alert
notification.createdAn action's notify: entry wrote a notificationThe object
webhook.testYou sent a test event from the console or the APIThe subscription
webhook.disabledA subscription was disabled after failing for the whole retry window, or by 410 Gone. Sent to notification routesThe subscription

On request, further events cover ontology proposals, edge agents, access requests, certification and deprecation

Filters

FilterApplies toBehaviour
actionTypeaction.*, proposal.*, writeback.*Only these action types
objectTypeEvents about an objectOnly these object types
group, usernotification.createdOnly notifications for these groups or people
objectChanged.objectTypeobject.changed, object.deletedRequired. One object type per subscription filter
objectChanged.propertiesobject.changedOnly when one of these properties changes. Without it, any visible property change fires
objectChanged.whereobject.changed, object.deletedA property equal to a value or one of a list, checked on the new version, or the removed one for object.deleted. On request, any filter on indexed properties
agentagent.*, action.proposed, decision.*Only these agents
Do not subscribe to every change on a busy type

An object.changed subscription on a type fed by sensors can produce thousands of events a minute. Watch the properties a person would act on, add a where clause, or use an SDK subscription for live screens instead

Payload schema

Every event shares one envelope. The data object depends on the type. Bodies are UTF-8 JSON, sent with Content-Type: application/json, and are at most 256 KB; a larger data is replaced by {"truncated": true, "size": …}. On request, it also carries an href to fetch the full resource through the REST API

FieldTypeMeaning
idStringUnique event id, prefixed evt_. Stable across retries and redeliveries; use it to deduplicate
typeStringThe event type
specVersionStringEnvelope version, 1.0. Breaking changes ship as a new version you opt in to
createdAtTimestampWhen the change committed, not when the delivery was sent
tenant, ontologyStringWhere the event came from
subjectStringThe resource name the event is about; also the ordering key
sequenceIntegerMonotonic per subject and subscription. A gap or a lower number means an out-of-order or missed event
actorObjectWho caused the change: a user, a service principal, a source sync or an agent acting on behalf of a person
dataObjectThe type-specific payload

Example: action.applied

{
  "id": "evt_4K2Q8N7A4KX2M9T1B0C5D7E2RA",
  "type": "action.applied",
  "specVersion": "1.0",
  "createdAt": "2026-10-24T13:42:05.877Z",
  "tenant": "aircraft",
  "ontology": "aircraft",
  "subject": "msrn:ontology:aircraft:object/aircraft/407",
  "sequence": 18,
  "actor": { "type": "user", "id": "mc.lee", "via": { "app": "api" } },
  "data": {
    "actionLogId": "alog_01JB2Q8KZ3F6W9DT",
    "actionType": "ground-aircraft",
    "actionName": "Ground aircraft",
    "objectType": "aircraft",
    "objectKey": "407",
    "objectTitle": "407 · C-GMKG",
    "parameters": { "aircraft": "407", "reason": "Bird strike on approach, YYT" },
    "edits": 1,
    "writeback": "delivered",
    "proposal": null,
    "reason": null
  }
}

On request, payloads carry more detail, such as each object an action edited, a structured writeback error and an agent's published version and usage

Example: writeback.failed

{
  "id": "evt_9T1H0V5QZ8M2K4X7B3C6D0E1FA",
  "type": "writeback.failed",
  "specVersion": "1.0",
  "createdAt": "2026-10-24T14:12:40.204Z",
  "tenant": "aircraft",
  "ontology": "aircraft",
  "subject": "msrn:ontology:aircraft:action-log/alog_01JB2SZQ4W1M",
  "sequence": 1,
  "actor": { "type": "service", "id": "service:writeback" },
  "data": {
    "actionLogId": "alog_01JB2SZQ4W1M",
    "actionType": "ground-aircraft",
    "objectType": "aircraft",
    "objectKey": "407",
    "system": "maintenance",
    "operation": "set-aircraft-status",
    "attempts": 5,
    "idempotencyKey": "alog_01JB2SZQ4W1M:maintenance:set-aircraft-status",
    "lastError": "maintenance: no row matches fleet_number 407"
  }
}

Example: agent.run.completed

{
  "id": "evt_7B3C2D9F0A1E4K6M8Q2R5T7W9X",
  "type": "agent.run.completed",
  "specVersion": "1.0",
  "createdAt": "2026-10-24T13:44:52.318Z",
  "tenant": "aircraft",
  "ontology": "aircraft",
  "subject": "msrn:ontology:aircraft:agent-run/aog-desk/run_01JB2R4C7Q",
  "sequence": 1,
  "actor": { "type": "agent", "id": "mc.lee", "agent": "aog-desk" },
  "data": {
    "agent": "aog-desk",
    "run": "run_01JB2R4C7Q",
    "status": "completed",
    "mode": "playbook",
    "proposals": ["prop_01JB2R5D8K"],
    "members": null
  }
}

Example: monitor.alert.opened

{
  "id": "evt_7M3R9P2B5KX8N4T1C0D6E2Q9WA",
  "type": "monitor.alert.opened",
  "specVersion": "1.0",
  "createdAt": "2026-10-24T06:31:00.000Z",
  "tenant": "aircraft",
  "ontology": "aircraft",
  "subject": "msrn:ontology:aircraft:monitor-alert/mon_01JBA4Q6R2",
  "sequence": 1,
  "actor": { "type": "service", "id": "service:monitors" },
  "data": {
    "id": "mon_01JBA4Q6R2",
    "rule": "pipeline-failing",
    "ruleName": "Pipeline failing",
    "kind": "pipeline",
    "resource": "fleet",
    "resourceName": "Fleet status",
    "severity": "high",
    "state": "open",
    "value": 2,
    "threshold": 2,
    "message": "The latest 2 builds failed",
    "runbook": "https://wiki.example/runbooks/pipelines",
    "change": "opened",
    "text": "High: Pipeline Fleet status: The latest 2 builds failed (Pipeline failing)"
  }
}

Only administrators and the groups in monitors.groups receive monitor events: a subscription whose runAs is neither skips them. Rules, checks and severities are described on monitors and alerts

An event about an object type that the subscription's runAs cannot see, or an object outside their row policy, is skipped and the skip is recorded. Property values inside object.changed events respect the subscription principal's field access and access labels

  • A property hidden from them is omitted
  • A sealed property is opened only if they hold its label
  • The row policy is checked on both versions; an object leaving their rows arrives as object.deleted
  • A change to nothing they can see sends nothing

On request, a masked property arrives masked. If an access label on an object would require the principal to hold an access label it does not, the event is not delivered at all and the skip is counted in the delivery log

Example: object.changed

Each commit to an object table gives one event per object, in the same order as its action.applied events. before and after hold the changed properties; object.deleted carries the key and version only

{
  "id": "evt_2M8Q4N7A1KX5B9T3C0D6E2F7RA",
  "type": "object.changed",
  "specVersion": "1.0",
  "createdAt": "2026-10-24T13:42:06.104Z",
  "tenant": "aircraft",
  "ontology": "aircraft",
  "subject": "msrn:ontology:aircraft:object/aircraft/407",
  "sequence": 19,
  "data": {
    "objectType": "aircraft",
    "objectKey": "407",
    "op": "modified",
    "version": 12,
    "changed": ["status", "statusReason"],
    "before": { "status": "In service", "statusReason": null },
    "after": { "status": "AOG", "statusReason": "Bird strike on approach, YYT" }
  }
}

Verifying signatures

Every delivery carries three headers. Verify them before parsing the body, against the raw bytes exactly as received; re-serializing parsed JSON changes whitespace and breaks the signature

HeaderExampleMeaning
MS-Webhook-Idevt_01JB2Q8N7A4KX2The event id, the same as id in the body
MS-Webhook-Timestamp1792849325Unix seconds when this attempt was signed
MS-Webhook-Signaturev1=5d8c0f…,v1=a913be…One or more comma-separated signatures; two during a secret rotation
  1. Build the signed content. Concatenate the id, a period, the timestamp, a period and the raw body bytes: {id}.{timestamp}.{body}
  2. Compute the expected signature. HMAC-SHA256 of that content, keyed with the subscription secret as UTF-8 bytes, encoded as lower-case hex
  3. Compare in constant time. Accept the delivery if any v1= value in the header matches. Never use a plain string comparison
  4. Check the timestamp. Reject a timestamp more than 5 minutes from your clock, which stops an intercepted delivery from being replayed later
import { createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const TOLERANCE_S = 300;

export function verifyWebhook(
  rawBody: Buffer,
  headers: Record<string, string | string[] | undefined>,
  secrets: string[],
): boolean {
  const id = headers["ms-webhook-id"];
  const ts = headers["ms-webhook-timestamp"];
  const sigHeader = headers["ms-webhook-signature"];
  if (typeof id !== "string" || typeof ts !== "string") return false;
  if (typeof sigHeader !== "string") return false;

  const age = Math.abs(Date.now() / 1000 - Number(ts));
  if (!Number.isFinite(age) || age > TOLERANCE_S) return false;

  const signed = Buffer.concat([Buffer.from(`${id}.${ts}.`, "utf8"), rawBody]);
  const received = sigHeader
    .split(",")
    .map((s) => s.trim())
    .filter((s) => s.startsWith("v1="))
    .map((s) => Buffer.from(s.slice(3), "hex"));

  return secrets.some((secret) => {
    const expected = createHmac("sha256", secret).update(signed).digest();
    return received.some(
      (sig) => sig.length === expected.length && timingSafeEqual(sig, expected),
    );
  });
}

const app = express();
const secrets = [process.env.MS_WEBHOOK_SECRET!, process.env.MS_WEBHOOK_SECRET_NEXT]
  .filter(Boolean) as string[];

// express.raw keeps the exact bytes; do not put express.json() in front of this route
const raw = express.raw({ type: "application/json", limit: "512kb" });
app.post("/ontology", raw, async (req, res) => {
  if (!verifyWebhook(req.body, req.headers, secrets)) return res.sendStatus(401);
  const event = JSON.parse(req.body.toString("utf8"));
  await queue.enqueue(event);   // acknowledge fast, do the work off the request path
  res.sendStatus(204);
});
import hashlib
import hmac
import os
import time

from flask import Flask, abort, request

TOLERANCE_S = 300


def verify_webhook(raw_body: bytes, headers, secrets: list[str]) -> bool:
    msg_id = headers.get("MS-Webhook-Id")
    ts = headers.get("MS-Webhook-Timestamp")
    sig_header = headers.get("MS-Webhook-Signature")
    if not (msg_id and ts and sig_header):
        return False
    try:
        if abs(time.time() - int(ts)) > TOLERANCE_S:
            return False
    except ValueError:
        return False

    signed = f"{msg_id}.{ts}.".encode("utf-8") + raw_body
    received = [p.strip()[3:] for p in sig_header.split(",") if p.strip().startswith("v1=")]
    for secret in secrets:
        expected = hmac.new(secret.encode("utf-8"), signed, hashlib.sha256).hexdigest()
        if any(hmac.compare_digest(expected, sig) for sig in received):
            return True
    return False


app = Flask(__name__)
SECRETS = [
    s
    for s in (os.environ.get("MS_WEBHOOK_SECRET"), os.environ.get("MS_WEBHOOK_SECRET_NEXT"))
    if s
]


@app.post("/ontology")
def ontology_webhook():
    raw = request.get_data(cache=False)   # raw bytes, before any JSON parsing
    if not verify_webhook(raw, request.headers, SECRETS):
        abort(401)
    enqueue(request.get_json(force=True))
    return "", 204

Rotating the secret

Rotate with POST /api/v2/webhooks/{id}:rotateSecret or from Admin, then Webhooks and notifications. The response returns the new secret. For the next 24 hours every delivery is signed with both the old and the new secret, so the header carries two v1= values; deploy the new secret to your receiver in that time and either signature will verify. After 24 hours only the new secret signs. To end the overlap early, call the endpoint with {"expireOldNow": true}. A subscription declared in ontology.yaml rotates by setting secretNext to a second environment variable

Delivery and retries

A delivery succeeds when your endpoint returns any 2xx status within 10 seconds, with a 3 second connect timeout. Anything else is a failed attempt and is retried, except 410 Gone, which disables the subscription immediately because the endpoint has told us it no longer exists. Redirects are not followed. Each delay below counts from the previous attempt. For 429 and 503, a Retry-After header is honoured for up to one hour

AttemptDelayElapsed, roughly
1Immediate0
230 s30 s
31 minute1.5 minutes
42 minutes3.5 minutes
55 minutes9 minutes
615 minutes24 minutes
730 minutes54 minutes
8 to 131 hour eachAbout 7 hours
14 onward3 hours each, until 72 hours have passed72 hours, about 35 attempts in all

Each delay has up to 20% random jitter so that a receiver recovering from an outage is not hit by every retry at once. Each attempt is signed afresh with a new timestamp, so a retry is never rejected by the 5 minute replay check

After 72 hours

An event that has not been delivered after 72 hours is marked failed and copied to the dead-letter table. The delivery log keeps every attempt with its status code, latency and the first 1 KB of the response body, for 30 days by default (retentionDays)

Redeliver one delivery with POST /api/v2/webhooks/deliveries/{id}:redeliver, or replay dead letters singly or by time range with POST /api/v2/webhooks/dead-letters:replay and {"ids": [...]} or {"destination": "wh_…", "since": "2026-10-24T09:00:00Z"}. A redelivered event keeps its original id and sequence

If every delivery to a subscription has failed for 72 hours, the subscription is set to disabled and a webhook.disabled event goes to the notification routes. A paused or disabled subscription keeps queueing its deliveries, so after fixing the endpoint you can set it back to active and the gap is sent. That queue is kept for 30 days by default

Ordering and idempotency

Webhooks are delivered at least once. Duplicates are rare, but they happen: a receiver that processed an event and then timed out before responding will see it again. Design every handler to be idempotent and to cope with order across subjects being arbitrary

GuaranteeDetail
Per-subject orderEvents with the same subject are delivered in sequence order. The next event for a subject is not sent until the previous one succeeds
Head-of-line limitIf an event for a subject keeps failing, later events for that subject wait behind it for up to 1 hour, then are released. A jump in sequence tells you this happened
Across subjectsNo ordering. Up to maxConcurrency subjects are in flight per subscription, 10 by default and 50 at most; one subject's deliveries stay in order
Stable idsAn event's id never changes across retries or redeliveries
Versionsaction.applied carries the action log id, and object.changed the object's monotonic version

A robust receiver does three things

  1. Skip ids it has seen. Record each processed id; keeping them for 7 days covers the full retry window plus manual redelivery
  2. Ignore older versions. For object events, store the last version applied per object and ignore anything older, which makes the handler correct even when the head-of-line limit releases events out of order
  3. Acknowledge quickly. Put the event on a queue and return 204 before doing slow work, so that the 10 second timeout is never the reason for a retry
-- Idempotent apply of an object.changed event in the receiver's own database
INSERT INTO processed_events (event_id, received_at)
VALUES (:event_id, now())
ON CONFLICT (event_id) DO NOTHING;

UPDATE delivery_board
   SET status = :status, eta = :eta, crossing = :crossing, source_version = :version
 WHERE delivery_id = :primary_key
   AND source_version < :version;

Managing subscriptions

These endpoints need an administrator or a member of a group in webhooks.managers

EndpointPurpose
POST /api/v2/webhooksCreate a subscription; returns the secret once
GET /api/v2/webhooksSubscriptions with status and last delivery result, notification destinations, routes and problems
PATCH /api/v2/webhooks/{id}Change the URL, description, event types, filter, runAs, status (active or paused) or maxConcurrency
DELETE /api/v2/webhooks/{id}Delete a subscription; pending deliveries are cancelled
POST /api/v2/webhooks/{id}:testSend a signed webhook.test event and return the endpoint's response
POST /api/v2/webhooks/{id}:rotateSecretIssue a new secret with a 24 hour overlap
GET /api/v2/webhooks/deliveries?destination=&status=&type=&limit=The delivery log, filterable by subscription, status and event type
GET /api/v2/webhooks/deliveries/{id}One delivery with its envelope and attempts
POST /api/v2/webhooks/deliveries/{id}:redeliverRedeliver one event with its original id and sequence
GET /api/v2/webhooks/dead-letters?destination=&open=trueDeliveries that failed for the whole window
POST /api/v2/webhooks/dead-letters:replayReplay dead letters by id, or by subscription and time
GET /api/v2/webhooks/events?type=&limit=Recent events, before matching
POST /api/v2/webhooks/destinations/{name}:testSend a test message to an email, Slack or Teams destination
POST /api/v2/webhooks:dispatchRun one dispatcher pass now. It is skipped while another pass is running
GET /api/v2/webhooks/{id}/deliveries?since=On request: the delivery log of one subscription, filterable by time

Limits

LimitDefault
Subscriptions per tenant50
Event types per subscriptionAll
Payload size256 KB, larger data is truncated; on request, with an href
Concurrent subjects per subscription10, up to 50
Response timeout10 s, connect timeout 3 s
Retry window72 hours
Delivery log retention30 days (retentionDays; 0 keeps everything)

Destinations

Plain http:// is refused except for hosts in webhooks.allowHttp, and webhooks.allowHosts limits destinations to an allow-list

On request, deliveries leave from a fixed set of egress addresses per region, listed in Admin, so you can allow them through a firewall. Endpoints must use HTTPS with a publicly trusted certificate, or a certificate from a CA you upload for private endpoints. A subscription can also present a client certificate for mutual TLS when your endpoint requires one

Limitations

  • Delivery is at least once. A receiver must deduplicate on the event id; exactly-once processing is the receiver's job
  • Order is guaranteed per subject only. Events about different subjects arrive in any order, and a subject blocked for more than an hour releases later events out of order
  • Redirects are not followed, and a 410 Gone disables the subscription at once
  • Payloads are capped at 256 KB. Larger data is truncated and has to be fetched from the REST API
  • An event about data the subscription's principal cannot see, because of an access label it lacks, is skipped rather than sent with the labelled values removed
  • After 72 hours of failed attempts an event becomes a dead letter and needs a replay. The queue of a paused, disabled or deleted subscription is kept for 30 days
  • Deleting a subscription drops its pending deliveries
  • A subscription receives only the event types and patterns it lists. Name types explicitly if a new type matching action.* or * should not reach it

Related