FixWeb

// 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.

Authentication

Request တိုင်းတွင် Authorization header ထဲ၌ bearer token ပါရမည်။ Token များကို Account → API tokens မှ issue လုပ်သည်; plaintext ကို ဖန်တီးချိန်တွင် တစ်ကြိမ်တည်းသာ ပြသည်။ Token ကို revoke လုပ်ပါက နောက် call တွင် 401 ပြန်လာသည်။

bash
curl -H "Authorization: Bearer fxw_..." \
  https://fixweb.app/api/v1/scans

Token format: fxw_ နောက်တွင် base64url character 43 လုံး ပါသည်။ At rest တွင် SHA-256 hash အဖြစ် သိမ်းသည်; plaintext ကို server-side တွင် ဘယ်တော့မှ persist မလုပ်ပါ။

Rate limit များ

Authenticated request တိုင်းပေါ်တွင် window နှစ်ခုရှိသည်: 10 req/sec burst နှင့် 60 req/min steady၊ နှစ်ခုလုံး bearer hash ပေါ်တွင် key လုပ်ထားသည်။ Quota enforcement (တစ်လ scan cap များ) သည် အပေါ်ထပ် layer ဖြစ်သည် — Quotas & limits ကို ကြည့်ပါ။

Pagination

List endpoint များ (/api/v1/scans/api/v1/findings) သည် descending order ဖြင့် (created_at, id) ပေါ်တွင် key လုပ်ထားသော cursor-based pagination ကို အသုံးပြုသည်။ နောက် page ကို fetch လုပ်ရန် ?cursor=<next_cursor> ကို ပို့ပါ။ Concurrent write များအောက်တွင် cursor သည် မှန်ကန်နေသည် (OFFSET skew မရှိပါ)။

Error ပုံစံများ

Error တိုင်းသည် အနည်းဆုံး error key ပါသော JSON object ဖြစ်သည်။

jsonc
{ "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": [...] }             // 400

Endpoint များ

Scan တစ်ခု စတင်ရန်

POST/api/v1/scans

Enqueues 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"}'

// 200 response

{
  "id": "8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4d",
  "status": "queued",
  "target": "https://staging.example.com",
  "mode": "passive"
}

သင့် scan များကို စာရင်းပြရန်

GET/api/v1/scans

Calling token နှင့် ချိတ်ထားသော org အတွက် scan များကို newest first ပြန်ပေးသည်။ ?cursor= ဖြင့် paginate လုပ်ပါ။ Default limit 50၊ max 100။

curl -H "Authorization: Bearer fxw_..." \
  "https://fixweb.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-..."
}

Scan တစ်ခု ရယူရန်

GET/api/v1/scans/{scanId}

Default အနေဖြင့် scan envelope + category အလိုက် severity summary ကို ပြန်ပေးသည်။ Report အပြည့်အစုံလိုပါက ?include_findings=true ပို့ပါ (noisy scan များအတွက် ကြီးနိုင်သည် — filter ပါသော findings endpoint ကို ပိုသုံးပါ)။

curl -H "Authorization: Bearer fxw_..." \
  https://fixweb.app/api/v1/scans/8f1c4e2a-8c3a-4b6f-9c0d-9b1e8f3c2a4d

Finding များကို စာရင်းပြရန်

GET/api/v1/findings

Filterable 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"

// 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 spec

Machine-readable spec ကို /docs/api/openapi တွင် ရှိသည် (text/yaml)။ Typed client များအတွက် သင်နှစ်သက်ရာ codegen (openapi-typescript၊ openapi-python-client သို့မဟုတ် OpenAPI 3.1 toolchain မည်သည့်အရာမဆို) ထဲသို့ ထည့်ပါ။

REST API — Docs · FixWeb