Quickstart
Every endpoint lives under /api/v1 and speaks JSON. Create an API token under Settings → API tokens, then start a scan and read its status:
export SETENFORCE_TOKEN=se_...
curl -s -X POST /api/v1/validation/single \
-H "Authorization: Bearer $SETENFORCE_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"domain": "example.com"}'
# {"validation_id": 4711, "task_id": "...", "status": "PENDING", ...}
curl -s /api/v1/validation/jobs/4711/status \
-H "Authorization: Bearer $SETENFORCE_TOKEN"
Authentication
Send a personal API token (se_...) in either header: Authorization: Bearer se_... or X-API-Key: se_.... A token acts as the user who created it, in the organization it was created in, and never with more rights than that user's role there. Tokens are created, listed and revoked from a signed-in browser session only. A token can expire, and revoking it takes effect on the next request.
Give each token only the scopes it needs. A token with no scope list (all tokens issued before scopes existed) has its owner's full non-admin access. A scoped token is refused, with 403 INSUFFICIENT_SCOPE, by every endpoint outside its scopes.
| Scope | Grants |
|---|---|
| scan:write | Start single and batch scans, manage the watchlist and trigger its scans |
| scan:read | Read scan jobs, domains, results, assets, portfolio and monitoring |
| findings:read | Read findings, framework coverage, score explanation and deviations |
| findings:write | Triage findings and request exceptions (never approve them) |
| assets:write | Create, update and archive assets, import CSV |
| reports:read | List, view, download and export reports |
| webhooks:write | Manage notification channels |
| audit:read | Export the organization's audit trail (needs the owner, admin or auditor role) |
Token management and approving exceptions or suppression rules never accept an API token, whatever its scopes (PAT_NOT_ALLOWED, PAT_CANNOT_APPROVE). Administration is not reachable with a token at all: those routes answer 404, as they do for any non-admin.
Scan, Poll, Export
- Start a scan (scan:write). POST /validation/single with {"domain": "example.com"}, or POST /validation/batch with {"domains": ["a.example", "b.example"]}. Both answer with a validation_id. A batch also lists the rejected_domains it will not scan, and why. A name that cannot be scanned is refused before any quota is spent (see the DOMAIN_* codes under Errors). Add "standards": ["DNSSEC", "DANE"] to run only those standards and "probe_mode": "passive" to hold the probe depth down; GET /validation/capabilities (scan:read, optional ?domain=) lists what your account can choose. A subset costs the same quota and is a partial scan: it has no compliance score and does not enter the scoreboard or the public statistics. Bad choices answer UNKNOWN_STANDARD, PROBE_MODE_NOT_AVAILABLE and the like before anything is spent.
- Poll (scan:read). GET /validation/jobs/{validation_id}/status until status is SUCCESS, FAILURE, REVOKED or CANCELLED; PENDING and PROGRESS mean keep waiting. Poll every 5 to 10 seconds, or subscribe to the scan.completed webhook instead. A single-domain scan usually takes 2 to 5 minutes.
- Read findings (findings:read). GET /validations/{validation_id}/findings returns one row per check with check_id, status (pass, partial, fail, not_applicable, not_tested, unknown), severity and evidence. For a batch, add ?domain=. Evidence is kept for the organization's retention period (24 months by default); after that a finding still comes back, with evidence_expired true and evidence reduced to a single __evidence_expired__ object (when, how many bytes). GET /validations/history?domain=example.com (scan:read) lists your organization's completed scans of that exact domain, newest first, for picking two to compare.
- Export (reports:read). GET /validations/{validation_id}/export?format=... for one scanned domain:
| format | Result |
|---|---|
| sarif | SARIF 2.1.0 for code-scanning tools. With fail_on=high (any severity), the log's exit code is 1 when an unsuppressed failing finding is at or above it, which makes it a pipeline gate. |
| oscal | OSCAL 1.1.3 assessment results against one framework (required). |
| xlsx | Auditor working paper: one sheet per control area, one row per finding, with lifecycle state, owner, due date and exception. |
| bundle | Hash-chained evidence bundle (.zip); add framework to include that framework's coverage. It is not signed: see What an export proves. |
Whole-validation reports (PDF, HTML, JSON, CSV, XLSX; batches as one file or a zip) come from POST /reports/{validation_id}/export?format=pdf.
What an export proves
- Lifecycle is as of export time. Finding state, owner, due date and exceptions belong to the asset, not to the scan, so every export shows the state at the moment you export, not at the moment the scan ran. Exporting an older scan shows today's owner, due date and exceptions, and its OSCAL risks leave out findings closed since. Each format says so itself: SARIF in runs[0].properties.lifecycle_as_of_note, OSCAL in metadata.remarks, XLSX on the About sheet, the bundle in manifest.json (lifecycle_as_of_note), the coverage report API response in as_of_note (next to exceptions_as_of), and the HTML and PDF reports in the introduction of their coverage section.
- The evidence bundle is hash-chained but not signed. manifest.json lists the SHA-256 of every member, and the findings fold into a Merkle root that is compared with the root sealed when the scan completed. That proves the files are intact and match what the server held for this scan (integrity against the server). It does not prove who produced the bundle (authorship): there is no digital signature, so a party who can rebuild a manifest can rebuild a self-consistent bundle. manifest.json states this in integrity.signed (false) and integrity.authenticity_note. Treat a bundle that reached you from someone else as a claim, not as proof: export the same scan yourself and compare the Merkle roots.
- Evidence expires, findings do not. Once a finding is older than the organization's evidence retention period, only its evidence payload is deleted. The bundle then lists that member under integrity.expired_evidence; its finding_hash is the one recorded when the scan ran, so the Merkle root still matches, but the hash can no longer be recomputed from the (deleted) evidence. The verdict fields (status, severity) of such a finding are therefore still covered by the sealed root, but no longer individually re-verifiable.
curl -s "/api/v1/validations/4711/export?format=sarif&fail_on=high" \ -H "Authorization: Bearer $SETENFORCE_TOKEN" -o setenforce.sarif
Migrating from the securityheaders.com API
The securityheaders.com API was one synchronous GET: you sent a domain and got the headers and a grade back in the same response. This API is asynchronous. You start a scan, poll until it finishes, then read the result: three requests, not one. A scan of only the web security standard took about a minute in our test, so do not expect an answer in the first response. There is no letter grade. Each check has a status and a severity.
The token needs scan:write, scan:read and findings:read (see Authentication).
1. Start a headers-only scan
curl -s -X POST https://setenforce.org/api/v1/validation/single \
-H "Authorization: Bearer $SETENFORCE_TOKEN" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"domain": "yourdomain.tld", "standards": ["web_security"]}'
# {"validation_id": 4711, "task_id": "...", "status": "PENDING",
# "message": "Domain validation started for yourdomain.tld",
# "estimated_completion": "2-5 minutes", "rejected_domains": null}
"web_security" is the web security standard: the response headers plus the certificate, TLS versions, cookies and mixed content. "web-security" and "WEB_SECURITY" mean the same. A name the API does not know answers 422 UNKNOWN_STANDARD, with the valid names in details.available, before anything is spent. security.txt is a separate standard ("security_txt"); add it to the list to scan both. Use a domain that resolves on the public internet: reserved names such as example.com answer 422 DOMAIN_RESERVED.
Metering. A scan of any subset costs one domain against your daily quota, the same as a full scan (GET /quota/status shows where you stand). It also takes up one of your concurrent scan slots until it finishes. Because a subset is a partial scan, it has no compliance score, does not enter the scoreboard or the public statistics, and never reuses the shared result cache.
2. Poll until it finishes
curl -s https://setenforce.org/api/v1/validation/jobs/4711/status \
-H "Authorization: Bearer $SETENFORCE_TOKEN"
# {"validation_id": 4711, "status": "SUCCESS", "progress_percent": 100, "current_stage": "completed",
# "primary_domain": "yourdomain.tld", "scan_config": {"standards": ["WEB_SECURITY"]},
# "result": {"yourdomain.tld": {"WEB_SECURITY": {"status": "success", ...}}}, ...}
PENDING and PROGRESS mean keep waiting; poll every 5 to 10 seconds. Stop on SUCCESS, FAILURE, REVOKED or CANCELLED. SUCCESS means the job ran to the end, not that the web check could be completed. On a slow site a job can finish as SUCCESS with result.<domain>.WEB_SECURITY.status set to "error" (STANDARD_DEADLINE_EXCEEDED) and no header results. Check that field is "success" before you trust an empty findings list, and start the scan again if it is not.
3. Read the results
curl -s "https://setenforce.org/api/v1/validations/4711/findings?status=fail,partial" \
-H "Authorization: Bearer $SETENFORCE_TOKEN"
# {"domain": "yourdomain.tld", "probe_mode": "passive",
# "counts": {"critical": 0, "high": 1, "medium": 1, "low": 3, "info": 27, "not_tested": 2, "unknown": 3},
# "findings": [{"check_id": "web.headers.modern_isolation", "status": "fail", "severity": "low",
# "evidence_summary": "...", "impact": "...", "remediation": "...", ...}, ...], ...}
The findings endpoint is GET /validations/{id}/findings (plural, findings:read), not under /validation/jobs. It returns one row per check, worst first. The header checks you used to read from the old response are these:
| Header | check_id |
|---|---|
| Strict-Transport-Security | web.hsts.present, web.hsts.policy_strength |
| Content-Security-Policy | web.headers.content_security_policy, web.csp.effective_policy |
| X-Frame-Options, frame-ancestors | web.headers.frame_options, web.framing.clickjacking_defence |
| X-Content-Type-Options | web.headers.content_type_options |
| Referrer-Policy | web.headers.referrer_policy |
| Permissions-Policy, Cross-Origin-Opener-Policy | web.headers.modern_isolation |
| Cross-Origin-Embedder-Policy, Cross-Origin-Resource-Policy | web.headers.cross_origin_isolation |
GET /validation/jobs/{id}/domains (scan:read) returns the raw per-standard result instead, including the headers it read under security_headers and the parsed HSTS policy under hsts.
Repeat scans. The web check requests the site itself, so a scan of a domain within 10 minutes of an earlier scan of it (yours or anyone's) reuses that earlier web result instead of requesting the site again. Such a job finishes in under a second as SUCCESS with the same result in jobs/{id}/domains, but it writes no new findings, so /validations/{id}/findings comes back empty. If you scan the same domain repeatedly, read the result from jobs/{id}/domains or wait out the window.
A polling helper
#!/usr/bin/env bash
# usage: headers-scan.sh yourdomain.tld (needs curl, jq, uuidgen and SETENFORCE_TOKEN)
set -euo pipefail
API=https://setenforce.org/api/v1; auth=(-H "Authorization: Bearer $SETENFORCE_TOKEN")
id=$(curl -fsS -X POST "$API/validation/single" "${auth[@]}" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" -d "{\"domain\":\"$1\",\"standards\":[\"web_security\"]}" | jq -r .validation_id)
while :; do
s=$(curl -fsS "$API/validation/jobs/$id/status" "${auth[@]}" | jq -r .status)
case $s in SUCCESS) break;; FAILURE|REVOKED|CANCELLED) echo "scan $s" >&2; exit 1;; esac
sleep 8
done
curl -fsS "$API/validations/$id/findings?status=fail,partial" "${auth[@]}" \
| jq '.findings[] | {check_id, status, severity, evidence_summary}'
import os, time, requests
API = "https://setenforce.org/api/v1"
H = {"Authorization": f"Bearer {os.environ['SETENFORCE_TOKEN']}"}
def headers_scan(domain):
r = requests.post(f"{API}/validation/single", headers=H, json={"domain": domain, "standards": ["web_security"]})
r.raise_for_status()
vid = r.json()["validation_id"]
while (s := requests.get(f"{API}/validation/jobs/{vid}/status", headers=H).json()["status"]) not in ("SUCCESS", "FAILURE", "REVOKED", "CANCELLED"):
time.sleep(8)
if s != "SUCCESS":
raise RuntimeError(f"scan {s}")
return requests.get(f"{API}/validations/{vid}/findings", headers=H, params={"status": "fail,partial"}).json()["findings"]
Or skip polling: subscribe to the scan.completed webhook. For a quick look in the browser, the security headers checker runs the same web security standard without an account.
Webhooks
Add a webhook under Notification channels (or POST /notifications/channels with webhooks:write). Only organization owners and admins can create, edit or test a webhook (others get 403 ROLE_CANNOT_MANAGE_WEBHOOKS); the role is checked in the active organization, and finding.* events are delivered only while the webhook's owner is an owner or admin of the finding's organization. Each webhook is an HTTPS POST of a JSON body {"id", "type", "created_at", "data"}. Events: scan.completed, finding.opened, finding.fixed, finding.state_changed, exception.expiring, alert.raised, certificate.expiring (and webhook.test from the Test button).
X-SetEnforce-Signature: t=<unix time>,v1=<hex>, where v1 is HMAC-SHA256 of "<t>." + raw body keyed with your whole whsec_... secret. Verify against the raw bytes before parsing the JSON, compare in constant time, and reject a t more than 5 minutes from your clock to stop replays. Delivery is at-least-once: dedupe on X-SetEnforce-Event-Id. Answer with any 2xx within 10 seconds.
Retries and dead-letter
A delivery is attempted up to 5 times in all: the first send and four retries. After a failed attempt (no 2xx within 10 seconds, or a connection error) the retry comes 1 second, then 10 seconds, then 1 minute, then 10 minutes later, each delay varied by up to 20% either way. If the fifth attempt fails too, the delivery is dead-lettered: it is marked failed, kept in the delivery log under Notification channels for 30 days, and never sent again. A delivery is also dead-lettered without further attempts when the webhook is disabled or its owner no longer holds the role needed to receive that event. Every attempt re-sends the same body and the same X-SetEnforce-Event-Id. The Test button sends once and does not retry.
# Python
import hashlib, hmac, time
def verify(secret: str, body: bytes, header: str, tolerance: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t = int(parts["t"])
if abs(time.time() - t) > tolerance:
return False # too old (or too new): possible replay
expected = hmac.new(secret.encode(), f"{t}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))
// Node.js (rawBody: the request body as a Buffer, before JSON.parse)
const crypto = require('crypto');
function verify(secret, rawBody, header, toleranceSec = 300) {
const parts = Object.fromEntries(header.split(',').map(p => p.split('=', 2)));
const t = Number(parts.t);
if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest('hex');
const a = Buffer.from(expected), b = Buffer.from(parts.v1 || '');
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
Pagination
List endpoints take limit (page size) and cursor, and answer with items and next_cursor. To read everything, pass each response's next_cursor back as cursor until it is null. Keep the other query parameters (filters, sort) the same on every page. Treat the cursor as opaque: its format may change. A cursor this API did not issue is refused with 400 INVALID_CURSOR.
cursor=""
while :; do
page=$(curl -s "$BASE/validation/jobs?limit=100${cursor:+&cursor=$cursor}" -H "Authorization: Bearer $SETENFORCE_TOKEN")
echo "$page" | jq -c '.items[]'
cursor=$(echo "$page" | jq -r '.next_cursor // empty')
[ -z "$cursor" ] && break
done
| Endpoint | limit (default / max) | Order |
|---|---|---|
| GET /validation/jobs | 50 / 1000 | newest first (or `sort`, `order`) |
| GET /reports/ | 50 / 200 | oldest first |
| GET /assets | 25 / 100 | domain name |
| GET /portfolio/domains | 25 / 100 | domain name |
| GET /remediation-tickets | all / 500 | overdue first, then due date, severity, newest |
| GET /monitoring/alerts | 50 / 500 | newest first |
| GET /monitoring/snapshots/{watchlist_id} | 50 / 500 | newest first |
| GET /watchlist | 100 / 1000 | newest first |
| GET /notifications/channels/{channel_id}/deliveries | 50 / 200 | newest first |
Apart from GET /reports/ (see Versioning), these endpoints also keep the paging parameters they had before (offset, skip, page and page_size) and fields such as total; a cursor wins over them. Short, bounded lists (your organizations, members, tokens, notification channels, suppression rules, one scan's findings) return every item at once.
Rate Limits
Every API response carries your request budget for the current one-minute window:
- RateLimit-Limit: requests allowed per minute.
- RateLimit-Remaining: requests left in this window.
- RateLimit-Reset: seconds until the window resets.
The budget is per API token, so one busy integration never slows down another or your own use of the web app. Its size is your plan's requests per minute:
| Plan | Requests per minute, per token |
|---|---|
| Free Tier | 40 |
| Pro Tier | 60 |
| Business Tier | 100 |
Past the budget an API token gets 429 RATE_LIMITED. Every 429 carries Retry-After (seconds): wait that long, then retry. Some endpoints have their own tighter limit (scan submission, sign-in, sending a test notification). A 429 from such a limit reports that limit in its RateLimit-* headers. Scans are also bound by daily quotas (QUOTA_EXCEEDED, BATCH_QUOTA_EXCEEDED) and by how many may run at once (CONCURRENT_LIMIT_EXCEEDED); GET /quota/status shows where you stand. Browser sessions see the same headers for information; they are not throttled by this budget.
Scan credits. A scan made with an API token that the daily domain quota would refuse can be paid for with prepaid credits instead: 1 credit per domain (a batch of 20 domains costs 20 and needs a balance of 20), only while credit auto-use is on, and auto-use spends at most 1,000 credits per UTC day. Scans within your quota and scans started in the web app never cost credits. When credits do not pay, the QUOTA_EXCEEDED refusal keeps its code and adds a credits object (the cost of the call and the billing_url) and a message; it never reports your balance. Balance, history and costs are on the billing page.
Idempotency
POST /validation/single and POST /validation/batch accept an Idempotency-Key header (any unique string up to 255 characters; a UUID works). If a request times out or your pipeline step is retried, send it again with the same key: you get the first response back, with Idempotent-Replayed: true, and no second scan starts or counts against your quota.
- Keys are remembered for 24 hours, per user and per endpoint.
- Only a successful response is remembered. If the first attempt failed (for example QUOTA_EXCEEDED), the retry runs again for real.
- The same key with a different body, or from another organization, is refused with 422 IDEMPOTENCY_KEY_REUSED.
- A retry that arrives while the first request is still running gets 409 IDEMPOTENCY_KEY_IN_PROGRESS; retry it a moment later.
Errors
Errors use the HTTP status codes you would expect, and every error body has a stable, machine-readable code. Branch on code, not on the human-readable message or detail, whose wording may change. Most errors look like this:
HTTP/1.1 403 Forbidden
{
"error": "PatScopeException",
"code": "INSUFFICIENT_SCOPE",
"message": "This API token lacks the 'scan:write' scope",
"details": {"code": "INSUFFICIENT_SCOPE", "required_scope": "scan:write"},
"path": "/api/v1/validation/single"
}
Some older endpoints answer {"detail": ..., "code": ...} instead, where detail is a message or an object. code is always at the top level. New codes may be added at any time, so treat an unknown code like the generic code for its HTTP status.
| code | Status | Meaning |
|---|---|---|
| BAD_REQUEST | 400 | The request is malformed; see message. |
| UNAUTHENTICATED | 401 | No valid credential: missing, malformed, expired or revoked token. |
| FORBIDDEN | 403 | Authenticated, but not allowed to do this. |
| NOT_FOUND | 404 | No such resource, or not one you can see (other users' and orgs' ids are 404, not 403). |
| METHOD_NOT_ALLOWED | 405 | The path exists but not with this HTTP method. |
| CONFLICT | 409 | The resource is not in a state that allows this change. |
| LENGTH_REQUIRED | 411 | A multipart upload must carry a Content-Length header; chunked uploads are refused. |
| PAYLOAD_TOO_LARGE | 413 | The upload is too large. |
| UNSUPPORTED_MEDIA_TYPE | 415 | The body's content type is not accepted. |
| UNPROCESSABLE | 422 | The request is well-formed but its content is refused; see message. |
| VALIDATION_FAILED | 422 | Request parameters or body failed schema validation; see details.validation_errors. |
| RATE_LIMITED | 429 | Too many requests. Wait for Retry-After seconds. |
| INTERNAL_ERROR | 500 | Unexpected server error. Safe to retry later. |
| DATABASE_ERROR | 500 | A database error occurred. Safe to retry later. |
| UPSTREAM_ERROR | 502 | A service we depend on failed. |
| SERVICE_UNAVAILABLE | 503 | Temporarily unavailable. Retry later. |
| INSUFFICIENT_SCOPE | 403 | The API token lacks the scope this endpoint needs; details.required_scope names it. |
| PAT_NOT_ALLOWED | 403 | This endpoint never accepts API tokens (for example token management or a password change); use a browser session. |
| PAT_CANNOT_APPROVE | 403 | Approvals, revocations and policy changes need an interactive session, not an API token. |
| INVALID_CURSOR | 400 | The cursor is not one this API issued. |
| IDEMPOTENCY_KEY_REUSED | 422 | This Idempotency-Key was already used with a different request body. |
| IDEMPOTENCY_KEY_IN_PROGRESS | 409 | A request with this Idempotency-Key is still being processed. Retry shortly. |
| QUOTA_EXCEEDED | 429 | Daily domain quota used up; details carry used, limit and reset_time. With credits on, an API-token refusal also carries message and credits (cost, per_domain, billing_url). |
| CONCURRENT_LIMIT_EXCEEDED | 429 | Too many scans running at once for your tier. |
| SINGLE_STANDARD_HOURLY_LIMIT | 429 | The hourly allowance of single-standard checks is used up; details.reset_in_seconds says when it renews. |
| SINGLE_STANDARD_CACHED_HOURLY_LIMIT | 429 | Too many cached single-standard results were requested this hour; try again later. |
| SINGLE_STANDARD_IN_FLIGHT | 429 | A check of the same domain and standard is already running; once it finishes its result is shown again at no cost. |
| BATCH_QUOTA_EXCEEDED | 429 | Daily batch-job quota used up. |
| DOMAIN_SYNTAX_INVALID | 422 | Not a syntactically valid domain name. |
| DOMAIN_IS_IP | 422 | An IP address, not a domain name. |
| DOMAIN_SUFFIX_INVALID | 422 | The name does not end in a real top-level domain. |
| DOMAIN_NOT_REGISTRABLE | 422 | A single-label name or a public suffix, not a registrable domain. |
| DOMAIN_RESERVED | 422 | A reserved or special-use name that does not resolve on the public internet. |
| DOMAIN_NOT_REGISTERED | 422 | The registrable domain does not exist in DNS. |
| HOST_NOT_FOUND | 422 | The domain exists but this host under it publishes nothing. |
| DNS_LOOKUP_FAILED | 503 | Could not tell whether the domain exists. Retry later. |
| NO_SCANNABLE_DOMAINS | 422 | Batch: none of the submitted domains can be scanned; detail.rejected says why. |
| UNKNOWN_STANDARD | 422 | A requested standard is not registered; details.available lists the valid names. |
| DUPLICATE_STANDARD | 422 | A standard is listed more than once in `standards`. |
| EMPTY_STANDARD_SELECTION | 422 | `standards` is empty; omit it to run every standard. |
| STANDARD_DISABLED | 422 | A requested standard is switched off by an administrator. |
| PROBE_MODE_NOT_AVAILABLE | 403 | The requested probe_mode is deeper than the account holds for this domain; details.granted names what it holds and details.reason why. |
| RESCAN_SETTINGS_NOT_APPLICABLE | 422 | A rescan body names scan settings, which a single-standard check does not have. |
| COMPARE_DIFFERENT_ASSET | 422 | The two scans are not of the same domain in the same organization. |
| COMPARE_SAME_SCAN | 422 | A scan cannot be compared with itself. |
| SCAN_NOT_COMPLETED | 409 | A scan being compared has not completed yet. |
| ROLE_CANNOT_TRIAGE | 403 | Your organization role cannot change findings. |
| NOTHING_TO_CHANGE | 422 | The update names no state, assignee or unassign. |
| ILLEGAL_TRANSITION | 422 | That state change is not allowed from the finding's current state. |
| FIXED_IS_ENGINE_ONLY | 422 | Only a passing scan marks a finding fixed. |
| RESOLVE_EVENT_STYLE_ONLY | 422 | Only an event-style finding can be resolved by hand. |
| STALE_FINDING_STATE | 409 | The finding changed since you read it (expected_version mismatch). Reload and retry. |
| INVALID_ASSIGNEE | 422 | The assignee is not an owner, admin or member of the organization. |
| ROLE_CANNOT_REQUEST | 403 | Your organization role cannot request exceptions. |
| ROLE_CANNOT_APPROVE | 403 | Only an organization owner or admin can do this. |
| SEPARATE_APPROVER_REQUIRED | 403 | The organization requires someone other than the requester to approve. |
| SOD_NEEDS_TWO_APPROVERS | 409 | Separation of duties needs at least two active owners or admins. |
| SOD_ON_PERSONAL_ORG | 422 | Separation of duties cannot be enabled on a personal organization. |
| INVALID_KIND | 422 | kind must be risk_accepted or false_positive. |
| EXPIRY_REQUIRED | 422 | An expiry date is required. |
| EXPIRY_OUT_OF_RANGE | 422 | The expiry exceeds the organization's maximum acceptance period. |
| REASON_TOO_SHORT | 422 | The reason is shorter than the minimum length. |
| REASON_TOO_LONG | 422 | The reason is longer than the maximum length. |
| MAX_ACCEPTANCE_DAYS_OUT_OF_RANGE | 422 | max_acceptance_days must be between 1 and 365. |
| PENDING_EXISTS | 409 | The finding already has a pending exception request. |
| NOT_PENDING | 409 | The request or rule is no longer pending. |
| NOT_APPROVED | 409 | The exception is not active. |
| NOT_ACTIVE | 409 | The suppression rule is not active. |
| EXCEPTION_EXPIRED | 409 | The request's expiry date has already passed. |
| RULE_EXPIRED | 409 | The rule's expiry date has already passed. |
| EVIDENCE_CHANGED_SINCE_REQUEST | 409 | The finding's evidence changed after the request was filed. |
| CHECK_ID_INVALID | 422 | A suppression rule covers exactly one check_id; no wildcards. |
| CHECK_ID_UNKNOWN | 422 | No such check_id. |
| SELECTOR_INVALID | 422 | The asset selector is malformed. |
| SELECTOR_UNKNOWN_KEY | 422 | The asset selector has a key it does not support. |
| SELECTOR_EMPTY | 422 | The asset selector needs at least one condition (environment, tags_any or asset_ids). |
| ASSET_NOT_IN_ORG | 422 | An asset id is not an asset of this organization. |
| ROLE_CANNOT_EDIT_TICKETS | 403 | Your organization role cannot create or change tickets. |
| OPEN_TICKET_EXISTS | 409 | The finding already has an open ticket; details.ticket_id names it. |
| TICKET_CLOSED | 409 | The ticket is closed; reopen it first. |
| TICKET_NOT_CLOSED | 409 | The ticket is not closed. |
| EMPTY_TEXT | 422 | The text must not be empty. |
| TEXT_TOO_LONG | 422 | The text is longer than the maximum length. |
| ROLE_CANNOT_MANAGE_WEBHOOKS | 403 | Only an organization owner or admin can create, edit or test a webhook channel. |
| WEBHOOK_ORG_UNRESOLVED | 403 | The webhook is not linked to an organization, so it can only be disabled or deleted. |
| EVIDENCE_RETENTION_OUT_OF_RANGE | 422 | months must be between 3 and 120; details.min and details.max say so. |
| BRANDING_NAME_INVALID | 422 | The report name is longer than 80 characters or contains control or invisible formatting characters. |
| BRANDING_COLOR_INVALID | 422 | A brand colour is not written #RRGGBB. |
| BRANDING_COLOR_LOW_CONTRAST | 422 | A brand colour is too light for the white text reports print on it; details carry contrast and minimum. |
| BRANDING_LOGO_TYPE | 415 | The logo is not a PNG or JPEG image (SVG, GIF and WebP are refused). |
| BRANDING_LOGO_TOO_LARGE | 413 | The logo is larger than 256 KB, or too detailed to store within that size. |
| BRANDING_LOGO_INVALID | 422 | The logo cannot be decoded as an image, is under 16 pixels a side or has more than 4 megapixels. |
| BRANDING_REQUIRES_PREMIUM | 403 | Report branding is available on the Business plan; the caller's plan does not include it. |
| BRANDING_ORG_LIMIT | 409 | The account already has the maximum number of branded organizations for its plan; details.limit says how many. Editing an already branded organization is always allowed and removing a branding frees a slot. |
| SAVED_VIEW_UNKNOWN_PAGE | 422 | The page is not one views can be saved for; details.available lists the valid names. |
| SAVED_VIEW_NAME_INVALID | 422 | The view name is empty, too long (100 characters) or contains control characters. |
| SAVED_VIEW_FILTERS_INVALID | 422 | A filter is not known for this page or its value is refused; details.errors lists each. |
| SAVED_VIEW_NAME_EXISTS | 409 | You already have a view with this name on this page. |
| SAVED_VIEW_LIMIT_REACHED | 409 | You already keep the maximum number of saved views; details.limit says how many. |
| ROLE_CANNOT_SHARE_VIEW | 403 | Your organization role cannot share saved views with the organization. |
| SEARCH_QUERY_INVALID | 422 | The search term contains control characters. |
| SEARCH_QUERY_TOO_SHORT | 422 | The search term is shorter than 2 characters. |
| ASSET_HAS_LIFECYCLE_HISTORY | 409 | The asset has finding history and cannot be deleted; archive it. |
| PROFILE_RULES_INVALID | 422 | The policy profile rules are invalid; details.errors lists why. |
| PROFILE_NAME_TOO_LONG | 422 | The policy profile name is too long. |
| BILLING_PROVIDER_UNKNOWN | 404 | No such billing provider, or it is not enabled. |
| BILLING_SIGNATURE_INVALID | 400 | The webhook signature is missing or wrong, the timestamp is stale, or the body is not a valid event. |
| BILLING_EVENT_INVALID | 400 | The event is signed but its id or type is not storable. |
| BILLING_STORAGE_UNAVAILABLE | 503 | The event could not be stored. The provider should retry. |
| BILLING_NOT_ORG_OWNER | 403 | Only an owner of the organization can buy a plan for it. |
| BILLING_CHECKOUT_IN_PROGRESS | 409 | Another owner of this organization has a checkout in progress; try again later. |
| BILLING_SUBSCRIPTION_EXISTS | 409 | This organization already has a live subscription; change its plan instead of buying a second one. |
| BILLING_DISABLED | 404 | Billing is switched off, so checkout and the customer portal are not available. |
| BILLING_PROVIDER_NOT_CONFIGURED | 409 | Billing is switched on but the payment provider is not configured. |
| BILLING_PLAN_UNAVAILABLE | 404 | That plan or billing interval is not for sale. |
| BILLING_PLAN_NOT_FOR_ORG | 422 | Pro is a personal plan and can not be bought for a team organization; buy Business. |
| BILLING_NO_SUBSCRIPTION | 404 | The organization has no subscription. |
| BILLING_NOT_PAYER | 403 | Only the person who pays for the subscription can open its billing portal. |
| BILLING_PROVIDER_ERROR | 502 | The payment provider could not be reached; try again shortly. |
| BILLING_EVENT_NOT_DEAD_LETTERED | 409 | Only a dead-lettered, unprocessed payment event can be requeued. |
| BILLING_BAD_FILTER | 400 | The subscription status filter is not one of the known statuses. |
| BILLING_NOTHING_TO_REFUND | 409 | The order or subscription has no payment left to refund. |
| BILLING_REFUND_TOO_LARGE | 400 | The refund is larger than the amount paid. |
| BILLING_REFUND_IN_PROGRESS | 409 | A refund was requested for this payment moments ago. |
| BILLING_REFUND_UNSUPPORTED | 501 | This payment provider cannot issue refunds through the API. |
| BILLING_REFUND_REJECTED | 400 | The payment provider rejected the refund. |
| BILLING_PROVIDER_UNREACHABLE | 502 | The payment provider could not be reached; the refund state is unknown. |
| MAIL_SMTP_KEY_REQUIRED | 422 | Changing the SMTP host, port, security or login needs the SMTP key typed again. |
| CREDITS_DISABLED | 404 | Prepaid credits are switched off, so the auto-use setting cannot be changed. |
| REPORT_RESULT_UNAVAILABLE | 404 | The anonymous result has expired, does not exist, or is not a completed full scan. |
| REPORT_FRAMEWORK_REQUIRED | 422 | A framework evidence pack needs one known framework id. |
| REPORT_TOO_MANY_ORDERS | 429 | Too many unpaid report orders for this result in the last 24 hours. |
| REPORT_NOT_FOUND | 404 | The report link is invalid or has expired. |
| ORIGIN_NOT_ALLOWED | 403 | The request names another site as its origin. |
Versioning
The version is in the path: /api/v1. Within v1 we only make changes that a well-behaved client absorbs without a code change:
- new endpoints, new optional parameters and new headers;
- new fields in responses and webhook payloads (ignore fields you do not know);
- new checks, controls, frameworks, webhook event types and error codes;
- new values for a deprecated alias's replacement, never a change to the alias itself.
These need a new API version, and will not happen within v1:
- removing or renaming an endpoint, a parameter or a response field, or changing a field's type;
- changing the status vocabularies: job status (PENDING, PROGRESS, SUCCESS, FAILURE, REVOKED, CANCELLED), finding status and severity, finding lifecycle states;
- renaming, reusing or changing the meaning of a check_id or a control id. A check id is an external interface: when a check is replaced, the new check gets a new id and the old id is retired, never recycled;
- changing what an error code means, or what a token scope grants.
Breaking change in v1: GET /reports/
GET /reports/ used to return a bare JSON array of at most 50 reports. It now returns an object, {"items": [...], "next_cursor": null}, like the other paginated lists: read the reports from items and follow next_cursor for the rest (default limit 50, maximum 200). A client that parses the response as an array breaks, and unlike the other lists this one keeps no old-shape fallback. This change does not follow the rules above; we made it on purpose and record it here.
Deprecated fields and parameters keep working for the life of v1. Today these are the validations, offset and has_more fields of GET /validation/jobs, and the offset, skip, page and page_size parameters, replaced by cursor and limit. A security fix may tighten behaviour without a version change.