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
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.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.
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.
| Status | Meaning | Example body |
|---|---|---|
401 | Missing, invalid, or expired token | {"error":"Invalid or expired API token"} |
402 | Endpoint requires a license tier you don’t have | {"error":"...","code":"FEATURE_NOT_LICENSED","feature":"..."} |
403 | Token missing a required scope, or role-gate failure | {"error":"API token missing required scope","required":"scans:trigger","granted":["scans:read"]} |
404 | Resource not found in your active org | {"error":"Scan job not found"} |
409 | Conflict (e.g. resource already exists) | {"error":"Resource already exists"} |
422 | Request body failed validation | {"error":"Validation error","details":{"scanTypes":["Required"]}} |
429 | Rate-limited | {"error":"Too many requests, please slow down"} |
500 | Unhandled server error - file an issue with the x-request-id header | {"error":"Internal server error"} |
x-request-id response header; include it when contacting support.
OpenAPI spec
A machine-readable OpenAPI 3.1 spec for the BreachLens REST API is on the roadmap. For now, this page is the canonical reference - the routes documented here 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.