Integrations
Webhooks
Send incidents straight into your own systems — an on-call tool, a SIEM or an internal bot. Every delivery is signed, carries a stable delivery ID and is retried until your endpoint accepts it.
The request#
Wardquiet sends a POST to your URL with a JSON body and these headers:
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | Wardquiet-Webhooks/1 |
X-Wardquiet-Event | incident, update, retraction or test |
X-Wardquiet-Delivery | The notification ID. Stable across retries — use it for idempotency. |
X-Wardquiet-Signature | t=<unix seconds>,v1=<hex> where v1 is HMAC-SHA256 of <t>.<raw body> keyed with the channel’s signing secret. |
POST /hooks/wardquiet HTTP/1.1
Content-Type: application/json
User-Agent: Wardquiet-Webhooks/1
X-Wardquiet-Event: incident
X-Wardquiet-Delivery: 9b2e4c71-5d0a-4f3e-8a61-2c7d9e0f1a34
X-Wardquiet-Signature: t=1764338529,v1=<hex HMAC-SHA256>Event types
| X-Wardquiet-Event | Sent when |
|---|---|
incident | A monitor opened a new incident. |
update | An incident escalated or received new events after the monitor’s cooldown. |
retraction | The events behind an incident were removed by a chain reorganization. Treat the incident as retracted. |
test | A test notification sent from the dashboard or the API. |
The payload#
The body is an alert payload. Fields with no value are omitted.
| Field | Description |
|---|---|
version | Payload format version, currently "1". |
kind | Same value as X-Wardquiet-Event. |
workspace_id | The workspace the incident belongs to. |
incident | The incident: severity, status, title, a summary explaining the cause, chain, transaction IDs, finality, retracted flag, event count and timestamps. |
events | Up to 10 of the most relevant normalized events. See event fields. |
url | Link to the incident in the dashboard. |
message | Optional human-readable message. |
sent_at | When this notification was sent (RFC 3339, UTC). |
{
"version": "1",
"kind": "incident",
"workspace_id": "4f1c2b9e-7a3d-4e21-9c55-1b2a3c4d5e6f",
"incident": {
"id": "b7e0d6a2-3c41-4f8e-9a1d-5e2f3a4b5c6d",
"workspace_id": "4f1c2b9e-7a3d-4e21-9c55-1b2a3c4d5e6f",
"monitor_id": "0c9d8e7f-6a5b-4c3d-8e2f-1a0b9c8d7e6f",
"monitor_name": "Treasury outflow 1h",
"rule": "treasury_outflow",
"severity": "critical",
"status": "open",
"title": "Unusual treasury outflow",
"summary": "Net outflow of 1,250,000 USDC ($1,249,800 at 14:02 UTC) from Treasury in 1h exceeds $500,000.",
"chain": "sui",
"asset_id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a",
"finality": "finalized",
"retracted": false,
"event_count": 3,
"tx_ids": ["<tx digest>"],
"first_seen_at": "2026-11-28T13:12:40Z",
"last_seen_at": "2026-11-28T14:02:05Z",
"created_at": "2026-11-28T14:02:07Z",
"updated_at": "2026-11-28T14:02:07Z"
},
"events": [
{
"id": "sui:<tx digest>:0",
"chain": "sui",
"tx_id": "<tx digest>",
"event_index": 0,
"block": 123456789,
"block_hash": "<checkpoint digest>",
"timestamp": "2026-11-28T14:02:03Z",
"kind": "transfer",
"from": "0x4444444444444444444444444444444444444444444444444444444444444444",
"to": "0x5555555555555555555555555555555555555555555555555555555555555555",
"asset": "0x1111111111111111111111111111111111111111111111111111111111111111::usdc::USDC",
"asset_symbol": "USDC",
"decimals": 6,
"amount": "750000",
"amount_raw": "750000000000",
"price_usd": "0.99984",
"price_at": "2026-11-28T14:02:00Z",
"amount_usd": "749880",
"decoder_version": "<decoder version>",
"finality": "finalized",
"watched": ["0x4444444444444444444444444444444444444444444444444444444444444444"]
}
],
"url": "<dashboard link to the incident>",
"sent_at": "2026-11-28T14:02:09Z"
}Amounts and prices are decimal strings; parse them with a decimal type, not a float. USD values come with the timestamp of the price that was used.
Verify the signature#
Always verify the signature before trusting a delivery. Compute HMAC-SHA256 over the timestamp, a dot and the raw request body, using the channel’s signing secret, and compare it in constant time with the v1 value. Reject timestamps that are too old — we suggest a five-minute tolerance — to limit replays.
import crypto from "node:crypto";
const TOLERANCE_SECONDS = 5 * 60;
/**
* Verifies X-Wardquiet-Signature against the RAW request body (Buffer).
* Never verify a re-serialized JSON object: any byte change breaks the HMAC.
*/
export function verifyWardquietSignature(rawBody, signatureHeader, secret, nowMs = Date.now()) {
const parts = {};
for (const item of (signatureHeader ?? "").split(",")) {
const i = item.indexOf("=");
if (i > 0) parts[item.slice(0, i).trim()] = item.slice(i + 1).trim();
}
const { t, v1 } = parts;
if (!t || !v1 || !/^\d+$/.test(t)) return false;
// Reject stale or future timestamps to limit replays.
if (Math.abs(nowMs / 1000 - Number(t)) > TOLERANCE_SECONDS) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${t}.`)
.update(rawBody)
.digest();
const received = Buffer.from(v1, "hex");
// Constant-time comparison; lengths must match first.
return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}import express from "express";
import { verifyWardquietSignature } from "./verify.js";
const app = express();
// Keep the body raw for this route so the signature can be checked.
app.post("/hooks/wardquiet", express.raw({ type: "application/json" }), async (req, res) => {
const ok = verifyWardquietSignature(
req.body,
req.get("X-Wardquiet-Signature"),
process.env.WARDQUIET_SIGNING_SECRET,
);
if (!ok) return res.status(401).end();
const deliveryId = req.get("X-Wardquiet-Delivery"); // stable across retries
if (await alreadyProcessed(deliveryId)) return res.status(200).end();
const payload = JSON.parse(req.body.toString("utf8"));
await enqueue(deliveryId, req.get("X-Wardquiet-Event"), payload); // do slow work asynchronously
res.status(202).end();
});import hashlib
import hmac
import time
TOLERANCE_SECONDS = 5 * 60
def verify_wardquiet_signature(raw_body: bytes, signature_header: str, secret: str) -> bool:
"""Verify X-Wardquiet-Signature against the raw request body."""
parts = {}
for item in (signature_header or "").split(","):
key, sep, value = item.partition("=")
if sep:
parts[key.strip()] = value.strip()
t, v1 = parts.get("t", ""), parts.get("v1", "")
if not t.isdigit() or not v1:
return False
if abs(time.time() - int(t)) > TOLERANCE_SECONDS:
return False
signed = t.encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected.encode(), v1.encode())
# Flask example: request.get_data() returns the raw bytes.
# ok = verify_wardquiet_signature(request.get_data(), request.headers.get("X-Wardquiet-Signature", ""), SECRET)package webhooks
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"strconv"
"strings"
"time"
)
const tolerance = 5 * time.Minute
// VerifySignature checks X-Wardquiet-Signature against the raw request body.
func VerifySignature(rawBody []byte, header, secret string, now time.Time) bool {
var t, v1 string
for _, part := range strings.Split(header, ",") {
k, v, _ := strings.Cut(strings.TrimSpace(part), "=")
switch k {
case "t":
t = v
case "v1":
v1 = v
}
}
ts, err := strconv.ParseInt(t, 10, 64)
if err != nil || v1 == "" {
return false
}
if d := now.Sub(time.Unix(ts, 0)); d > tolerance || d < -tolerance {
return false
}
received, err := hex.DecodeString(v1)
if err != nil {
return false
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(t + "."))
mac.Write(rawBody)
return hmac.Equal(received, mac.Sum(nil))
}Signing secrets
The signing secret is generated by Wardquiet when you create the webhook channel and is shown once. It is stored encrypted and never returned again. To replace it, rotate it with POST /workspaces/{ws}/channels/{id}/rotate-secret (Admin role); the new secret is also shown once, so update your receiver as soon as it is issued.
Retries and idempotency#
Any 2xx response counts as delivered. Other responses, connection errors and timeouts (10 seconds) are retried with exponential backoff — roughly 30 s, 1 min, 2 min, 4 min and so on — for up to 8 attempts. Every attempt is visible in the delivery log with its status and last error.
- Verify first. Check the signature on the raw body before parsing JSON.
- Deduplicate. Retries reuse the same
X-Wardquiet-Delivery; store processed IDs and answer2xxfor repeats. - Answer quickly. Respond within the timeout and do slow work asynchronously.
- Handle retractions. A
retractionmeans the underlying events are no longer canonical; close or annotate the matching record in your system.
Testing#
Send a test delivery from Integrations, or with POST /workspaces/{ws}/channels/{id}/test (Admin role), which waits for the result for up to 15 seconds and returns delivered or failed with the error. To check routing end to end, use POST /workspaces/{ws}/monitors/{id}/test-notification, which notifies every channel of that monitor. Test deliveries arrive with X-Wardquiet-Event: test.