Webhooks

Signed HTTP deliveries of alarms, events and messages.

Create a webhook

bash
POST /api/v1/webhooks

{
  "name": "mes-alarms",
  "url": "https://mes.example.internal/fabconnect",
  "enabled": true,
  "events": ["alarm"],
  "filter": {"equipment_ids": ["<id>"]},
  "secret": "<shared secret>"
}

events is any of alarm, event, message. filter narrows by equipment_ids, alids, alarm_actions, ceids or streams. The secret is write-only. Needs settings:write. POST /api/v1/webhooks/{id}/test sends a test delivery and GET /api/v1/webhooks/{id}/deliveries lists recent ones.

Payload

json
{
  "id": "...",
  "type": "alarm.set",
  "time": "2026-10-12T10:30:00Z",
  "equipment_id": "...",
  "data": {}
}

type is alarm.set, alarm.clear, alarm.acknowledge, event.collection, message.secs or test.

Verifying the signature

Each delivery carries X-FabConnect-Timestamp and X-FabConnect-Signature: sha256=<hex>, an HMAC-SHA256 over <timestamp>.<body>.

javascript
const crypto = require("crypto");

function verify(body, timestamp, signature, secret) {
  const mac = crypto.createHmac("sha256", secret)
    .update(`${timestamp}.${body}`).digest("hex");
  const a = Buffer.from(`sha256=${mac}`), b = Buffer.from(signature);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Delivery

Each webhook has its own queue, retries with backoff and a circuit breaker, so one slow receiver does not hold up the others. URLs that resolve to internal or metadata addresses are refused.

Something missing or wrong on this page? Tell us.