Webhook notifications send a JSON payload to an HTTPS endpoint of your choice when a guardrail violation occurs. See the Notifications overview for how channels fit into the guardrails system.
When a change freeze window or deployment policy is violated, OpsTrails sends a POST request with the following JSON body:
{
"type": "guardrail.violation",
"guardrailType": "change-freeze",
"guardrailName": "Holiday Freeze 2026",
"violation": {
"eventType": "deployment",
"source": "//github.com/acme/api",
"subject": "production",
"version": "v2.4.1",
"timestamp": "2026-12-25T14:30:00Z"
},
"organization": {
"id": "org_abc123",
"name": "Acme Corp"
},
"timestamp": "2026-12-25T14:30:05Z"
}If you provide a signing secret, OpsTrails includes an X-OpsTrails-Signature header containing an HMAC-SHA256 hex digest of the request body. Use this to verify that the request came from OpsTrails.
const crypto = require("crypto");
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac("sha256", secret)
.update(payload)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// In your webhook handler:
const signature = req.headers["x-opstrails-signature"];
const isValid = verifySignature(req.body, signature, SIGNING_SECRET);✅ Tip
💡 Info