https://<your-install>/api/*. CI runners, internal scripts, and bespoke dashboards authenticate with a long-lived bearer token minted in Settings -> API Tokens.
Get a token
1
Open the API Tokens tab
In the BreachLens web UI, navigate to Settings -> API Tokens (
/settings?tab=tokens). You need the ADMIN role or higher to mint a token.2
Generate a new token
Click Generate token. Set:
- Name - a short label, e.g.
github-actions-prod. - Scopes - any combination of
scans:trigger,scans:read,findings:read. Tokens follow least-privilege; pick only what the integration needs. - Expiry - 30 days, 90 days, 180 days, 1 year, or never.
3
Copy the token
BreachLens returns the plaintext token once and never again. It starts with
blt_ (e.g. blt_aB3xK9qL...). Paste it into your CI secret store immediately; if you lose it, mint a new one.Authenticate
Every request sendsAuthorization: Bearer <token>. Bearer auth takes precedence over any session cookie on the same request.
403 with a structured body identifying the missing scope:
Example: list findings
GET /api/findings returns a paginated, org-scoped list. Filters compose with AND; multi-value filters accept comma-separated values or repeated query keys.
severity-CRITICAL,HIGH,MEDIUM,LOW,INFOscanType-SAST,SCA,SECRET,IAC,CONTAINER,DAST,PENTEST_FULL,CLOUD,RUNTIME,GITHUB_POSTURE,AI_SECURITYstatus-OPEN,ACKNOWLEDGED,FALSE_POSITIVE,FIXED,IGNOREDconfidence-CONFIRMED,LIKELY,POSSIBLEhasAttackPath-true/falsehasVideo-true/false(proof-of-exploit replay)hasPatch-true/false(cached AI auto-fix patch)page- defaults to1limit- defaults to25, capped at100
For the full per-finding field shape, hit the endpoint once and inspect a row, or open the finding in the web UI and use the same fields the drawer reads. Field names are stable across releases; new fields are additive.
Example: trigger a scan
The CI-friendly endpoint takes a GitHubowner/repo and auto-discovers or creates the BreachLens repository row, then queues the scan. Requires the scans:trigger scope.
scanTypes is optional; omit it to run the default ["SAST", "SCA", "SECRET", "IAC"] bundle. The response is 202 Accepted:
GET /api/scans/:id/events for live progress.
To trigger a scan against a repository already known to BreachLens,
POST /api/repos/:id/scan with the same body shape (minus githubFullName). The repo route requires the scans:trigger scope plus DEVELOPER role or higher.Example: poll scan status
status is one of PENDING, RUNNING, COMPLETED, FAILED, or CANCELLED. Active scans also include currentPhase and currentPhasePct so CI logs can render a progress bar.
status flips to COMPLETED, fetch findings via GET /api/findings?scanType=... or export SARIF 2.1.0 for upload to GitHub Code Scanning, GitLab, Bitbucket, or Azure DevOps:
Rate limiting
/api/* is capped at 300 requests per minute per source. Hit the cap and BreachLens returns 429 with {"error":"Too many requests, please slow down"}. Back off and retry; tokens are not penalized.
A handful of unauthenticated routes (/auth/sso/initiate, /auth/login, /api/setup, /api/invitations, /api/password-resets) use a stricter 10-per-15-minute bucket. Bearer-authenticated calls never hit that limiter.
Errors
BreachLens uses standard HTTP status codes. Error bodies are JSON and always include anerror field.
Every request gets an
x-request-id response header; include it when contacting support.
OpenAPI spec
A machine-readable OpenAPI 3.1 spec covers the scan endpoints — trigger, status, and SARIF export. Grab it at/api-reference/openapi.json, or use the interactive API playground in the sidebar to send real requests from the docs — no Postman or curl needed.
In the playground, set the base URL to your own deployment and paste a
blt_ token. Don’t target a Cloudflare-Access-fronted host (e.g. the hosted demo) with only a bearer token — a browser request can’t clear that edge without a service token. The narrative examples on this page remain the canonical reference; routes are stable and new endpoints are additive.Next steps
VS Code extension
Use BreachLens from inside your editor. No token wiring needed.
MCP server
Wrap BreachLens for AI agents and chat-driven workflows.
Need help?
Email the team. Every licensed customer gets a dedicated channel.