// 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.
驗證
每個 request 都必須在 Authorization header 中帶上 bearer token。Tokens 從 Account → API tokens 發行;建立時明文只會顯示一次。撤銷 token 後,下一次呼叫會回傳 401。
curl -H "Authorization: Bearer fxv_..." \
https://fixvibe.app/api/v1/scansToken 格式:fxv_ 後接 43 個 base64url 字元。靜態儲存時會以 SHA-256 hash 保存;明文絕不會在伺服器端持久化。
速率限制
每個已驗證 request 都有兩個 window:10 req/sec burst 和 60 req/min steady,兩者都以 bearer hash 作為 key。配額強制(每月掃描上限)會疊加在上層;請見 配額與限制。
分頁
List endpoints(/api/v1/scans、/api/v1/findings)使用以 (created_at, id) 為 key、降冪排序的 cursor-based pagination。傳入 ?cursor=<next_cursor> 以擷取下一頁。即使有 concurrent writes,cursor 仍會保持正確(沒有 OFFSET skew)。
錯誤格式
每個錯誤都是 JSON object,至少包含 error key。
{ "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": [...] } // 400Endpoints
啟動掃描
/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"}'// 200 response
{
"id": "8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4d",
"status": "queued",
"target": "https://staging.example.com",
"mode": "passive"
}列出你的掃描
/api/v1/scans回傳與呼叫 token 綁定的 org 之掃描,最新在前。使用 ?cursor= 分頁。預設 limit 50,最大 100。
curl -H "Authorization: Bearer fxv_..." \
"https://fixvibe.app/api/v1/scans?limit=25"// 200 response
{
"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-..."
}取得掃描
/api/v1/scans/{scanId}預設回傳 scan envelope + 各類別嚴重度摘要。傳入 ?include_findings=true 可取得完整報告(雜訊多的掃描可能很大;建議改用 findings endpoint 搭配 filters)。
curl -H "Authorization: Bearer fxv_..." \
https://fixvibe.app/api/v1/scans/8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4d列出 findings
/api/v1/findings可篩選的 findings 清單,跨呼叫者 org 中的所有掃描。Filters:severity=critical,high、check_id=secrets.patterns、since=2026-04-01T00:00:00Z。Cursor-paginated。
curl -H "Authorization: Bearer fxv_..." \
"https://fixvibe.app/api/v1/findings?severity=critical,high&limit=50"// 200 response
{
"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
}OpenAPI 規格
機器可讀規格位於 /docs/api/openapi(text/yaml)。丟進你偏好的 codegen(openapi-typescript、openapi-python-client,或任何 OpenAPI 3.1 toolchain)即可產生 typed clients。
