DocParse Docs

Validation Rules

Validation rules are automatic data-quality checks attached to an extraction. After every document is processed, each enabled rule runs against the extracted data. If an error-severity rule fails, the document is flagged Needs review; warning-severity rules are advisory and don't block.

This catches bad output before it reaches your systems — the difference between "we read the document" and "you can trust the data."

Where to configure

Dashboard → open an extractionValidation rules.

Each rule has a name, the field it targets (supports nested fields via dot-paths, e.g. buyer.email), a check type, and a severity (error or warning).

Rule types

TypeWhat it checks
requiredField must be present and non-empty.
regexString field must match a pattern (e.g. ^INV-\d+$).
equals / not_equalsField must (not) equal a given value.
gt / gte / lt / lteNumeric comparison. Currency strings like $1,200.50 are parsed.
in_listField must be one of an allowed list (e.g. USD, EUR, GBP).
sum_equalsSum of a line-item amount must equal a total (± tolerance). The classic invoice check.
date_not_future / date_not_pastDate field sanity checks.

When rules run

  • After the initial extraction of each uploaded document.
  • After an email-ingested document is extracted.
  • When a file is re-run ("Redo").
  • When a reviewer edits a document's data (re-validated on save).

A failing error rule sets the file status to needs_review, which surfaces it in the Review Queue. The specific issues are shown inline in the review screen.

Example

For an invoice extraction you might add:

  • required on invoice_number (error)
  • sum_equals: line items amount must equal total (error)
  • in_list on currency = USD, EUR, GBP (warning)
  • date_not_future on invoice_date (error)

Any document that breaks one of the error rules is held for review instead of flowing through with incorrect data.