PDFy

API Contracts

Design Principles

Planned Endpoints

POST /api/scans

Creates a scan request from an uploaded PDF.

Request shape:

{
  "retentionMode": "delete_immediately",
  "enableEnrichment": true
}

Multipart payload should include:

Response shape:

{
  "scanId": "scan_123",
  "status": "queued_fast_scan",
  "retentionMode": "delete_immediately",
  "resultUrl": "/scans/scan_123"
}

GET /api/scans/:scanId

Returns current scan status and summary fields.

Response shape:

{
  "scanId": "scan_123",
  "status": "completed_fast_scan",
  "verdict": "suspicious",
  "score": 67,
  "advancedStatus": "running",
  "expiresAt": null
}

GET /api/scans/:scanId/report

Returns the structured report payload used by the UI and export flows.

Response shape:

{
  "scanId": "scan_123",
  "summary": {
    "verdict": "suspicious",
    "score": 67
  },
  "findings": [],
  "iocs": {
    "urls": [],
    "ips": []
  },
  "mitigations": []
}

Status Vocabulary

Contract Rules