Skip to content
Docs
Qubitara Central

Webhooks

Updated Version 2CENTRAL-49

Outbound event notifications so other systems react to identity events as they happen.

Register an endpoint#

Go to Operations → Webhook Deliveries → Register endpoint and provide an HTTPS URL and a signing secret.

Event catalog#

Indicative names. The exact event catalog is listed when you register an endpoint under Operations → Webhook Deliveries.

user.created, user.updated, user.suspended, user.deleted, group.member_added, session.revoked, mfa.enrolled, threat.detected, device.blocked, access_request.submitted, access_request.approved, workflow.executed, application.assigned.

Payload example#

json
{
  "id": "evt_01H...",
  "type": "user.suspended",
  "created": "2026-09-08T10:15:00Z",
  "org": "<org>",
  "data": { "user_id": "2819c223-...", "userName": "[email protected]" }
}

Signature verification (HMAC-SHA256)#

The signature and timestamp header names are shown with the signing secret when you register an endpoint. The samples below use X-Qubitara-Signature and X-Qubitara-Timestamp.

Verify against the raw body (re-serializing parsed JSON changes bytes and breaks the signature), use a constant-time compare, and reject stale timestamps (older than 5 minutes) to block replay.

Node.js (Express)#

js
const crypto = require('crypto');
const express = require('express');
const app = express();

app.post('/webhooks/qubitara',
  express.raw({ type: 'application/json' }),
  (req, res) => {
    const sig = req.header('X-Qubitara-Signature');   // header name from Webhook Deliveries
    const ts = req.header('X-Qubitara-Timestamp');    // header name from Webhook Deliveries
    if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.status(400).end();

    const signed = `${ts}.${req.body}`;               // signing scheme from Webhook Deliveries
    const expected = crypto.createHmac('sha256', process.env.QUBITARA_WEBHOOK_SECRET)
      .update(signed).digest('hex');
    const a = Buffer.from(sig, 'hex'), b = Buffer.from(expected, 'hex');
    if (a.length !== b.length || !crypto.timingSafeEqual(a, b))
      return res.status(401).end();

    const event = JSON.parse(req.body.toString('utf8'));
    // handle idempotently by event.id
    res.status(200).end();
  });

Python (Flask)#

python
import hmac, hashlib, time, os
from flask import Flask, request, abort
app = Flask(__name__)

@app.post("/webhooks/qubitara")
def hook():
    raw = request.get_data()                       # raw bytes, before JSON parse
    sig = request.headers.get("X-Qubitara-Signature")   # header name from Webhook Deliveries
    ts  = request.headers.get("X-Qubitara-Timestamp")   # header name from Webhook Deliveries
    if abs(time.time() - int(ts)) > 300:
        abort(400)
    signed = f"{ts}.".encode() + raw               # signing scheme from Webhook Deliveries
    expected = hmac.new(os.environ["QUBITARA_WEBHOOK_SECRET"].encode(),
                        signed, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(sig, expected):
        abort(401)
    return "", 200

Retries and inspection#

  • Retries: Central retries non-2xx responses with backoff. Make handlers idempotent on event.id, because a retry can deliver the same event twice.

  • Inspect and retry: use Webhook Deliveries to view delivery history and Retry a failed delivery.