← Back to Filevion

Filevion API

All processing endpoints take multipart/form-data. Errors are JSON: {"error": {"code", "message", "hint"}}. Sizes are bytes.

Requirement object (rules)

{
  "accept": ["jpg", "png", "webp", "pdf"],   // allowed output formats
  "max_bytes": 100000, "min_bytes": 20480,
  "width": 300, "height": 400, "dim_mode": "exact" | "min" | "max",
  "dpi": 200, "color": "any" | "grayscale" | "color",
  "background": "any" | "white" | "light",   // advisory check only
  "max_pages": 2, "min_pages": 1
}

GET /api/health

Version, limits, and which face detector is active (opencv-haar or heuristic).

POST /api/parse

JSON body {"text": "…"}. Returns interpreted documents, each with rules, evidence (source text span, confidence, note) and questions for anything ambiguous. Nothing is applied automatically.

POST /api/inspect

Fields: file, optional rules (JSON), slot_type (photo | signature | document | other). Returns info (real format, size, pixels, pages…), report (checks and status), plan (proposed fixes) and, for images, analysis and suggested_crop.

POST /api/prepare

Fields: one or more file, rules, slot_type, options:

{
  "crop": {"x": 0.1, "y": 0.05, "w": 0.6, "h": 0.8, "rotate": 0},  // fractions of the rotated image
  "fit": "crop" | "pad", "clean_signature": false, "pad_to_min": false,
  "format": "jpg", "min_quality": 45, "allow_downscale": false, "background": "#ffffff",
  "pages": ["1-3, 5", ""], "image_page": "a4" | "fit", "target": "pdf"
}

Returns the output as base64 together with a report measured from the exported bytes. Several files, a PDF, or a PDF-only rule produce a combined PDF.

POST /api/pack

Fields: file per document and meta (JSON) with application, applicant, naming, include_checklist, allow_incomplete, missing and items ({slot, rules, output_name} in file order). Every file is re-verified; the response is a ZIP. Headers: X-Filevion-Filename, X-Filevion-Complete.

POST /api/classify

Smart Sort. Fields: one or more file. Returns, per file, type (photo, signature, document, other), key (e.g. marksheet), confidence and plain-language reasons.

POST /api/pdf/pages · POST /api/pdf/build

PDF Studio. pages returns thumbnails for every page of every file (enhance=1 straightens photographed pages and removes shadows; page_size and margin place images). build takes options = {"output": "pdf" | "split" | "images", "pages": [{"f", "p", "r", "g"}], "compress": 0–3, "target_kb", "grayscale", "page_size": "a4" | "letter" | "legal" | "fit", "margin": "none" | "small" | "normal", "dpi", "format", "name", "enhance"}, where f = file index, p = page index, r = rotation and g = split group. Images keep their full resolution. target_kb compresses only as much as needed to fit. It returns a verified PDF or ZIP. iPhone HEIC photos are accepted everywhere and converted to JPEG on arrival.

POST /api/recipe/validate · GET /api/recipes/examples

Validates a filevion.recipe version 1 document (requirements only, never file data) and returns the normalised recipe plus warnings.