Document Validator Config
The config feature allows you to customize various parameters to enhance or adjust the behavior of the Document Validator according to your company’s needs. When a validation is executed, these parameters override the default configuration we have stored for any validation performed in Truora, ensuring that customers have all models up to date. for example:
Parameter | Client Config | Default Config | Used Config (Client+Default) |
---|---|---|---|
Allowed Retries | 2 | 3 | 2 |
Timeout | 900 | 300 | 900 |
Retries TTL | - | 300 | 300 |
In this guide, you will learn how to update, retrieve, and delete a configuration for the Document Validator. We will use a single example throughout this guide to demonstrate the use of the Update, Get, and Delete Config requests, helping you understand their essential functions and responses.
Document Validator Default Config
The Document Validator has a default configuration, which you can leave as is or adjust to better suit your industry or use case. Below are the default values for this configuration:
General Parameters
Parameter | Default Value |
---|---|
timeout | 300 |
allowed_retries | 0 |
retry_ttl | 300 |
Parameters by Country and Document Type
Country | Document Type | Document Version | Validation Methods |
---|---|---|---|
ALL | passport | passport | data-consistency |
BR | cnh | br_driver-license | - data-consistency - government-database-validation |
CL | driver-license | cl_driver-license | - data-consistency - government-database-validation |
CL | foreign-id | - cl_foreign-id-2013 - cl_national-id-2013 |
- data-consistency - government-database-validation |
CL | national-id | - cl_foreign-id-2013 - cl_national-id-2002 - cl_national-id-2013 |
- data-consistency - government-database-validation |
CL | passport | passport | data-consistency |
CO | driver-license | co_driver-license-2013 | data-consistency |
CO | foreign-id | co_foreign-id | - data-consistency - government-database-validation |
CO | identity-card | - co_identity-card-2008 - co_identity-card-old |
data-consistency |
CO | national-id | co_national-id-2000 | - data-consistency - government-database-validation - photo-of-photo - photocopy-analysis - image-analysis |
CO | national-id | co_national-id-2020 | - data-consistency - government-database-validation - photo-of-photo - photocopy-analysis |
CO | passport | passport | data-consistency |
CO | ppt | co_ppt | - manual-review - data-consistency - government-database-validation |
CO | rut | co_rut_person | data-consistency |
MX | foreign-id | - mx_fm2 - mx_fm3 |
- data-consistency - government-database-validation - photo-of-photo |
MX | invoice | - mx_invoice-cfe - mx_invoice-telmex - mx_invoice-total-play |
data-consistency |
MX | national-id | - mx_ife-c - mx_ife-d - mx_ine-f |
- data-consistency - government-database-validation - photo-of-photo - photocopy-analysis |
MX | national-id | - mx_ine-e - mx_ine-g |
- data-consistency - government-database-validation - image-analysis - photo-of-photo - photocopy-analysis |
MX | passport | passport | data-consistency |
MX | picture-id | mx_student-card | data-consistency |
MX | record | - mx_company-tax-report - mx_person-tax-report |
data-consistency |
PA | national-id | pa_national-id | data-consistency |
PE | national-id | - pe_national-id-2005 - pe_national-id-2013 - pe_national-id-2020 |
- data-consistency - government-database-validation - photo-of-photo |
VE | national-id | ve_national-id | data-consistency |
Configurable Parameters
General Parameters
For settings that affect all documents, you can set the following parameters:
timeout
: The amount of time, in seconds, that users will have to perform the validation before it times out. The default value is 300 seconds (5 minutes), with a maximum of 21600 seconds (6 hours) and a minimum of 1 second.allowed_retries
: The number of times the validation may be retried before failing. The default value value is 0 retries, with a maximum of 3 retries.retry_ttl
: The time to live (TTL), in seconds, for creating a retry of any validation. The default value is 300 seconds (5 minutes), with a maximum of 1800 seconds (30 minutes) and a minimum of 1 second.
Document Version Config
The following parameters are intended to change the configuration of a document version by enabling or disabling certain validation methods:
validation_method.data-consistency.status
: Allowed:enabled
|disabled
. Analyzes the extracted data from the document for consistency, such as date of birth and document number.validation_method.government-database-validation.status
: Allowed:enabled
|disabled
. Validates the extracted identification number against government databases.validation_method.photocopy-analysis.status
: Allowed:enabled
|disabled
. Analyzes if the image used for validation is a photocopy of a document.validation_method.photo-of-photo.status
: Allowed:enabled
|disabled
. Analyzes if the image used for validation is a photograph of a photograph of a document.validation_method.image-analysis.status
: Allowed:enabled
|disabled
. Checks for any alterations or edits in the image of the validated document.validation_method.manual-review.status
: Allowed:enabled
|disabled
. Determines whether manual review will be performed upon validation failure. You must contact Truora to activate this service. For more information please visit the manual review guide.
To configure the desired document version, you will need to send the next parameters in the body of your request along with the desired validation methods described above:
country
: Allowed:CO
|CL
|MX
|PE
|BR
|VE
|PA
|ALL
. Country for which the document validation configuration will be updated.document_type
: Allowed:national-id
|foreign-id
|driver-license
|passport
|identity-card
|rut
|ppt
|invoice
|picture-id
|record
|cnh
. The type of document for which the document validation configuration will be updated. If omitted, all supported document types will be affected.document_version
: The version of the document type for which the document validation configuration will be updated. If omitted, all supported document versions will be affected. To see the Allowed different versions available per country and document type, refer to the tables in Appendix 1: Supported Document Versions.Please contact our Support Team for further assistance .
Update Config - Document Validator
To Update the configuration for the Document Validator, follow these steps:
- Create a
PUT
request to the endpointhttps://api.validations.truora.com/v1/config
. - Set the Headers
Truora-API-Key
: enter the value of your Truora API-key.Content-Type
: the value should beapplication/x-www-form-urlencoded
.
- Set required values for the request body
validator
[Required]: Allowed:document-validation
. Validator to be configured.timeout
[Optional]: The amount of time, in seconds, that users will have to perform the validation before it times out.allowed_retries
[Optional]: The number of times the validation may be retried before failing.retry_ttl
[Optional]: The time to live (TTL) for creating a retry of any validation.country
[Required if modifying a validation method]: Allowed:CO
|CL
|MX
|PE
|BR
|VE
|PA
|ALL
. Country for which the document validation configuration will be updated.document_type
[Required if modifying a validation method]: Allowed:national-id
|foreign-id
|driver-license
|passport
|identity-card
|rut
|ppt
|invoice
|picture-id
|record
|cnh
. The type of document for which the document validation configuration will be updated. If omitted, all supported document types will be affected.document_version
[Required if modifying a validation method]: The version of the document type for which the document validation configuration will be updated. If omitted, all supported document versions will be affected. To see the Allowed different versions available per country and document type, refer to the tables in Appendix 1: Supported Document Versions.Please contact our Support Team for further assistance.
validation_method.data-consistency.status
[Optional]: Allowed:enabled
|disabled
. Analyzes the extracted data from the document for consistency, such as date of birth and document number.validation_method.government-database-validation.status
[Optional]: Allowed:enabled
|disabled
. Validates the extracted identification number against government databases.validation_method.photocopy-analysis.status
[Optional]: Allowed:enabled
|disabled
. Analyzes if the image used for validation is a photocopy of a document.validation_method.photo-of-photo.status
[Optional]: Allowed:enabled
|disabled
. Analyzes if the image used for validation is a photograph of a photograph of a document.validation_method.image-analysis.status
[Optional]: Allowed:enabled
|disabled
. Checks for any alterations or edits in the image of the validated document.validation_method.manual-review.status
[Optional]: Allowed:enabled
|disabled
. Determines whether manual review will be performed upon validation failure. For more information about manual review, please visit the manual review guide.
For this guide’s example we will start by setting the following parameters:
validator
: document-validationtimeout
: 250allowed_retries
: 3country
: COdocument_type
: national-iddocument_version
: co_national-id-2000validation_method.data-consistency.status
: disabledvalidation_method.manual-review.status
: enabled
Sending the Update Config request with these parameters, the response should look similar to the following:
/v1/config
Among other details, you will identify the updated config:
- For
document-validation
thetimeout
is set to 250 andallowed_retries
is set to 3. - For
"CO / national-id / co_national-id-2000"
themanual-review
is listed (enabled) anddata-consistency
is not listed (disabled)
Get Config
The Get Config request allows you to fetch the current configuration state for all validators associated with your account. This request retrieves the configuration for the Document Validator as well as the configuration states for all other validators linked to your account.
- To obtain the current validators’ configuration, send a GET request to the endpoint
https://api.validations.truora.com/v1/config
In the case of our current example, at this point you should receive the same response as the previous step:
/v1/config
Delete Config - Document Validator
The Delete Config request allows you to delete a validator’s configuration or a specific parameter within the validator’s configuration. Deleting the configuration resets its values back to their defaults.
-
To delete a config, send a DELETE request to the endpoint
https://api.validations.truora.com/v1/config
with the following Query Parameters:validator
[Required]: Name of the validation config to delete. Set this value todocument-validation
.type
[Optional]: Allowed:timeout
|allowed_retries
|retry_ttl
|document_config
. This specifies the configuration type to be reset. If provided, only the selected configuration will be reset. Otherwise, all configurations will be reset.
-
Note 1: If you omit the
type
parameter when sending the request, all configurations associated with the validator will be deleted, reverting all values to their default settings. -
Note 2: Setting the
type
field todocument_config
will reset any Document Version Config to their default values.
Deleting a specific config type
Following our example, we had updated the following configuration:
- For
document-validation
thetimeout
was set to 250 andallowed_retries
was set to 3. - For
"CO / national-id / co_national-id-2000"
, themanual-review
was listed (enabled) anddata-consistency
was not listed (disabled).
To reset the timeout to its default value (300 seconds), set the following Query Parameters :
validator
: document-validationtype
: timeout
Now send the DELETE request to the endpoint https://api.validations.truora.com/v1/config
. In the response, you should see that for document-validation
the timeout
has been reset to 300, and allowed_retries
will remain unchanged at 3:
/v1/config?validator=document-validation&type=timeout
Deleting all configurations
Following our example, after deleting the timeout
config, we have the following configuration states:
- For
document-validation
, thetimeout
was reset to its default (300), andallowed_retries
was set to 3. - For
"CO / national-id / co_national-id-2000"
themanual-review
was listed (enabled) anddata-consistency
was not listed (disabled).
To reset all the configuration for the Document Validator, set the following Query Parameters :
validator
: document-validationtype
: Omit this parameter. Remember that if this parameter is omitted, all configurations will be reset to their default values.
Now send the DELETE request to the endpoint https://api.validations.truora.com/v1/config
:
/v1/config?validator=document-validation
Finally, in this response you should recognize the following changes:
- For
document-validation
thetimeout
remains 300 (default), andallowed_retries
is reset to 0 (default). - For
"CO / national-id / co_national-id-2000"
the validation methods we previously set will be reset to their defaults:
-manual-review
is not listed (disabled)
-data-consistency
is now listed (enabled)
Appendix 1. Supported Document Versions
The following tables show the supported and allowed Document Versions per Document Type and Country:
COLOMBIA (CO)
Document Type | Document Version |
---|---|
driver-license | co_driver-license-2013 |
foreign-id | co_foreign-id |
identity-card | co_identity-card-2008 co_identity-card-old |
national-id | co_national-id-2000 co_national-id-2020 |
passport | passport |
ppt | co_ppt |
rut | co_rut-person |
CHILE (CL)
Document Type | Document Version |
---|---|
driver-license | cl_driver-license |
foreign-id | cl_foreign-id-2013 cl_national-id-2013 |
national-id | cl_foreign-id-2013 cl_national-id-2002 cl_national-id-2013 |
passport | passport |
MEXICO (MX)
Document Type | Document Version |
---|---|
foreign-id | mx_fm2 mx_fm3 |
invoice | mx_invoice-cfe mx_invoice-telmex mx_invoice-total-play |
national-id | mx_ife-c mx_ife-d mx_ine-e mx_ine-f mx_ine-g |
passport | passport |
picture-id | mx_student-card |
record | mx_company-tax-report mx_person-tax-report |
PERU (PE)
Document Type | Document Version |
---|---|
national-id | pe_national-id-2005 pe_national-id-2013 pe_national-id-2020 |
BRAZIL (BR)
Document Type | Document Version |
---|---|
cnh | br_driver-license |
VENEZUELA (VE)
Document Type | Document Version |
---|---|
national-id | ve_national-id |
PANAMA (PA)
Document Type | Document Version |
---|---|
national-id | pa_national-id |
ALL (ALL)*
Document Type | Document Version |
---|---|
passport | passport |