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.
Dashboard
HomeAPI Reference
HomeAPI Reference
  • Overview
    • API Overview
  • Vlens API
      • POSTExtract national ID front
      • POSTExtract national ID back
      • POSTExtract passport data
      • POSTExtract car license front (owner info)
      • POSTExtract car license back (vehicle specs)
      • POSTExtract driving license data
      • POSTMatch face against ID photo
      • POSTCompare two face images
      • POSTLiveness detection (three frames)
      • POSTExtract license plate text
      • POSTClassify document type
      • POSTAML validation
Dashboard
LogoLogo
Vlens APIOCR

Classify document type

||View as Markdown|
POST
https://api.vlenseg.com/v1/ocr/classification
POST
/v1/ocr/classification
$curl -X POST https://api.vlenseg.com/v1/ocr/classification \
> -H "ApiKey: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "image": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
>}'
200OCR_classification_example
1{
2 "services": {
3 "classification": {
4 "doc_type": "national_id"
5 }
6 },
7 "data": {},
8 "error_code": null
9}

Detect the type of document in an image before sending it to a specific extraction endpoint. Result is in services.classification.doc_type.

Was this page helpful?
Previous

Extract license plate text

Next

AML validation

Built with

Authentication

ApiKeystring
Static API key issued to your tenant. Obtain from the Vlens dashboard.
AuthorizationBearer

Short-lived JWT. Obtain via:

  • /api/credentials/Login for admin / service tokens
  • /api/DigitalIdentity/Register or login for end-user tokens

Request

This endpoint expects an object.
imagestringRequired

Base64-encoded JPEG/PNG image of the document side.

name_check_valuestring or nullOptional

Optional name to cross-validate against OCR-extracted data.

transaction_idstring or nullOptionalformat: "uuid"

Continue an existing transaction. Omit to start a new transaction; the ID is returned in the response.

client_transaction_idstring or nullOptional
Your own reference ID for this verification transaction.
request_idstring or nullOptional
countrystring or nullOptional

ISO 3166-1 alpha-2 country code. Defaults to EG.

getExtractedDatabooleanOptionalDefaults to false

Include OCR-extracted fields in the response.

Response

Document type detected.
servicesobject
Results from the various backend verification services.
dataobject
Combined result of the Digital Identity verification process.
error_codeinteger or null
error_messagestring or null
error_descriptionsany or null