// docs / rest api
REST API
Bearer-authenticated JSON API for passive scan automation, scan status, and findings. Cursor-paginated, rate-limited, and shipped with a machine-readable OpenAPI spec for client codegen. Active scans stay in the dashboard UI for ownership attestation.
Avtentikacija
Vsak zahtevek mora nositi bearer žeton v glavi Authorization. Žetoni se izdajo iz Račun → API žetoni; golo besedilo se ti ob ustvarjanju pokaže natanko enkrat. Preklic žetona pri naslednjem klicu vrne 401.
curl -H "Authorization: Bearer fxw_..." \
https://fixweb.app/api/v1/scansOblika žetona: fxw_, ki mu sledi 43 znakov base64url. V mirovanju je shranjen kot zgoščena vrednost SHA-256; golo besedilo se nikoli ne shrani na strežniški strani.
Omejitve hitrosti
Dve okni za vsak avtenticiran zahtevek: sunkovno 10 req/sec in stalno 60 req/min, obe ključeni po zgoščeni vrednosti bearer. Uveljavljanje kvot (mesečne omejitve skeniranj) je plast nad tem — glej Kvote in omejitve.
Straničenje
Seznamne končne točke (/api/v1/scans, /api/v1/findings) uporabljajo straničenje s kazalcem, ključeno po (created_at, id) v padajočem vrstnem redu. Pošlji ?cursor=<next_cursor>, da pridobiš naslednjo stran. Kazalec ostane pravilen ob sočasnih zapisih (brez zamika OFFSET).
Oblike napak
Vsaka napaka je JSON objekt z vsaj ključem error.
{ "error": "invalid_token" } // 401
{ "error": "forbidden" } // 403
{ "error": "not_found" } // 404
{ "error": "quota_exceeded", "quota": {...} } // 429
{ "error": "rate_limited", "retry_after_seconds": 47 } // 429
{ "error": "invalid_input", "issues": [...] } // 400Končne točke
Zaženi skeniranje
/api/v1/scansEnqueues a passive scan. Returns immediately with a queued scan id; poll GET /api/v1/scans/[scanId] until status === "completed". Owner-depth mode is not exposed — see Scan types for the attestation-flow rationale.
curl -X POST https://fixweb.app/api/v1/scans \
-H "Authorization: Bearer fxw_..." \
-H "content-type: application/json" \
-d '{"target":"https://staging.example.com"}'// odziv 200
{
"id": "8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4d",
"status": "queued",
"target": "https://staging.example.com",
"mode": "passive"
}Izpiši svoja skeniranja
/api/v1/scansVrne skeniranja za organizacijo, povezano s klicnim žetonom, najnovejša najprej. Straniči z ?cursor=. Privzeta omejitev 50, največ 100.
curl -H "Authorization: Bearer fxw_..." \
"https://fixweb.app/api/v1/scans?limit=25"// odziv 200
{
"scans": [
{
"id": "8f1c4e2a-...",
"target_url": "https://staging.example.com",
"target_hostname": "staging.example.com",
"mode": "passive",
"status": "completed",
"started_at": "2026-05-07T14:00:00Z",
"completed_at": "2026-05-07T14:00:23Z",
"findings_count": { "critical": 1, "high": 3, "medium": 7, "low": 2, "info": 4 },
"triggered_by": "api",
"created_at": "2026-05-07T14:00:00Z"
}
],
"next_cursor": "2026-05-07T14:00:00Z:8f1c4e2a-..."
}Pridobi skeniranje
/api/v1/scans/{scanId}Privzeto vrne ovojnico skeniranja + povzetek resnosti po kategorijah. Dodaj ?include_findings=true, da dobiš celotno poročilo (veliko pri hrupnih skeniranjih — raje uporabi končno točko ugotovitev s filtri).
curl -H "Authorization: Bearer fxw_..." \
https://fixweb.app/api/v1/scans/8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4dIzpiši ugotovitve
/api/v1/findingsFilterable findings list across every scan in the caller's org. Filters: severity=critical,high, check_id=performance.delivery, since=2026-04-01T00:00:00Z. Cursor-paginated.
curl -H "Authorization: Bearer fxw_..." \
"https://fixweb.app/api/v1/findings?severity=critical,high&limit=50"// odziv 200
{
"findings": [
{
"id": "...",
"scan_id": "...",
"check_id": "secrets.js-bundle-sweep",
"severity": "critical",
"title": "Supabase service role key exposed in JS bundle",
"description": "...",
"evidence": { ... },
"remediation": "...",
"cwe_id": "CWE-798",
"created_at": "2026-05-07T14:00:23Z"
}
],
"next_cursor": null
}Specifikacija OpenAPI
Strojno berljiva specifikacija na /docs/api/openapi (text/yaml). Vrzi jo v svoj najljubši codegen (openapi-typescript, openapi-python-client ali katero koli orodjarno OpenAPI 3.1) za tipizirane odjemalce.
