Loading...
Loading...
OmegaEngine · Webhooks
Register tenant-scoped HTTPS webhooks for decisions, human-review approvals, and persisted red-team results. Core events are Developer+; red-team events are Business+. Signed payloads include replay protection, stable deduplication IDs, bounded retry, and a durable dead-letter state.
Point a webhook at your service, SIEM intake, or an HTTPS relay that accepts OmegaEngine's JSON envelope. Use a relay when a vendor requires its own payload shape.
Transient failures receive up to 3 delivery attempts with exponential backoff. Exhausted deliveries remain durably recorded as dead letters.
Configure a 16–256 character secret and every delivery carries X-Omega-Signature-V2. The secret is sealed at rest and never returned by the API.
Register via POST /api/v2/webhooks (Developer+ for decisions/approvals, Business+ for red-team events; max 25 per tenant). URLs must be HTTPS.
# Register a webhook for decision and approval events
curl -X POST https://omegaengine.ai/api/v2/webhooks \
-H "Content-Type: application/json" \
-H "x-api-key: $OMEGA_API_KEY" \
-d '{
"url": "https://your-app.com/webhooks/omega",
"events": ["decision.blocked", "decision.flagged", "approval.escalated", "approval.approved"],
"secret": "whsec_at_least_16_characters"
}'
# → { ok, webhook, availableEvents, eventMinimumPlans }
# List registered webhooks (includes per-webhook delivery/failure counts)
curl -H "x-api-key: $OMEGA_API_KEY" https://omegaengine.ai/api/v2/webhooksUpdates and deletes are pinned to the authenticated tenant. Secret plaintext and sealed ciphertext are never returned. Disabling or deleting remains available after downgrade; enabling or rotating requires the event set's current plan (Developer+ for core events; Business+ when any red-team event is selected).
# Rotate the HMAC signing secret
curl -X PATCH https://omegaengine.ai/api/v2/webhooks \
-H "Content-Type: application/json" \
-H "x-api-key: $OMEGA_API_KEY" \
-d '{"id":"whk_abc123","secret":"a_new_secret_at_least_16_characters"}'
# Stop outbound delivery (also allowed after downgrade)
curl -X PATCH https://omegaengine.ai/api/v2/webhooks \
-H "Content-Type: application/json" \
-H "x-api-key: $OMEGA_API_KEY" \
-d '{"id":"whk_abc123","active":false}'
# Delete the subscription and its outbox history
curl -X DELETE \
-H "x-api-key: $OMEGA_API_KEY" \
"https://omegaengine.ai/api/v2/webhooks?id=whk_abc123"Every delivery is an HTTPS POST with this envelope. The signature travels in headers, not the body:
{
"id": "decision:dec_abc123",
"event": "decision.flagged",
"timestamp": "2026-07-14T12:00:00Z",
"webhookId": "whk_abc123",
"data": {
"decisionId": "dec_abc123",
"recommendedAction": "ESCALATE",
"riskLevel": "HIGH",
"needsHumanReview": true
}
}
// Headers on every signed delivery:
// X-Omega-Signature sha256=<HMAC-SHA256(body)> (legacy, body-only)
// X-Omega-Signature-V2 t=<unix seconds>,v1=<HMAC-SHA256(t.body)> (verify this one)| Event | When it is emitted | Category |
|---|---|---|
decision.completed | A live /api/v2/judge decision completed without a block or review flag | Decision |
decision.blocked | The safety layer blocked a live decision | Decision |
decision.flagged | A live decision requires human review | Decision |
approval.created | A durable approval request was created | Approval |
approval.escalated | A pending approval moved to the next reviewer level | Approval |
approval.approved | The approval reached quorum or an explicit rule auto-approved it | Approval |
approval.rejected | A reviewer rejected the request or its escalation chain was exhausted | Approval |
redteam.scan.completed | A live, scheduled, or assessment scan reached a persisted COMPLETED state | Red Team · Business+ |
redteam.scan.failed | A started scan reached a persisted FAILED state | Red Team · Business+ |
redteam.finding.high | A persisted scan recorded a high-severity finding | Red Team · Business+ |
redteam.finding.critical | A persisted scan recorded a critical-severity finding | Red Team · Business+ |
Delivery is at least once. Store the envelope id and ignore repeats; a worker can redeliver after receiving a response if it shuts down before committing the delivery receipt.
Verify X-Omega-Signature-V2 on every delivery: recompute the HMAC over `${t}.${body}` with your secret, compare in constant time, and reject deliveries older than your tolerance window (recommended: 300 seconds) to defeat replay:
import crypto from "crypto";
// header: X-Omega-Signature-V2 → "t=1720966800,v1=a1b2c3..."
function verifyWebhookV2(body: string, header: string, secret: string, toleranceSec = 300) {
const parts = new Map(header.split(",").map((p) => p.split("=", 2) as [string, string]));
const t = Number(parts.get("t"));
const v1 = parts.get("v1");
if (!Number.isFinite(t) || !v1) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${t}.${body}`)
.digest("hex");
const a = Buffer.from(expected, "utf8");
const b = Buffer.from(v1, "utf8");
if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) return false;
// Reject stale deliveries — anti-replay
return Math.abs(Math.floor(Date.now() / 1000) - t) <= toleranceSec;
}OmegaEngine re-checks the current event-specific entitlement before every outbox attempt. Global execution stops pause all webhook egress; org-scoped subscriptions also honor that organization's kill switch and revocation. Delivery uses a connect-time guarded DNS resolver; only HTTPS 307/308 redirects are followed, at most two, and every redirect target is checked again before connecting.