~/docs cat document-forgery.md
Document forgery
POST /api/defence/docforge/detect — detect tampering and forgery in document images, with region-level evidence and visual overlays.
Request: file (binary, required) — JPEG, PNG, WEBP, HEIC/HEIF, or TIFF, max 50 MB; optional save and caller-supplied task_id.
curl
curl -X POST "https://api.scam.ai/api/defence/docforge/detect" \ -H "x-api-key: <YOUR_API_KEY>" \ -F "file=@/path/to/document.jpg"
response fields (key)
result.verdict "LIKELY_AUTHENTIC" | "LIKELY_FORGED" result.confidence confidence in the verdict, 0.0–1.0 result.cal_prob calibrated forgery probability, 0.0–1.0 result.forged_area_pct % of image area flagged as forged result.n_regions suspicious regions detected result.regions[] per-region boxes: x, y, w, h, area_pct, peak_prob result.resolution_tier unreliable | low | acceptable | optimal | high result.overlay_png_b64 base64 PNG — flagged regions outlined result.heatmap_png_b64 base64 PNG — forgery heatmap credits_used 1 per image
Recoverable per-file failures return 200 with result.success: false and an error code: RESOLUTION_TOO_LOW, UNSUPPORTED_TYPE, FILE_TOO_LARGE, or INFERENCE_ERROR. See ID document forgery and insurance claims.