Skip to main content

ID Verification

The ID Verification API performs OCR on identity documents (passports and national ID cards) and returns the parsed personal data along with an overall document status. It is a standalone service — it does not require a KYC submission or any customer onboarding state.

Overview

Use this endpoint when you want to verify an identity document on its own — for example, to embed Azakaw's ID parsing capability in your own portal without going through Azakaw's onboarding UI.

For each request the API will:

  • Run OCR on the uploaded document image.
  • Extract MRZ fields (name, document number, date of birth, expiry date, etc.) when present.
  • Return an overall document status indicating whether the document was recognised and parsed successfully.

Authentication

All requests to this API require authentication using a bearer token in the Authorization header:

Authorization: Bearer your-token-here

For details on how to obtain an authentication token, please refer to the Authentication documentation. Tokens issued by AppSessionManager carry a services: External claim that this endpoint requires.

Verify an ID Document

POST {base_url}/ExtIdVerification/Verify

Request

The request must be sent as multipart/form-data.

FieldTypeRequiredDescription
FileContentFileYesThe document image. Supported formats: JPG, PNG, BMP, TIFF, PDF.
DocumentTypeIdstringYesThe type of document being verified. See Supported Document Types. Must not be NA.

Example

curl --location '{base_url}/ExtIdVerification/Verify' \
--header 'Authorization: Bearer your-token-here' \
--form 'FileContent=@"/path/to/passport.jpg"' \
--form 'DocumentTypeId=Passport'

Response

{
"version": null,
"statusCode": 200,
"messages": [
"Processed successfully"
],
"result": {
"mrzType": "ID-3",
"documentType": "Passport",
"documentSubtype": null,
"documentDescription": "Passport",
"documentFormat": 2,
"issuingCountry": "GBR",
"issuingCountryCode": "GBR",
"lastName": "DOE",
"givenName": "JOHN",
"nativeGivenName": "JOHN",
"nativeLastName": "DOE",
"documentNumber": "L898902C3",
"documentNumberVerified": true,
"documentNumberCheck": "6",
"nationality": "GB",
"birthDate": "1990-01-01",
"birthDateVerified": true,
"birthDateCheck": "7",
"sex": "M",
"expiryDate": "2030-01-01",
"expiryDateVerified": true,
"expiryDateCheck": "1",
"personalNumber": null,
"personalNumberVerified": null,
"personalNumberCheck": null,
"checksumVerified": true,
"checksum": "6",
"mrzLine1": "P<GBRDOE<<JOHN<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\nL898902C36GBR9001017M3001011<<<<<<<<<<<<<<06",
"mrzLine2": null,
"mrzLine3": null,
"isVerifyRequestSuccesful": true,
"documentOverallStatus": "Valid"
}
}
note

In the current implementation, mrzLine1 contains the full MRZ — both lines (for TD3/passports) or all three lines (for TD1/ID cards) — joined by \n. The mrzLine2 and mrzLine3 fields are reserved for future use and return null today.

Response Fields

The result object contains the parsed document data:

FieldTypeDescription
documentOverallStatusstringValid or NotValid. Overall verdict on the document.
isVerifyRequestSuccesfulbooleantrue when the document was recognised and validated.
mrzTypestringMRZ format (e.g. ID-3 for passports, ID-1 for ID cards).
documentTypestringThe document type submitted in the request.
documentSubtypestringRefinement of the document type when available.
documentDescriptionstringHuman-readable description from the parser.
documentFormatintVendor-specific numeric format identifier. For the standard MRZ classification (TD1 / TD2 / TD3) use mrzType instead.
issuingCountrystringIssuing country/state code as printed in the MRZ (ICAO alpha-3, e.g. GBR).
issuingCountryCodestringRaw MRZ issuing country code, including filler characters (<) if any.
lastNamestringFamily name extracted from the document.
givenNamestringGiven name(s) extracted from the document.
nativeGivenNamestringGiven name in the document's native script.
nativeLastNamestringFamily name in the document's native script.
documentNumberstringDocument/passport number.
documentNumberVerifiedbooleantrue when the document number passes its MRZ check digit.
documentNumberCheckstringThe check digit read from the MRZ.
nationalitystringHolder's nationality, normalized to ISO 3166-1 alpha-2 (e.g. GB). Note that issuingCountry is alpha-3 — they typically describe the same country in different formats.
birthDatestring (YYYY-MM-DD)Date of birth.
birthDateVerifiedbooleantrue when the date of birth passes its MRZ check digit.
birthDateCheckstringThe check digit for the date of birth.
sexstringSingle character from the MRZ: M (male), F (female), or < (unspecified). Some issuers use X as a variant of <.
expiryDatestring (YYYY-MM-DD)Document expiry date.
expiryDateVerifiedbooleantrue when the expiry date passes its MRZ check digit.
expiryDateCheckstringThe check digit for the expiry date.
personalNumberstringOptional personal/national number when present in the MRZ.
personalNumberVerifiedbooleanVerification flag for personalNumber.
personalNumberCheckstringThe check digit for personalNumber.
checksumVerifiedbooleantrue when the MRZ final/composite check digit is valid.
checksumstringThe MRZ final/composite check digit.
mrzLine1stringFull MRZ as printed on the document, lines separated by \n (see note above).
mrzLine2stringCurrently null; the full MRZ is in mrzLine1 (see note above).
mrzLine3stringCurrently null; the full MRZ is in mrzLine1 (see note above).

Any field that is not present on the document — or could not be extracted — is returned as null.

Document Status Values

documentOverallStatus can have the following values:

StatusDescription
ValidThe document was recognised by the parser.
NotValidThe document was not recognised. Typical causes: image illegible, document type not supported by the parser, the image is a known specimen (sample / demonstration images are flagged this way), or MRZ check digits failed. Inspect the per-field *Verified flags for detail.

Supported Document Types

Pass one of the following values in DocumentTypeId:

ValueDescription
PassportInternational passport (TD3 / ID-3).
IdCardFrontFront side of a national ID card.
IdCardBackBack side of a national ID card. Only useful when the MRZ is printed on the back of the card (varies by country).

For best results submit the side of the document that contains the MRZ.

Rate Limit

This endpoint is rate-limited at 5 requests per second. Excess requests return HTTP 429 Too Many Requests.

Error Handling

StatusMeaning
200Request processed. Inspect result.documentOverallStatus to know whether the document was recognised.
400Validation failure — e.g. FileContent missing or empty, DocumentTypeId missing or set to NA.
401Missing or invalid Bearer token.
403Token does not carry the required services: External claim.
413Uploaded file exceeds the configured size limit.
429Rate limit exceeded.
500Unexpected server error.

Error responses follow the standard envelope:

{
"version": null,
"statusCode": 400,
"messages": [
"FileContent is empty."
],
"result": null
}

Best Practices

  • Image quality. Submit clear, well-lit images with all four corners visible. Avoid glare on the MRZ.
  • Format. JPG and PNG produce the best results; PDFs are accepted (first page is processed).
  • Idempotency. Each call is independent. If you need to retry, retry the full request — there is no resumable state.
  • Status interpretation. Treat documentOverallStatus = Valid together with isVerifyRequestSuccesful = true as a successful verification. A Valid status alone does not guarantee MRZ check digits passed — check the per-field *Verified flags when stricter validation is required.