For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Getting Started
    • Introduction
    • How Verifa Works
    • Quickstart
    • Choosing an Integration Method
  • Use Cases
    • KYC Onboarding
    • Age Verification
    • AML Compliance
    • Fraud Prevention
    • Marketplace Trust & Safety
  • Core Concepts
    • Overview
    • Sessions
    • Verifications & Checks
    • Workflows
    • Identities
    • Cases
    • Screening & Reports
    • Lists
  • Integration Guides
    • Overview
    • JavaScript SDK
    • Web Capture Flow
    • API-Only Integration
    • Mobile SDK
    • Webhooks Guide
    • MCP Server
    • Migrating from Persona
  • API Details
    • Overview
    • Authentication
    • Pagination
    • Rate Limiting
    • Versioning
    • Errors
    • Webhooks
    • Idempotency
    • Key Inflection
    • Data Access
    • Data Retention
  • Tutorials
    • Creating Your First Verification Session
    • Creating a Workflow
    • Receiving Webhooks & Validating Signatures
    • Handling Webhook Events
    • Custom Document Types & AI Extraction
  • Best Practices
    • Testing
    • Preventing Duplicates
    • Fraud Signals
    • Changelog
  • API Reference
      • GETList session documents
      • POSTUpload a document to a session
      • GETDownload a document
      • GETList documents
      • POSTUpload a standalone document
      • GETGet document metadata
      • DELRedact a document
      • PATCHUpdate document metadata
      • GETDownload a document via signed URL
      • GETPreview a document page as JPEG
      • GETList document extractions
      • GETList document checks
      • POSTTrigger document classification
      • POSTTrigger document extraction
      • POSTRun verification checks on a document
      • POSTCompare two documents
      • POSTBulk classify documents
      • POSTBulk extract documents
      • POSTBulk verify documents
      • GETList document fingerprints
      • POSTCreate a document fingerprint
      • DELDelete a document fingerprint
      • POSTFlag a document as compromised
      • POSTCompare a document to a verified identity
      • POSTRun AI-powered document insights
API ReferenceDocuments

Compare a document to a verified identity

POST
https://devapi.withverifa.com/api/v1/documents/:document_id/compare-to-identity
POST
/api/v1/documents/:document_id/compare-to-identity
$curl -X POST https://devapi.withverifa.com/api/v1/documents/document_id/compare-to-identity \
> -H "X-API-Key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "identity_id": "id_9f8e7d6c5b4a3210"
>}'
1{
2 "id": "ext_1234567890abcdef",
3 "document_id": "doc_abcdef1234567890",
4 "extraction_type": "ocr",
5 "status": "completed",
6 "created_at": "2024-01-15T09:30:00Z",
7 "extracted_fields": {},
8 "confidence_scores": {},
9 "reference_document_id": "doc_0987654321fedcba",
10 "comparison_results": {}
11}

Extracts fields from the document and compares name, address, DOB, and document number against a stored identity record.

Required scope: documents:write

Was this page helpful?
Previous

Run AI-powered document insights

Next
Built with

Authentication

X-API-Keystring

Organization API key. Keys are prefixed with vk_live_ (production) or vk_sandbox_ (sandbox).

Path parameters

document_idstringRequired

Document ID (doc_*).

Headers

Verifa-VersiondateOptional

API version date string (e.g. 2026-02-01). If omitted, the version pinned to your API key is used.

Key-InflectionenumOptionalDefaults to snake

Response key casing. Defaults to snake.

Allowed values:
Idempotency-KeystringOptional<=255 characters

Unique key for idempotent requests. Cached for 24 hours. Sending the same key with different parameters returns 422.

Request

This endpoint expects an object.
identity_idstringRequired
ID of the identity to compare against.
thresholddoubleOptional

Response

Identity comparison result.
idstring
Extraction record ID.
document_idstring
Parent document ID.
extraction_typestring

Type of extraction performed (e.g. ocr, barcode, mrz).

statusenum
Allowed values:
created_atdatetime
extracted_fieldsmap from strings to any

Key-value map of extracted data fields.

confidence_scoresmap from strings to doubles

Per-field confidence scores (0-1).

reference_document_idstring or null
Reference document used for comparison, if any.
comparison_resultsmap from strings to any or null

Field-by-field comparison results when comparing two documents.

Errors

401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error