Skip to main content

Documents

Upload Document

POST /verifications/{id}/documents

Uploads an identity document image. Runs OCR, MRZ extraction, and document validation automatically.

Request:

curl -X POST https://api.dev.valydar.com/verifications/{id}/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@passport.jpg"

Form Fields:

FieldTypeRequiredDescription
filefileDocument image (JPEG, PNG, PDF; max 10MB)

Response:

{
"id": "doc_a1b2c3d4e5f6",
"verification_id": "vry_xxx",
"document_type": "passport",
"filename": "passport.jpg",
"mime_type": "image/jpeg",
"width": 1920,
"height": 1080,
"file_size": 245760,
"check": {
"passed": true,
"details": {
"document_type": "passport",
"mrz": {
"document_number": "L01Y00T47",
"date_of_birth": "1990-01-15",
"date_of_expiry": "2030-01-15",
"issuing_country": "NLD",
"names": "JOHN DOE"
}
}
}
}
FieldTypeDescription
idstringDocument ID (format: doc_<uuid>)
verification_idstringParent verification ID
document_typestringpassport, id_card, or drivers_license
filenamestringOriginal filename
mime_typestringMIME type
widthintegerImage width in pixels
heightintegerImage height in pixels
file_sizeintegerFile size in bytes
checkobjectInline document check result

Document Types:

TypeDetection
passportAutomatic via MRZ
id_cardAutomatic via MRZ/format
drivers_licenseBy format/pattern