GET /api/static/scan
Check the status of a scan and retrieve results once completed.Request
Headers:x-api-key(required): Your Rafter API key
scan_id(required): The scan request ID to checkformat(optional): Output format -json(default),md, orsarif.formatonly changes the response shape once the scan hascompleted; a pending, processing, or failed scan returns the same body regardless offormat.
Example Requests
Check status (JSON format):Response
Scan Pending/Processing
Status: pending, queued, or processingScan Completed (JSON Format)
Status: completedScan Completed (Markdown Format - format=md)
Status: completed with format=md Whenformat=md is specified, the response includes a markdown field containing a security report written as a prompt for an AI coding agent. Findings that share a description are grouped into one issue, with its severity, count, and file/line locations.
Rule IDs in the markdown report are hashed (
R- plus five hex characters), so they do not match the rule_id values in the JSON format. The report opens with a security-engineer role prompt and ends with a request for a fix and a one-line note per finding. A scan with no findings returns a short “No Issues Found” report.Scan Failed
Status: failederror_code is drawn from a stable, closed catalog — programs should branch on it rather than on the error text, which can change. A failure that requires you to fix something in your account (for example a revoked GitHub token) also includes an action_url pointing at the page to fix it:
retryable is true when re-running the same scan unchanged might succeed (a timeout or a transient worker fault), and false when something about the input or your account has to change first. A handful of other error_code values you may see: REPO_NOT_FOUND, ACCESS_DENIED, NEEDS_TOKEN, SCAN_TIMEOUT, SCAN_FAILED (the generic fallback).
No Vulnerabilities Found
Status: completed with no issuesError Responses
Error (400 Bad Request):scan_id is missing:
completed scan whose report could not be read from storage. It is never reported as an empty vulnerabilities list.
Error (500 Internal Server Error):
Response Fields
Common Fields
Completed Scan Fields (JSON)
Vulnerability Object Fields
Failed Scan Fields
format=sarif on a completed scan returns the full SARIF 2.1.0 document directly — it is not wrapped in the status/scan_id envelope the way json and md are.
