// docs / rest api
REST API
Bearer-authenticated JSON API for scan automation, scan status, and findings. Passive scans are available through REST; active scans are available for paid plans only after the domain is verified and explicitly authorized in the dashboard.
Autenticazione
Ogni richiesta deve portare un bearer token nell'header Authorization. I token vengono emessi da Account → Token API; il testo in chiaro ti viene mostrato esattamente una volta alla creazione. Revocare un token restituisce 401 alla chiamata successiva.
curl -H "Authorization: Bearer fxv_..." \
https://fixvibe.app/api/v1/scansFormato del token: fxv_ seguito da 43 caratteri base64url. Archiviato a riposo come hash SHA-256; il testo in chiaro non viene mai persistito lato server.
Rate limit
Due finestre su ogni richiesta autenticata: burst da 10 req/sec e steady da 60 req/min, entrambe indicizzate sull'hash bearer. L'applicazione delle quote (limiti mensili di scansioni) si sovrappone; vedi Quote e limiti.
Paginazione
Gli endpoint di lista (/api/v1/scans, /api/v1/findings) usano paginazione basata su cursore con chiave (created_at, id) in ordine decrescente. Passa ?cursor=<next_cursor> per recuperare la pagina successiva. Il cursore resta corretto anche con scritture concorrenti (nessuno skew da OFFSET).
Formati di errore
Ogni errore è un oggetto JSON con almeno una chiave 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": [...] } // 400Endpoint
Avvia una scansione
/api/v1/scansEnqueues a passive scan by default. For verified domains with active authorization, paid plans can request active mode. Returns immediately with a queued scan id; poll GET /api/v1/scans/[scanId] until status === "completed".
curl -X POST https://fixvibe.app/api/v1/scans \
-H "Authorization: Bearer fxv_..." \
-H "content-type: application/json" \
-d '{"target":"https://staging.example.com"}'// risposta 200
{
"id": "8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4d",
"status": "queued",
"target": "https://staging.example.com",
"mode": "passive"
}Elenca le tue scansioni
/api/v1/scansRestituisce le scansioni dell'org collegata al token chiamante, dalla più recente. Pagina con ?cursor=. Limite predefinito 50, massimo 100.
curl -H "Authorization: Bearer fxv_..." \
"https://fixvibe.app/api/v1/scans?limit=25"// risposta 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-..."
}Recupera una scansione
/api/v1/scans/{scanId}Restituisce envelope della scansione + riepilogo di severità per categoria per impostazione predefinita. Passa ?include_findings=true per ottenere il report completo (grande per scansioni rumorose: preferisci l'endpoint findings con filtri).
curl -H "Authorization: Bearer fxv_..." \
https://fixvibe.app/api/v1/scans/8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4dElenca le segnalazioni
/api/v1/findingsLista filtrabile di segnalazioni su ogni scansione nell'org del chiamante. Filtri: severity=critical,high, check_id=secrets.patterns, since=2026-04-01T00:00:00Z. Paginata con cursore.
curl -H "Authorization: Bearer fxv_..." \
"https://fixvibe.app/api/v1/findings?severity=critical,high&limit=50"// risposta 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
}Specifica OpenAPI
Specifica leggibile dalle macchine su /docs/api/openapi (text/yaml). Inseriscila nel tuo codegen preferito (openapi-typescript, openapi-python-client o qualsiasi toolchain OpenAPI 3.1) per ottenere client tipizzati.
