The Document Classification module identifies the type of identity document a user has submitted by analysing captured images. It determines the document type, for example, whether it’s a passport, driving licence, or national ID card, and where it was issued.
This page contains documentation for the Document Classification module, including its variants, capabilities, and the specific result values it returns.
Document Classification V1
The Document Classification V1 variant processes front and back images of an identity document to determine what kind of document it is and where it was issued. It doesn’t verify the authenticity of the document or extract data fields from it.
Those tasks are handled by the Document Authentication and Document Extraction modules respectively. Classification is typically the first document module in a journey, because subsequent modules need to know the document type before they can apply the correct verification rules.
This variant requires a PrimaryDocument input.
Capabilities
The module returns a structured set of capabilities grouped into three areas: classification result, document identification, and image capture quality checks. Each capability returns a single value that downstream evaluation logic can act on.
Document classification result
This capability provides the overall outcome of the classification attempt. It indicates whether the module was able to identify the document type.
| Value | Description |
|---|
Document Classified | The document was successfully classified. The module identified the document type, issuing country, and other metadata. Downstream modules can proceed with type-specific verification. |
Document NOT Classified | The document could not be classified. This may occur when the image quality is too poor for analysis, the document type is not in the module’s reference library, or the submitted image does not contain a recognisable identity document. This is the default value if classification fails. |
Document type
This capability returns the type of identity document that was identified during classification. The value determines which verification rules and reference templates are applied by downstream modules such as Document Authentication.
| Value | Description |
|---|
Driving License | A government-issued driving licence. This is one of the most commonly submitted document types across all regions. |
Identification Card | A national or state-issued identification card that is not a driving licence. Examples include national ID cards, state ID cards, and government-issued photo ID cards. |
Passport | An internationally recognised travel document issued by a national government. Passports typically contain a machine-readable zone (MRZ) and may include biometric chip data. |
Military Identification | An identification card issued to military personnel by a government’s armed forces. |
Residence Document | A document that confirms the holder’s right to reside in a country. This includes permanent resident cards (e.g. US Green Card), residence permits, and residence-related documents issued to non-nationals. |
Travel Card | A document issued for cross-border travel that is not a full passport. This includes FAST cards (Free and Secure Trade), NEXUS cards, and travel documents issued to non-nationals. |
Tribal Card | An identification card issued by a recognised tribal authority. In the United States, tribal ID cards are issued by federally recognised Native American tribes and may be accepted as valid identification for certain purposes. |
Visa | A document or endorsement granting the holder permission to enter, stay in, or transit through a country. This includes immigrant visas, re-entry permits, and entry papers. |
Voter Identification | A card or document issued specifically to confirm voter registration and eligibility. These are common in countries where voter ID is required at polling stations. |
Worker Identification | An employment-related identification document. This includes occupational licences, work permits, and employer-issued ID cards that are backed by a government authority. |
Merchant Mariner Credential | A credential issued to maritime workers. This includes seafarer’s identity documents (SIDs) issued under the ILO (International Labour Organization) convention, which serve as both professional certification and travel documentation for merchant sailors. |
Other | A document type that does not fit any of the above categories. This includes weapons licences, birth certificates, medical cards, and other government-issued documents that may be accepted for identity verification in certain contexts. |
Unknown | The document type could not be determined. This typically occurs when the image quality is insufficient for classification or the document is not in the module’s reference library. |
Document country code
This capability returns the ISO 3166-1 alpha-3 country code of the country that issued the document (e.g. GBR for the United Kingdom, USA for the United States, AUS for Australia).
The module supports documents from over 190 countries. If the issuing country cannot be determined, the value defaults to Unknown.
The full list of supported country codes follows the ISO 3166-1 alpha-3 standard. Common examples include:
| Value | Country |
|---|
GBR | United Kingdom |
USA | United States |
AUS | Australia |
CAN | Canada |
DEU | Germany |
FRA | France |
IND | India |
NGA | Nigeria |
BRA | Brazil |
JPN | Japan |
Country name
This capability returns the full name of the issuing country as a human-readable string (e.g. “United Kingdom”, “United States of America”, “Australia”).
This value corresponds to the country code returned by the document country code capability. If the country cannot be determined, the value defaults to Unknown.
State name
This capability returns the name of the state, province, or territory that issued the document, where applicable. This is particularly relevant for countries where identity documents are issued at the sub-national level, such as driving licences in the United States and Australia.
The module supports the following regions:
- United States: All 50 states and the territories of Guam and American Samoa (via the country code, not the state name field).
- Australia: All states and territories, including New South Wales, Queensland, Victoria, South Australia, Western Australia, Tasmania, Northern Territory, and Australian Capital Territory.
- United Kingdom and Crown Dependencies: Northern Ireland, Wales, Guernsey, Jersey, and Isle of Man.
- Caribbean: Curaçao.
If the document was not issued at the state or territory level, or if the state cannot be determined, the value defaults to Unknown.
Image capture quality checks
The module performs a series of image quality assessments on both the front and back sides of the submitted document. These checks evaluate whether the captured images are of sufficient quality for accurate classification and downstream processing.
Poor image quality is one of the most common causes of classification failure. Glare from reflective document surfaces, motion blur from camera movement, low resolution from distant capture, washed-out colour from poor lighting, and cropped edges from incorrect framing can all prevent the module from identifying the document.
Each capture quality check returns one of the following values:
| Value | Description |
|---|
Passed | The check passed. The image meets the required quality threshold for this criterion. |
Failed | The check failed. The image does not meet the required quality threshold, which may affect the accuracy of classification or downstream processing. |
Skipped | The check was skipped because an underlying requirement was not met. For example, a back-side check is skipped if the document is single-sided. |
Undetermined | The check could not produce a definitive result. The image quality falls in an ambiguous range where neither a clear pass nor a clear fail can be determined. |
Excluded | The check was not performed because it was not applicable or was disabled in the module configuration. Common reasons include: the second side of the document was not provided, the check does not apply to the detected document type, or an optional check (such as document liveness) was disabled in the configuration. This is the default value. |
The following checks are performed:
Evaluates whether the captured image has sufficient pixel density for the module to accurately identify document features. Low-resolution images may result from the camera being too far from the document or from a device with a low-quality camera sensor. Insufficient resolution makes it difficult to read text, identify security features, and classify the document accurately.
| Capability | Description |
|---|
Front Side Low Resolution Check | Assesses the resolution of the front side image. |
Back Side Low Resolution Check | Assesses the resolution of the back side image. |
Detects reflective glare on the document surface. Glare typically appears as bright white spots or washed-out areas caused by overhead lighting, camera flash, or the reflective laminate coating found on many modern identity documents. Glare can obscure printed text, photographs, and security features, making the document unreadable to the classification engine.
| Capability | Description |
|---|
Front Side Glare Check | Detects glare on the front side image. |
Back Side Glare Check | Detects glare on the back side image. |
Detects motion blur or focus blur in the captured image. Blur occurs when the camera or the document moves during capture, or when the camera fails to focus correctly on the document surface. Blurred images reduce the clarity of text, edges, and fine details that the classification engine relies on to identify document type.
| Capability | Description |
|---|
Front Side Blur Check | Assesses the sharpness of the front side image. |
Back Side Blur Check | Assesses the sharpness of the back side image. |
Determines whether the image was captured in full colour. Some document features, such as colour-coded regions, flag emblems, and security holograms, require colour information for accurate classification. A greyscale or black-and-white image (for example, from a photocopy or a monochrome scan) may lack the visual information needed to classify the document correctly. This check can also help detect photocopied documents, which are commonly used in fraud attempts.
| Capability | Description |
|---|
Front Side Colour Check | Checks whether the front side image is in full colour. |
Back Side Colour Check | Checks whether the back side image is in full colour. |
- Full document in view check:
Verifies that the entire document is visible within the captured image frame. If any edges of the document are cropped or cut off, the module may be unable to identify the document type, read border-area text (such as MRZ data on passports), or detect edge-based security features. This check ensures that the user positioned the document correctly within the camera’s field of view during capture.
| Capability | Description |
|---|
Front Side Full Document In View Check | Checks whether the full front side of the document is visible in the image. |
Back Side Full Document In View Check | Checks whether the full back side of the document is visible in the image. |
Default outcomes
The module is pre-configured with the following default outcomes, which can be used in evaluation and routing logic:
| Outcome | Condition | Description |
|---|
Document Classified | Document classification result is Document Classified | The document was successfully identified. The journey can proceed to downstream document modules. |
Document Classification Mismatch | Classification result does not match the expected document type | The document was classified but does not match the expected type configured in the journey. |
Document NOT Classified | Document classification result is Document NOT Classified | The document could not be identified. The journey may route to a retry step, manual review, or rejection depending on the configured evaluation logic. |
Document Partially Classified | Only some classification fields were resolved | The document was partially identified. Some metadata (such as document type or country) could not be determined. |
ERROR | Default (no conditions matched) | An unexpected error occurred during processing. This outcome acts as a fallback and typically indicates a system-level issue rather than a document quality problem. |
The following is a sample payload used to submit document images to the Document Classification module for processing.
{
"resourceId": "your-journey-resourceID@latest",
"context": {
"subject": {
"documents": [
{
"side1Image": "<base64-encoded string>",
"side2Image": "<base64-encoded string>",
"type": "Primary"
}
]
}
}
}
Replace your-journey-resourceID@latest with your journey’s resource ID. You can find this in the Journey Builder after publishing your journey.
| Field | Required | Description |
|---|
side1Image | Yes | A base64-encoded string representing the image of the front side of the document. |
side2Image | No | A base64-encoded string representing the image of the back side of the document. Can improve classification accuracy for double-sided documents. |
Sample response
The following is a sample response for a successfully classified document.
{
"response": {
"advice": {
"DocumentClassificationResult": "Document Classified",
"type": "Foreigner Identification Card",
"subType": "Residence Permit",
"countryCode": "GBR",
"stateName": "Not available",
"countryName": "United Kingdom",
"frontSideLowResolutionCheck": "Passed",
"backSideLowResolutionCheck": "Excluded",
"frontSideGlareCheck": "Passed",
"backSideGlareCheck": "Excluded",
"frontSideBlurCheck": "Passed",
"backSideBlurCheck": "Excluded",
"frontSideColourCheck": "Passed",
"backSideColourCheck": "Excluded",
"frontSideFullDocumentInViewCheck": "Passed",
"backSideFullDocumentInViewCheck": "Excluded",
"frontSideDigitalTamperCheck": "Passed",
"backSideDigitalTamperCheck": "Excluded",
"frontSideDocumentLivenessCheck": "Passed",
"backSideDocumentLivenessCheck": "Excluded",
"frontSidePhotoSubstitutionCheck": "Passed",
"backSidePhotoSubstitutionCheck": "Excluded"
},
"outcome": "Document Classified"
}
}