Documentation

The agent and CI jobs send data with two endpoints. Both take JSON, plain or gzip-compressed, and an API key in the Authorization header.

API keys

Create keys on the dashboard. A key starts with pb_ and has a scope:

  • agent: uploads reports and SBOMs. It cannot read anything, so a key that leaks from a server or a CI job does not expose your findings.
  • api: the read API of the Team and Business plans.

Send the key as Authorization: Bearer pb_…. We store a hash of the key; a revoked key stops working at once.

Upload a report

POST https://patchbrief.ch/api/v1/reports
Authorization: Bearer pb_…
Content-Type: application/json
Content-Encoding: gzip

The body is a report in the format of version 1. The agent sends it; you need this endpoint only to write your own client. The server is identified by server.id, a UUID: a new ID adds a server to the account, within the limit of the plan.

Upload an SBOM from CI

A build job can send the CycloneDX SBOM of an application or an image, for example made with Trivy. It counts as a server of its own, named by the header X-Server-Name; uploads with the same name replace the package list of that server. We keep only what matching needs from each component (type, name, version, package URL, the Trivy properties and the dependency graph); file paths, hashes and licences are dropped before the SBOM is stored.

# make the SBOM of the checkout (or: trivy image --format cyclonedx app:latest)
trivy fs --format cyclonedx --output sbom.json .
# send it
gzip -c sbom.json | curl -fsS -X POST https://patchbrief.ch/api/v1/sbom \
  -H "Authorization: Bearer $AGENT_KEY" \
  -H "Content-Type: application/json" \
  -H "Content-Encoding: gzip" \
  -H "X-Server-Name: shop-backend" \
  --data-binary @-

Keep the key in a secret variable of the CI system (AGENT_KEY above). X-Server-Id (a UUID) is optional; without it the ID is derived from the name.

Answer

HTTP 200 with the ID of the stored report, the server and its page on the dashboard:

{
  "id": 1234,
  "server": {"id": 56, "uuid": "6f1d2c3a-8b7e-4f50-9a21-0c4d5e6f7a8b", "name": "web-1"},
  "dashboard_url": "https://patchbrief.ch/dashboard/servers/56",
  "warnings": ["unknown check id custom.thing (kept, shown without a catalog entry)"]
}

warnings is left out when there are none. The package lists are matched in the background; the findings show on the dashboard within a minute.

Errors

Errors are JSON with a code, a message for people, sometimes a link, and for a report that does not match the schema the list of problems as JSON pointers:

{
  "error": "invalid_report",
  "message": "The report does not match the schema (report-v1).",
  "url": "https://patchbrief.ch/docs/payload",
  "problems": ["/server/name: longer than 100 characters"]
}
StatusCodeMeaning
400bad_gzip, bad_body, emptyThe body is not gzip although the header says so, could not be read, or is empty.
400invalid_report, invalid_sbomThe JSON does not match the report format or is not a CycloneDX SBOM; problems names each field (at most 20).
400missing_server_nameAn SBOM upload without X-Server-Name.
401unauthorizedThe key is missing, wrong or revoked.
403wrong_scopeThe key is not of scope agent.
403server_limitA new server would exceed the plan. The message names the limit; url leads to the plans.
413too_largeMore than 20 MB as sent, or more than 150 MB after decompression.
415unsupported_encodingA Content-Encoding other than gzip.
429rate_limitedMore than 120 uploads in an hour with one key.
503busyTry again after the seconds of the Retry-After header.

The agent retries 5xx answers up to three times with a pause in between; 4xx answers need a change on your side.

Limits

  • 20 MB per request as sent (use gzip), 150 MB of JSON after decompression.
  • 100 SBOMs and 2,000 check results per report.
  • 120 uploads per key and hour.

Read API

The servers, findings and checks of the account as JSON, for your own reports and tools. It needs a key of scope api (create one on the keys page) and the Team or Business plan. Servers of other accounts answer 404, as servers that do not exist; 3,600 requests per key and hour.

RequestAnswer
GET /api/v1/serversThe servers, worst first, with counts per severity, known exploited, fixable, failing checks, OS and last report; totals for the account.
GET /api/v1/servers/{id}One server and its places (host, images, app directories) with their counts.
GET /api/v1/servers/{id}/findingsThe findings, most urgent first, each with its fix. Filters: severity (critical, high, medium, low, unknown), kev=true, fixable=true, place; pages with limit (1 to 500, default 100) and offset. total counts all that match.
GET /api/v1/servers/{id}/checksThe check results, failing first, with the evidence and the link to the explanation.
# all servers
curl -fsS -H "Authorization: Bearer $API_KEY" https://patchbrief.ch/api/v1/servers
# the known exploited findings of server 56
curl -fsS -H "Authorization: Bearer $API_KEY" "https://patchbrief.ch/api/v1/servers/56/findings?kev=true"
# critical findings, 50 at a time
curl -fsS -H "Authorization: Bearer $API_KEY" "https://patchbrief.ch/api/v1/servers/56/findings?severity=critical&limit=50&offset=50"

A finding in the answer:

{
  "id": 9812, "server_id": 56, "server": "web-1",
  "place": "host", "place_kind": "host", "part": "os",
  "pkg_type": "debian", "pkg": "openssh-server",
  "installed": "1:9.2p1-2+deb12u2", "fixed": "1:9.2p1-2+deb12u3",
  "vuln_id": "CVE-2024-6387", "cve_id": "CVE-2024-6387",
  "severity": "high", "kev": false, "epss": 0.2, "epss_percentile": 0.98, "rank": 2,
  "first_seen": "2026-11-20T04:10:00Z", "last_seen": "2026-11-26T04:10:00Z",
  "fix": {"command": "sudo apt-get install --only-upgrade openssh-server"}
}

Errors use the format above: 401 unauthorized, 403 wrong_scope (a key of scope agent) or plan, 400 bad_parameter, 404 not_found, 429 rate_limited.

Webhooks

A webhook channel (alert settings) gets each alert, the digest and test messages as a JSON POST to your https address. Three headers come with it:

  • X-Patchbrief-Event: alert, digest or test
  • X-Patchbrief-Timestamp: seconds since 1970
  • X-Patchbrief-Signature: sha256= and the hex HMAC-SHA256 of timestamp + "." + body with the signing secret of the channel

Check the signature and refuse timestamps older than five minutes. The body holds event, site, sent_at, subject, text, link and, for alerts, data with the details. The address must be https on a public IP address; we do not follow redirects and wait 10 seconds at most.