Skip to content

Breach Alert Webhooks

A webhook alert channel POSTs a JSON event to a URL you control whenever a monitored breach or scan event happens, in addition to (or instead of) email, Slack or Microsoft Teams alerts.

Setting up a channel

From Dashboard → Settings → Alerts, or via the API:

POST /api/v1/alert-configs
{
  "channel": "webhook",
  "isEnabled": true,
  "config": {
    "url": "https://example.com/hooks/cykanner",
    "secret": "whsec_your_own_random_string"
  },
  "notifyOnNewBreach": true,
  "notifyOnScanComplete": false,
  "notifyOnScanError": true
}

url must be public HTTPS (no localhost/private-network addresses — checked at write time and again immediately before every send). secret is optional but strongly recommended — generate one with, e.g., openssl rand -hex 32. Without a secret, deliveries go out unsigned (no X-Cykanner-Signature header at all). See the API reference for the full alert-config shape (email, Slack and Microsoft Teams channels, the notify* toggles).

To post alerts into Microsoft Teams, add a Microsoft Teams channel instead of a webhook channel: it sends the Adaptive Card that a Teams workflow posts as is.

Payload shape

Every delivery is a POST with Content-Type: application/json and the same envelope:

  • id: the underlying alert's own id ( 0 for a test event). Stable across every retry of one delivery, but can repeat across two genuinely different deliveries: a breach merge (see Retries below) can redispatch new content under the same id
  • eventId — the actual dedup key (see Retries below): stable across every retry of one delivery and distinct across a breach merge — use this, not id, the signature, or the timestamp, to detect a duplicate
  • type: one of the event types below
  • timestamp — ISO-8601, when this delivery ATTEMPT was sent (changes on every retry, unlike id — not necessarily the exact instant the underlying event was detected either)
  • data — event-specific, see below
type: "breach" — one or more new breaches found for a monitored email
{
  "id": 4821,
  "eventId": "4821.0",
  "type": "breach",
  "timestamp": "2026-08-20T09:00:14.128Z",
  "data": {
    "breaches": [
      {
        "breachId": 44,
        "title": "Example Forum",
        "domain": "exampleforum.com",
        "dataClasses": ["Email addresses", "Passwords"],
        "affectedEmails": ["you@example.com"],
        "severity": "high",
        "severityReason": "credentials",
        "isFabricated": false
      }
    ]
  }
}

Each entry in data.breaches carries affectedEmails — the monitored address(es) you added that this breach was detected for, sorted and deduped. This is your own data, not upstream breach-source content — it can be empty for a legacy delivery recorded before this field existed.

Each entry also carries the breach's rating, recorded with the alert. severity is critical, high, medium, low or info, or null when the breach has no level. severityReason says why, or is null while the breach isn't rated yet. isFabricated is true when the breach's data source considers it fabricated, which never changes its severity, false when it doesn't, and null when that isn't known. They mean what the same fields mean on GET /api/v1/breaches, and the API reference lists every reason code. A retry or a merged redelivery sends the rating recorded with the alert, even if the breach has been rated again since. A delivery recorded before these fields existed, or an entry merged in from one, has none of them.

Entries can gain new fields, and a field can gain new values (a new level or reason code), so ignore fields you don't know, and treat a missing field or a value you don't know like null.

type: "scan_complete" — data:

{ "scannedCount": 12, "newBreachCount": 1, "failedCount": 0, "totalEmails": 12 }

type: "scan_error" — data:

{ "error": "3 of 12 monitored emails could not be scanned this run; their breach status may be stale. They will be retried on the next scan." }

Test events

Send test on the alert settings page (or POST /api/v1/alert-configs/:id/test) sends one test event:

type: "test"
{
  "id": 0,
  "eventId": "test.3f0c2a1e-6b7d-4c1f-9a2e-5d8b7c6a4e10",
  "type": "test",
  "test": true,
  "timestamp": "2026-11-02T10:00:01.204Z",
  "data": {
    "message": "This is a test alert from Cykanner. If you can see it, this channel is ready to receive breach alerts."
  }
}

It is signed and carries the same headers as a real delivery, so it checks your signature verification end to end. Only test events have test: true; their id is 0 and their eventId starts with test.. A test is sent once, with no retries, and in rare cases (a restart while it was being sent) it can arrive twice. After checking the signature, skip it instead of ingesting it as an alert.

Which types you receive is controlled per-channel by the notifyOnNewBreach/ notifyOnScanComplete/ notifyOnScanError flags on the alert config.

Verifying the signature

When the channel has a secret configured, every delivery carries an X-Cykanner-Signature header: the lowercase-hex HMAC-SHA256 digest of the exact raw request body, keyed with your secret. There is no scheme prefix (unlike, e.g., a sha256=... style header) — the header value is the hex digest itself, nothing else.

Compute your own HMAC over the raw bytes you received — not a value you've parsed and re-serialized, which can legally produce different bytes than what was signed (key order, whitespace) — and compare it to the header using a constant-time comparison, never ===/==.

Node.js
const crypto = require('crypto');

function isValidCykannerSignature(rawBody, signatureHeader, secret) {
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  const expectedBuf = Buffer.from(expected, 'hex');
  const providedBuf = Buffer.from(signatureHeader || '', 'hex');
  // timingSafeEqual throws on a length mismatch instead of returning false --
  // check first so a wrong-length header can't crash the handler.
  if (expectedBuf.length !== providedBuf.length) return false;
  return crypto.timingSafeEqual(expectedBuf, providedBuf);
}

// Express -- capture the RAW body before any JSON-parsing middleware touches
// it; verifying a re-serialized copy can disagree with what was actually signed.
app.post('/hooks/cykanner', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.header('X-Cykanner-Signature');
  if (!isValidCykannerSignature(req.body, signature, process.env.CYKANNER_WEBHOOK_SECRET)) {
    return res.status(401).send('invalid signature');
  }

  const event = JSON.parse(req.body);
  // ... handle event.type / event.data
  res.status(200).end();
});
Python
import hashlib
import hmac
import os

def is_valid_cykanner_signature(raw_body: bytes, signature_header: str, secret: str) -> bool:
    expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
    # hmac.compare_digest is constant-time and handles the length check itself.
    return hmac.compare_digest(expected, signature_header or "")

# Flask -- request.get_data() is the raw, pre-parse body.
@app.route("/hooks/cykanner", methods=["POST"])
def cykanner_webhook():
    signature = request.headers.get("X-Cykanner-Signature", "")
    secret = os.environ["CYKANNER_WEBHOOK_SECRET"]
    if not is_valid_cykanner_signature(request.get_data(), signature, secret):
        return "invalid signature", 401

    event = request.get_json()
    # ... handle event["type"] / event["data"]
    return "", 200

Test vector

Known-good input/output to validate your implementation against before wiring up a live endpoint:

secret
whsec_test_fixed_vector_secret
raw request body
{"id":42,"eventId":"42.0","type":"breach","timestamp":"2026-01-01T00:00:00.000Z","data":{"breaches":["example.com"]}}
X-Cykanner-Signature
0b1cee631f976f33d769609c304747ccd1506836d009692095d054ef59e93679

Retries & idempotency

Cykanner waits up to 10 seconds for a response and treats anything other than a 2xx status (including a timeout) as a failed attempt. A failed delivery gets 2 retries after the initial attempt (3 attempts total), with exponential backoff of ~1s then ~2s between attempts. Redirects are never followed — point url at the exact endpoint, not one that 3xx's.

If your endpoint answers 429 or 503 with a Retry-After header (seconds or an HTTP date), Cykanner skips the quick retries and tries again no earlier than that time, plus a short random delay that grows if you keep asking. Each such answer counts as one attempt, so repeated waits can stretch the recovery window beyond the 10 hours described below.

Those 3 quick attempts are only the fast path, not the full recovery window. If your endpoint is still failing once they're exhausted, Cykanner doesn't give up on the event — it's re-dispatched roughly every hour, each re-dispatch getting its own fresh 3 attempts, for up to about 10 hours total (30 attempts) under normal operation before permanent abandonment. An outage on Cykanner's own side can occasionally stretch a re-dispatch later than the hourly cadence, so treat ~10 hours as the typical tolerance window, not a hard guarantee.

You can check each alert's delivery per channel — delivered, pending, retrying, or not delivered, with the number of failed attempts, the last attempt time, and a short reason for any failure — under Recent alert deliveries on Dashboard → Settings → Alerts . Channel details there reflect each channel's current settings, and removing a channel also removes its delivery history.

This means your endpoint may receive the same event more than once, potentially hours apart — make handling it idempotent by deduplicating on eventId for as long as you retain delivery records, not just for a few minutes or hours. eventId stays identical across every attempt and every re-dispatch of one delivery. Don't dedupe on the signature or on timestamp — both are recomputed fresh on every attempt (a new timestamp means a different signed body, and therefore a different signature), so neither one identifies a retry as the same delivery.

Every delivery also carries an Idempotency-Key header set to the same value as eventId, so a receiver (or an intermediary/gateway) can dedupe at the HTTP layer instead of parsing the body — the header is always present, even when the channel has no secret configured and therefore sends no X-Cykanner-Signature. The same caveat as eventId above applies: it's stable across retries of one generation, but a breach merge bumps it, so the header can't be used to recognize an old-generation payload as "the same event" as the new one it was superseded by — it only identifies true retries of one unchanged attempt, not cross-generation equivalence.

Don't dedupe on bare id either, even though it was previously documented here as the dedup key -- switch your stored dedup key to eventId instead. If you're migrating an existing integration, a bare id you've already recorded doesn't tell you which generation you actually saw, so expect at most one extra duplicate delivery for a row you'd already handled -- the same at-least-once tolerance this page already asks you to build for.

Replay protection

A valid signature only proves a payload was signed with your secret at some point — it doesn't prove it just arrived. There's no separate nonce/replay-window mechanism; instead, after verifying the signature, also check that timestamp is recent (a few minutes' tolerance is reasonable) before acting on the payload, and reject or log anything older.