Docs / Webhooks

Webhooks

Push assess.completed when risk crosses your alert policy — not on every quiet allow.

Configure

curl -s https://fraudlens.io/v1/account/webhook \
  -X PUT -H "X-Api-Key: fk_sk_…" -H "Content-Type: application/json" \
  -d '{ "url": "https://hooks.example.com/frod" }'
# → returns webhook_secret whsec_…

Clear: send { "url": "" }.

Alert policy

PUT /v1/account/alerts
{
  "min_raw_action": "challenge",
  "include_shadow": true,
  "only_ato": false,
  "debounce_sec": 900,
  "format": "json"
}
FieldDefaultMeaning
min_raw_actionchallengeFire only if raw ≥ challenge or block
include_shadowtrueNotify even when shadow forced allow
only_atofalsePrefer ATO / churn flags
debounce_sec900Per account+user+action
formatjsonjson or slack (auto if hooks.slack.com)

Payload

Headers: X-Frod-Event: assess.completed · X-Frod-Signature: sha256=<hex>

{
  "event": "assess.completed",
  "event_alias": "assess.alert",
  "data": {
    "request_id": "…",
    "score": 22,
    "action": "block",
    "raw_action": "block",
    "shadow_mode": false,
    "support": { "headline": "…", "findings": [] },
    "profile": { "flags": [], "ato_suspicion": false },
    "reasons": [],
    "billing": {},
    "dossier": {},
    "meta": { "user_id": "usr_…" }
  }
}

Verify signature

import hmac, hashlib

def valid(body: bytes, secret: str, header: str) -> bool:
    got = header.removeprefix("sha256=")
    expect = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(got, expect)
Important HMAC the raw request body bytes, not a re-serialized JSON object.

Delivery log

GET /v1/account/webhooks/deliveries — recent attempts / skips (debounced, below_min_action, …).

API reference → Errors →