Guide: Webhooks

Receive real-time events from XASE for automation and monitoring.

Events

Event                Description
record.created       New decision recorded
intervention.created Human intervention recorded
alert.triggered      Alert threshold exceeded
export.ready         Batch export completed

Example Payload

{
  "id": "evt_abc123",
  "type": "intervention.created",
  "created_at": "2025-01-15T14:35:00.000Z",
  "data": {
    "intervention": {"id": "int_...", "record_id": "rec_..."}
  }
}

Signature Verification

verify.tstypescript
import crypto from 'crypto';

export function verifyWebhook(payload: string, signature: string, secret: string): boolean {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}
Always verify the X-Xase-Signature header using your webhook secret before trusting the payload.