Skip to main content

Document Field Extraction

POST /api/v1/documents/extract

Multipart PDF upload. OCR and AI extract policy number, insurer, dates, and coverage details. Returns a job_id — poll GET /api/v1/jobs/{job_id} for results.

Request (multipart/form-data)

FieldTypeRequiredDescription
filefilePDF. Maximum 14 MB.
webhook_urlstringHTTPS callback URL

Example

curl -X POST https://policynumbers.com/api/v1/documents/extract \
-H "Authorization: Bearer pk_live_xxxxxxxxxxxx" \
-F "file=@policy.pdf" \
-F "webhook_url=https://yourapp.com/webhooks/extract"
{ "job_id": "a1b2c3d4-...", "status": "pending" }

Extracted fields (on completion)

{
"policy_number": "AXK12345678",
"insurer": "AXA",
"insurance_type": "motor",
"start_date": "2024-01-01",
"end_date": "2025-01-01",
"vehicle_registration": "AB21 XYZ"
}