Capture

Document templates

Define a reusable structure for a document type once, then scan every instance of it into the same schema. Great for invoices, exam results, payroll slips, ID cards, and any repeating format.

Why templates?

Free-form scans extract whatever the AI finds. Templates turn that loose output into a consistent, typed schema — so every invoice from Vendor X produces the same field set, and every student exam result has the same rows in the same table.

Anatomy of a template

A template has two parts:

  1. Fields — what the AI should extract. Each field has a name(snake_case), a type, a human-readable display_name, and optional flags like is_required and is_unique_identifier.
  2. Layout — how the downloaded PDF or DOCX should look. Control headings, multi-column rows, tables, dividers, stamps, and passport photos.

Supported field types

  • string — free text
  • number — numeric value
  • currency — a number with a formatted currency prefix
  • date — ISO date
  • boolean — true/false
  • table — rows with typed columns (e.g. invoice line items)
  • array — a list of simple values

Creating a template

  1. Open Documents → Templates and click Create Template.
  2. Name it and choose a document type.
  3. Add fields. Mark one as “Use as document name” so every scan auto-names itself.
  4. Design the layout — drag headings, field rows, tables, stamps, and photos onto the canvas.
  5. Save.

Scanning into a template

You have two entry points:

  • Template list — click Scan next to a template to upload a single file.
  • Template detail — drag and drop one or multiple files. Each file becomes a separate document auto-named from your unique identifier field.

Batch scans are processed in the background; you can check progress via the scan job endpoint /api/v1/templates/{id}/scan-jobs/{jobId}.

Editing scanned documents

Every extracted field is editable. Open a template document and click Edit to modify any value; for table fields you can edit cells inline, add rows, or remove rows. Edits are reflected immediately in exports.

Stamps

Stamps are reusable images — company seals, signatures — uploaded once and referenced from any layout. Manage them from the layout designer or via the REST API:

  • POST /api/v1/templates/stamps/upload
  • GET /api/v1/templates/stamps/list
  • DELETE /api/v1/templates/stamps/{id}

Passport photos

Documents can carry a per-document passport photo — typical for employee ID cards, enrollment forms, or KYC documents. When a template marks a passport_photo element as required, each scanned document enters the needs_photo status until a photo is uploaded.

  • POST /api/v1/templates/{id}/documents/{docId}/photo — upload
  • GET /api/v1/templates/{id}/documents/{docId}/photo — retrieve
  • GET /api/v1/templates/{id}/documents-needing-photos — list pending

Downloading as PDF or DOCX

Each template document can be rendered as a formatted PDF or DOCX. The output respects your layout — headings, multi-column fields, tables, stamps, and passport photos all appear exactly where you placed them.

GET /api/v1/templates/{id}/documents/{docId}/download?format=pdf GET /api/v1/templates/{id}/documents/{docId}/download?format=docx

Common patterns

Invoices with line items

Add vendor_name, invoice_number (mark as unique identifier), and invoice_date. Add a line_items table with columns description, quantity, unit_price, and subtotal. Top it off with a total currency field.

Employee ID cards

Fields: full_name, employee_id (unique identifier), department, issue_date. Layout: heading, two-column field rows, a passport photo slot, and a company-seal stamp.

Next steps

  • Document scanning — general scan mechanics and confidence scoring.
  • Datasets — push template output into searchable tables.