Skip to content
Patch Raven

Webhooks

Patch Raven can send every alert as a signed JSON request to an HTTPS endpoint you run, for your SIEM, ticketing or chat tools.

Setting one up

  1. In the app, go to Notifications → Webhooks and add a name and an HTTPS URL. Owners and admins can do this on the Pro and Team plans.
  2. Copy the signing secret it shows you. It’s shown once; you can rotate it later.
  3. Send a test. The endpoint starts receiving alerts once a test gets a 2xx response.

The URL must be public HTTPS on port 443 or 1024–65535, with a host name rather than an IP address. We resolve the name and refuse it if any address it points to is private, loopback, link-local or otherwise reserved.

Events

typeWhen
alert.createdA new advisory affects your stack and passes this endpoint’s severity threshold.
alert.updatedA follow-up about an alert you already received; data.alert.followUp says why (severity_up, newly_affected, fix_available, withdrawn, kev_added).
test.pingA test someone sent from the app. data.test is true and nothing is affected.

Payload

Every request is a POST with a JSON body described by the version 1 JSON Schema. We only add optional fields to version 1; a breaking change gets a new version. Bodies stay under 20 KB: very large alerts list fewer components and set data.alert.truncated. Advisory text such as title comes from public sources: escape it before you render it anywhere.

{
  "type": "alert.created",
  "timestamp": "2026-11-22T12:00:00.000Z",
  "data": {
    "schemaVersion": 1,
    "test": false,
    "workspace": {
      "id": "ws_01JD8Y",
      "name": "Acme"
    },
    "alert": {
      "id": "GHSA-35jh-r3h4-6jhm",
      "url": "https://app.patchraven.com/alerts?id=GHSA-35jh-r3h4-6jhm",
      "primaryAlias": "CVE-2021-23337",
      "aliases": [
        "CVE-2021-23337",
        "GHSA-35jh-r3h4-6jhm"
      ],
      "kind": "vulnerability",
      "title": "Command Injection in lodash",
      "headline": "HIGH 7.2 · lodash 4.17.20 in api · upgrade to 4.17.21",
      "match": "affected",
      "followUp": null,
      "severity": {
        "score": 7.2,
        "band": "high",
        "label": "high",
        "cvss31": {
          "score": 7.2,
          "vector": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
        },
        "cvss40": null,
        "unscored": false
      },
      "kev": false,
      "withdrawn": false,
      "fixedVersions": [
        "4.17.21"
      ],
      "projects": [
        {
          "id": "prj_01JD8Z",
          "name": "acme/api",
          "components": [
            {
              "ecosystem": "npm",
              "name": "lodash",
              "version": "4.17.20",
              "match": "affected",
              "scope": "runtime",
              "manifestPath": "package-lock.json"
            }
          ]
        }
      ],
      "projectCount": 1,
      "truncated": false,
      "references": [
        "https://github.com/advisories/GHSA-35jh-r3h4-6jhm"
      ]
    }
  }
}

Headers and signatures

Requests follow the Standard Webhooks specification, so its libraries for most languages verify them:

  • webhook-id: unique per alert and endpoint, and the same on every retry. Use it to ignore duplicates.
  • webhook-timestamp: when this attempt was sent, in Unix seconds.
  • webhook-signature: v1, and the base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{body}, keyed with your secret (without its whsec_ prefix, base64-decoded). For 24 hours after a rotation there are two, separated by a space: one for each secret.

You can instead choose a fixed header, such as Authorization: Bearer …, or no signature at all. Without one, anyone who learns the URL can send you fake alerts. We don’t publish fixed IP addresses to allow: verify the signature instead.

Verifying in Node.js

import { createHmac, timingSafeEqual } from 'node:crypto';

// secret: the whsec_… value shown when you added the endpoint.
// rawBody: the request body exactly as received (verify before parsing JSON).
export function verify(secret, headers, rawBody) {
  const id = headers['webhook-id'];
  const timestamp = headers['webhook-timestamp'];
  const signatures = headers['webhook-signature'] ?? '';
  if (!id || !timestamp) return false;
  // Reject old or future requests, so a captured request can't be replayed later.
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;

  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
  const expected = createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest();
  // During a secret rotation there are two signatures; either may match.
  return signatures.split(' ').some((entry) => {
    const [version, signature] = entry.split(',');
    const given = Buffer.from(signature ?? '', 'base64');
    return version === 'v1' && given.length === expected.length && timingSafeEqual(given, expected);
  });
}

Responses and retries

  • Answer with any 2xx within 10 seconds. Do the slow work after you’ve answered.
  • Redirects aren’t followed: a 3xx counts as a failure. A 410 Gone turns the endpoint off. Other 4xx responses aren’t retried.
  • Timeouts, connection errors, 408, 429 and 5xx are retried with some jitter, and we wait longer if you send Retry-After:
  1. immediately
  2. 5 seconds
  3. 5 minutes
  4. 30 minutes
  5. 2 hours
  6. 5 hours
  7. 10 hours
  8. 6.5 hours (about 24 hours after the first try)

At most two requests to one endpoint are in flight at a time. If three alerts in a row fail after every retry, the endpoint is marked as failing and your workspace’s owners and admins get an email. Each endpoint’s delivery log in the app shows the last 50 attempts with their status codes.

Questions

Email support@patchraven.com.