Document Capture and Verification
TrustX provides a number of document verification services that enables users to check the validity of an uploaded document image. Depending on the results, a decision can be made whether the identity verification flow is a success or fails due to one or many checks failing.
This document will describe how to prompt the end-user to capture a document image and perform a variety of verification checks as part of the Process Definition. After all checks are completed, a decision can be made using the 'Simple Decider' activity and results can be viewed from the Backoffice application or TrustX API.
Capture a Document
Document capture can be performed during a Process Instance by including a 'Capture Document Image' activity within a Process Definition.
Document Type
Before a document can be captured, the type of document must be determined. TrustX provides multiple solutions for determining the document type that will be captured.
- Define Document Type - Enables users to directly define the document type to be captured. This will not request input from the end-user.
- Select Document Type - Requests the end-user to choose which document type will be captured from a list of acceptable document types.
The 'Acceptable Document Type' activity can determine that the captured document image matches the required document type.
To implement a document capture, follow the steps below:
- Add a 'Define Document Type' or 'Select Document Type' activity to the Process Definition. In this example, a 'Define Document Type' activity will be used.
- Click the activity to open the right-side contextual menu and set the applicable document type within the input parameters. This activity supports the following:
Parameter | Description | Type | Default |
---|---|---|---|
Acceptable Countries | A list of document countries that will be accepted. | List[String] | |
Country Code | The two-letter country code of the document | STRING | us |
Document Key | The unique key associated with the document type. | STRING | doc1 |
Document Type | The accepted document type. | STRING | DRIVERS_LICENSE |
- The resulting Process Definition should appear as follows:

Capture a Document
The next step involves integrating the 'Capture Document Image' activity to prompt the end-user to capture an image of their document.
- Create a new gateway that can be used to mark the start of the document capture flow.
- Add a 'Capture Document Image - Front' activity to the Process Definition. This activity will request the end-user to take a photo of the front-side of their ID document. Connect this activity to the entry gateway using the global connect tool.
- The Process Definition can be designed to handle a scenario where the captured document is not of the correct document type. Create a new gateway after the 'Capture Document Image' activity and connect them using a sequence flow arrow.
- Create a new sequence flow arrow using the global connect tool and connect the 'change document type' gateway to the 'document capture entry' gateway.
- Click the sequence flow arrow to open the context menu. Expand the 'Condition' configuration and create a new Expression:
${changeDocument==true}

When the end-user reaches this step within the TrustWeb app, they will be prompted to take a photo using their camera. An instruction screen will appear detailing how to proceed.
(Optional) Capture a Document Video
TrustX document capture and verification provides an optional video capture step that prompts the end-user to record a video of their document during the identity verification process that can be used in addition with verification methods to ensure the authenticity of a document.
This can be achieved using the 'Capture Document Image & Video - Front v4' and 'Capture Document Image & Video - Back v4' activities. The steps below will demonstrate a standard implementation.
- After the Front side Document Capture Entry Gateway defined in the Capture a Document step above, add a 'Capture Document Image & Video - Front v4' activity, replacing the 'Capture Document Image - Front v4' activity.
- Connect the activity to the entry gateways created in the Capture a Document section.

- This activity supports the following input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Advanced configuration | An optional field that will allow the override of capture parameters without explicitely naming all the parameters. | string | {"delayStartInMilliseconds": 150} |
Allow back | If enabled, allow back cameras for document capture. | boolean | ${true} |
Camera Height | The height of the camera set during capture. | integer | ${1440} |
Camera Width | The width of the camera set during capture. | integer | ${2560} |
Capture Orientation | Orientation for camera capture. | string | PORTRAIT |
Cropping Tolerance | The cropping tolerance. | double | ${0.06} |
Disable switch camera | Disable switching between front and back cameras. | boolean | ${false} |
Document Aspect Ratio | Document aspect ratio. | string | ${_documentType == 'PASSPORT' ? 1.42 : 1.58} |
Document Image Format | The format of the image to be captured. | string | jpeg |
Document Key | The identifier of the document. | string | doc1 |
Document Side | The identifier of the document. | string | FRONT |
Flash experience | Determines whether a flash is triggered upon successful capture of a document image. | boolean | ${false} |
List of Screens | The list of screens to be presented to the user during the capture process. Possible values include: instructions, capture, and preview. | list[strings] | ["instructions", "capture"] |
Manual Capture Delay | A list of integer values that determine the intervals when the popup modal will appear. The value is in seconds. | list[integer] | [30, 45] |
MRZ Enabled | Set whether MRZ scanning will be enabled. By default, MRZ scanning is enabled for passport documents. | string | ${_documentType == "PASSPORT"} |
PDF417 Enabled | Set whether PDF417 scanning will be enabled. By default, PDF417 scanning is disabled. | string | ${false} |
Report Metrics | When enabled, report metrics will send document capture session data to TrustX for debugging purposes. This functionality is enabled by default. | boolean | ${true} |
SDK version | The SDK version used for the capture. | string | v4.1.x |
Scale Frames Down If Slow | When enabled, reduces the number of required frames of a document capture in the event that the capture processing is too slow. | boolean | ${true} |
Starting Component ID | The name of the capture step to be sent to the UI | string | document-capture-v4 |
Video Sequence | If enabled, the end-user will be requested to capture a video of their document. | boolean | ${true} |
Tag 1 | The name of the capture step to be sent to the UI | string | Tags are values that the user can put into the activity to “tag” the capture process. These values may not be provided and are optional. |
Tag 2 | The name of the capture step to be sent to the UI | string | Tags are values that the user can put into the activity to “tag” the capture process. These values may not be provided and are optional. |
Tag 3 | The name of the capture step to be sent to the UI | string | Tags are values that the user can put into the activity to “tag” the capture process. These values may not be provided and are optional. |
Timeout in Seconds | Camera timeout in seconds. | integer | ${60} |
UI Component ID | The name of the screen used in the capture UI. | string | instructions |
Use Native Capture | Use the native capture process. | boolean | ${false} |
Video Checks Settings | Provides various configurations to video check settings. | map<string, string> | |
Video Settings | Provides various configurations to video settings. | map<string, string> | |
Video User Action | The actions that the end-user will be requested to perform. The instructions are intended for manual verification purposes. TrustX will not verify the correct actions have been performed. Possible values include:
|
list[string] |
Video capture instructions defined in the Video User Actions parameter are intended for manual verification purposes. TrustX will not verify the correct actions have been performed, and the check will pass automatically.
When the end-user reaches the video capture step during the Process Instance, they will be prompted to record a video of their document.

For more information on this activity, see the Document Activity Parameters page.
Quality Assessment
The 'Document Quality Assessment' activity is used to determine the quality of the captured document image.
- After the document type gateway created in the step above, add a 'Document Quality Assessment' activity to the Process Definition and use the global connect tool to connect it to the gateway.
- The activity has a 'Failed document quality' boundary event that is triggered when the document failed to pass the quality threshold. In this example, the boundary event is connected to the start of the document capture gateway using a sequence flow arrow.
- This activity supports the following input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Crop Image | Whether the received document image will be cropped. | BOOLEAN | ${true} |
Document Key | The identifier of the document. | STRING | doc1 |

Screen Replay Detection
Screen Replay Detection determines whether a document image is a genuine capture or a copy being displayed from a computer monitor or mobile device.
To configure Screen Replay Detection, follow the steps outlined below:
Add a 'Screen Replay Detection' activity to the Process Definition and connect the activity to the 'Document Quality Assessment' activity created in the step above.
This activity has two boundary events:
- Screen replay detected - triggered when an image is detected as a screen replay.
- Exceed screen replay detection count - triggered when the end-user has exceeded the set amount of retries.
In this example, the 'Screen replay detected' event will be connected to the start of the capture process. The 'Exceed screen replay detection count' will be configured later when the 'Simple Decider' activity is implemented.
'Screen Replay Detection' contains the following configurable input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Detection Threshold | The detection threshold. | DOUBLE | ${0.13572} |
Document Key | The identifier of the document. | STRING | doc1 |
Error navigation screen | The screen that the end user will be redirected to if an error occurs. Common values include: instructions, capture, preview. However, this can be any 'list of screen' value that appears in the activity connected to the error event. | STRING | preview |
Exception on Max Attempts Exceeded | If the maxAttempts is exceeded, should exceedFailedLivenessCount exception be thrown | BOOLEAN | ${true} |
Image Profile | The profile of the image; Cropped or Uncropped. | STRING | Uncropped |
Max Attempts | The number of attempts before the document is rejected or the failed flag is set. | INTEGER | ${3} |
Pipeline | The support pipeline to be used. Daon does not rcommend updating this value. | STRING | ibis-sr |
Result Output Variable Name | The name of the variable that the results will be outputted to. | STRING | screenReplayDetected |
Service ID | Daon does not recommend updating this value. This input parameter will be removed in a future update. | STRING | idlive-doc-v2-2-0 |

Black and White Copy Detection
The Black and White Copy Detection service checks whether the captured document image is genuine or a black and white copy of the original document.
To configure Black and White Copy Detection, follow the steps outlined below:
Add a 'Black and White Copy Detection' activity to the Process Definition and connect the activity to the Screen Replay Detection' activity created in the step above.
This activity has two boundary events:
- Black and white printout detected - triggered when an image is detected as a black and white copy of the original document
- Exceed black and white detection count - triggered when the end-user has exceeded the set amount of retries.
In this example, the 'Screen replay detected' event will be connected to the start of the capture process. The 'Exceed screen replay detection count' will be configured later when the 'Simple Decider' activity is implemented.
'Black and White Copy Detection' contains the following configurable input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Detection Threshold (raw) | The detection threshold. | DOUBLE | ${0.9321} |
Document Key | The identifier of the document. | STRING | doc1 |
Error navigation screen | The screen that the end user will be redirected to if an error occurs. Common values include: instructions, capture, preview. However, this can be any 'list of screen' value that appears in the activity connected to the error event. | STRING | preview |
Exception on Max Attempts Exceeded | If the maxAttempts is exceeded, should exceedFailedLivenessCount exception be thrown | BOOLEAN | ${true} |
Image Profile | The profile of the image; Cropped or Uncropped. | STRING | Cropped |
Max Attempts | The number of attempts before the document is rejected or the failed flag is set. | INTEGER | ${3} |

Color Copy Detection
Color Copy Detection checks whether the captured document image is genuine or a color copy of the original document.
To configure Color Copy Detection, follow the steps outlined below:
Add a 'Color Copy Detection' activity to the Process Definition and connect the activity to the 'Black and White Copy Detection' activity created in the step above.
This activity has two boundary events:
- Color copy detected - triggered when an image is detected as a color copy of the original document
- Exceed color copy detection count - triggered when the end-user has exceeded the set amount of retries.
In this example, the 'Screen replay detected' event will be connected to the start of the capture process. The 'Exceed screen replay detection count' will be configured later when the 'Simple Decider' activity is implemented.
'Color Copy Detection' contains the following configurable input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Crop expansion | The crop expansion value. | DOUBLE | ${6.0} |
Document Key | The identifier of the document. | STRING | doc1 |
Error navigation screen | The screen that the end user will be redirected to if an error occurs. Common values include: instructions, capture, preview. However, this can be any 'list of screen' value that appears in the activity connected to the error event. | STRING | preview |
Exception on Max Attempts Exceeded | If the maxAttempts is exceeded, should exceedFailedLivenessCount exception be thrown | BOOLEAN | ${true} |
Image Profile | The profile of the image; Cropped or Uncropped. | STRING | Cropped |
Max Attempts | The number of attempts before the document is rejected or the failed flag is set. | INTEGER | ${3} |
Threshold (raw) | The detection threshold. | DOUBLE | ${0.7245} |

Photo Substitution Detection
Photo Substitution Detection determines whether the face image associated with the captured document image belongs to the original document or whether it has been replaced or altered.
To configure Photo Substitution Detection, follow the steps outlined below:
Add a 'Photo Substitution Detection' activity to the Process Definition and connect the activity to the 'Black and White Copy Detection' activity created in the step above.
This activity has two boundary events:
- Photo substitution detected - triggered when if the face photo associated with the document has been altered.
- Exceed photo substitution count - triggered when the end-user has exceeded the set amount of retries.
In this example, the 'Screen replay detected' event will be connected to the start of the capture process. The 'Exceed screen replay detection count' will be configured later when the 'Simple Decider' activity is implemented.
'Photo Substitution Detection' contains the following configurable input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Detection Threshold (raw) | The detection threshold. | DOUBLE | ${0.3623} |
Document Key | The identifier of the document. | STRING | doc1 |
Error navigation screen | The screen that the end user will be redirected to if an error occurs. Common values include: instructions, capture, preview. However, this can be any 'list of screen' value that appears in the activity connected to the error event. | STRING | preview |
Exception on Max Attempts Exceeded | If the maxAttempts is exceeded, should exceedFailedLivenessCount exception be thrown | BOOLEAN | ${true} |
Image Profile | The profile of the image; Cropped or Uncropped. | STRING | Uncropped |
Max Attempts | The number of attempts before the document is rejected or the failed flag is set. | INTEGER | ${3} |
Pipeline | The support pipeline to be used. Daon does not rcommend updating this value. | STRING | umbrellabird-ps |
Result Output Variable Name | The name of the variable that the results will be outputted to. | STRING | portraitSubstitutionDetected |

Text Substitution Detection
TrustX Text Substitution Detection performs a check against a captured document image to determine whether any text on the document has been altered, substituted or obscured from the original document.
To configure Text Substitution Detection, follow the steps outlined below:
Add a 'Text Substitution Detection ' activity to the Process Definition and connect the activity to the 'Black and White Copy Detection' activity created in the step above.
This activity has two boundary events:
- Text substitution detected - triggered when if the face photo associated with the document has been altered.
- Exceed text substitution detection count - triggered when the end-user has exceeded the set amount of retries.
In this example, the 'text substitution detected' event will be connected to the start of the capture process. The 'Exceed screen replay detection count' will be configured later when the 'Simple Decider' activity is implemented.
'Photo Substitution Detection' contains the following configurable input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Document Key | The unique key of the document that text substitution will be performed against. | String | doc1 |
Error navigation screen | The screen that will be shown on TrustWeb when an error returns. | String | preview |
Exception On Max Attempts Exceeded | If enabled, an exception will be thrown once the defined maximum attempt have been exceeded. | Boolean | ${true} |
Image Profile | The image profile that will be used for text substitution detection. | String | Cropped |
Max Attempts | The maximum number attempts allowed before an exception is returned. | Integer | ${3} |

Confirm Document Image
After document verification checks have been performed, a prompt can be sent to the end-user to confirm that they're satisfied with the document capture. To do this, the 'Confirm Document Image - Front' can be used. This activity will display a confirmation screen to the end-user in TrustWeb.
- Add the 'Confirm Document Image' activity to the Process Designer and connect it to the 'Text Substitution Detection' activity using the global connect tool.
- The activity supports the following input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Allow Retake | Determines whether the user is allowed to retake the document image. | BOOLEAN | ${false} |
Document Key | The identifier of the document. | STRING | doc1 |
List of Screens | The list of screens to be presented to the user during the capture process. Possible values include: instructions, capture, and preview. | LIST_STRINGS | ["instructions", "capture", "preview"], |
Starting Component ID | The name of the capture step to be sent to the UI | STRING | document-capture-v3 |
UI Component ID | The name of the screen used in the capture UI. | STRING | instructions |
- After the 'Confirm Document Image' activity, add a new gateway that will be used to capture the confirmation of the document image.
- If the end-user is not satisfied with the document image, they can request to retake the photo. To handle this flow, connect a sequence flow arrow from the gateway to the beginning of the document capture flow.
- Click the sequence flow arrow and create an expression under the Condition column:
${_documentConfirmed!=true}
.

Document Processing
The next step requires processing the captured document. To accomplish this, the 'Regula Document Processor' activity will be used.
- After document confirmation, add a 'Regula Document Processor' activity and connect it to the 'Document confirmed' gateway created in the step above by using the global connect tool. The activity consists of the following input parameters.
Parameter | Description | Type | Default |
---|---|---|---|
Document Key | The identifier of the document. | STRING | doc1 |
Error navigation screen | The screen the user will be navigated to in case of an error event occurs. | STRING | instructions |
Exception Max Attempts | Exception for max attempts. | BOOLEAN | ${true} |
Image Profile | The profile of the image; Cropped or Uncropped. | STRING | Cropped |
Max Attempts | The maximum number of allowed attempts. | INTEGER | ${3} |
Measure System | The unit of measurement to be used. Possible values are METRIC or IMPERIAL. | STRING | METRIC |
Original Response Enabled | If set to true, the response of additional checks will be returned (eg. Chip data). If false, additional checks will not be returned. | BOOLEAN | ${false} |
Scenario | Set the type of security check to perform where FullAuth will perform additional security checks. Possible values include FullAuth, FullProcess or DocType. | STRING | ${FullProcess} |

Making a Decision
The 'Simple Decider' activity can be used to set a final outcome of a Process Instance. This activity is typically found at the end of a Process Definition and after all checks have been performed.
- Add a 'Simple Decider' activity to the Process Designer and connect the activity to the 'Regula Document Processor'. In this example, an additional gateway is created for switching back to the desktop.
- The 'Simple Decider' activity is connected to an 'End' gateway to conclude the Process Definition.

- The activity has the following input parameters:
- Decision on Any Failure - Defines the overall outcome should a check failure occur. Possible values are FAIL and PASS. The default value is FAIL.
- Derive Decision From - This parameter will set the decision of the overall outcome to the value provided as input. No iterative check will be performed. Accepted values are PASS, FAIL, or REVIEW. The result will be provided as the
_decision
output parameter. This parameter is empty by default.
Viewing Results
Results of a document capture and verification can be viewed from the Backoffice or the TrustX API.
Viewing Results in the Backoffice
The results of a Process Instance can be viewed from the Backoffice application. From the Backoffice application, follow the steps outlined below.
- Select Process Instances from the left vertical navigation bar.
- The Process Instances page provides various search options to find the Process Instance of choice.

- From the list of search results, select the magnifying glass to view the Process Instance page.

- Results can be found under the 'Documents' section. A further breakdown of results can be found under the 'Checks' section.


Viewing Results Using TrustX API
Document Check results can be retrieved from the TrustX API. The tenant will require additional permissions to retrieve this data. This section highlights some of the queries and privileges needed to retrieve this information.
The example below returns check information by providing the Process Definition and Process Instance ID.
Permissions: TNT#{tenantid}#UserDataServer:getChecksByKey
Example Request:
GET https://{{tenant}}.{{region}}.trustx.com/api/userdata-server/processDefinitions/{processDefnId}/processInstances/{processInstanceId}/userdata/checks
Content-Type: application/json
X-API-Key: {{apiKey}}
{}
Example Response:
{
"visualIntegrity": { },
"documentProcessing": { },
"video": { },
"docInjectionDetectionFront": { }
}
Further Reading
- Document Activity Parameters - A collection of all document related activities and their input parameters.
- Document Processor Activity Parameters - A collection of document processing related activities and their input parameters.