Compare two documents
Compares the current document against a reference document. Useful for cross-referencing extracted fields between an ID document and a proof-of-address, or between two identity documents.
Required scope: documents:write
Authentication
X-API-Keystring
Organization API key. Keys are prefixed with vk_live_ (production) or
vk_sandbox_ (sandbox).
Path parameters
document_id
Document ID (doc_*).
Headers
Verifa-Version
API version date string (e.g. 2026-02-01). If omitted, the version
pinned to your API key is used.
Request
This endpoint expects an object.
reference_document_id
ID of the document to compare against.
threshold
Minimum similarity threshold for a passing comparison.
Response
Comparison result.
id
Extraction record ID.
document_id
Parent document ID.
extraction_type
Type of extraction performed (e.g. ocr, barcode, mrz).
status
Allowed values:
created_at
extracted_fields
Key-value map of extracted data fields.
confidence_scores
Per-field confidence scores (0-1).
reference_document_id
Reference document used for comparison, if any.
comparison_results
Field-by-field comparison results when comparing two documents.
Errors
400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error