TruFace Validation
You can use TruFace to help your company identify, block and report fraudsters faces. Here is how it works:
- When making an onboarding process: Our system will automatically check if the person undergoing your onboarding process has been reported before and will alert you.
- Report faces: If you identify fraudsters, you can report and block those faces and these will be added to your collection.
- If you mistakenly blocked a face: Don’t worry! You also have the option to unblock it.
- Checking Faces: The process involves checking against your registered collection of blocked faces.
- Note: Optionally your company could make use of risky faces detected by Truora. This requires a request for access, to do so please Contact Us.
Prerequisites
Before you begin, make sure you have the following:
-
Truora API-Key: This key grants access to our services. If you don’t have one already, set up an account and then go to Authentication to obtain your Truora API-key.
-
Media Files: You will need a reference image to perform user enrollment (Report a face) and another image to compare and make the validation (Check a face).
-
Postman: Use Postman or any other collaboration tool for API development. Although it is not required to perform the integration, it will help perform tests along the way.
Truora provides a Postman collection online that includes the necessary tools to simplify the testing process.
Blocking faces
- Create an enrollment for the validation account.
- Use
fraud_reason
to block a face from being validated. - Save the
account_id
andenrollment_id
from the response, since these will help you identify people who have been reported.
1. Create enrollment (Report a Face)
Setup main Request Headers and Body
To configure the main request headers and body, follow these steps:
-
Create a
POST
request to the endpointhttps://api.validations.truora.com/v1/enrollments
. -
Set the Headers
Truora-API-Key
: enter the value obtained in the step of get Truora API-key.Content-Type
: the value should beapplication/x-www-form-urlencoded
.
-
Set required values for the request body
type
[Required]: Indicates the type of validation to be performed. Set this value toface-search
.user_authorized
[Required]: This indicates that you have the authorization of the person to be verified. This is mandatory in order to comply with data protection laws. Value must be set totrue
in order to perform the validation.account_id
[Optional]: The account_id links the face to an account. It is a unique value assigned to each user in the system to distinguish them and access their information and processes. An automated account id is created if left blank, otherwise, a validation account is created with the custom account id provided. Use this ID to trace the blocked face.
Only Account IDs following the regex pattern [a-zA-Z0-9_.-]+ are supported. Please go to Create an Account ID to learn more about it.- Note: For better tracking, it is recommended that your company sets this ID with a traceable system.
country
[Required]: Allowed:ALL
|BR
|CL
|CO
|CR
|EC
|MX
|PE
. Country of the reported face.
Note: If you are going to use TruFace as a Face Validation compliment, you must useALL
as country.fraud_reason
[Required]: Indicates the reason to block a face. Set one of the following:manipulated_document
➜ indicates that this person is known to use manipulated documents to pass identity validations.manipulated_photo
➜ indicates that this person is known to manipulate photos to pass identity validations.non_payment
➜ indicates that this person has incomplete payments and refuses to pay.criminal_records_in_company
➜ indicates that this person has some sort of criminal history with your company, or an ally.fraudster
➜ indicates you know this person to be a fraudster for reasons different from the above.
Send the Create enrollment request you just created, and will receive a response similar to the following:
/v1/enrollments
Note:
- Enrollment
status
will be pending until the reference image is successfully uploaded in the next step.- The
account_id
,enrollment_id
andfile_upload_link
returned by this endpoint will be used in subsequent steps.
2. Upload Picture
The reference image must be submitted through a PUT
request to the URL returned in the file_upload_link
field of the previous step, selecting the Binary type in the Body.
The image formats supported are: jpeg, png and webp. Maximum size is 10 MB.
After sending the PUT
request you will receive a response similar to the following:
{{file_upload_link}}
3. Get Enrollment
The Get enrollment request will consult the status of the enrollment. The status will remain as pending
until the image is successfully uploaded in the previous step, when it will change to success
.
Send a GET request to the endpoint https://api.validations.truora.com/v1/enrollments/{{enrollment_id}}
.
If the file has not yet been uploaded successfully, you will receive a response with status pending
similar to the following:
/v1/enrollments/{{enrollment_id}}
If the file is successfully uploaded, you will receive a response with status success
similar to the following:
/v1/enrollments/{{enrollment_id}}
Checking faces
Allows you to create a validation of the person who will perform the onboarding process. The account identifies a user in Truora’s system and is represented by the account_id
.
1. Create validation (Check a Face)
Setup main Request Headers and Body
To configure the main request headers and body, follow these steps:
-
Create a
POST
request to the endpointhttps://api.validations.truora.com/v1/validations
. -
Set the Headers
Truora-API-Key
: enter the value obtained in the step of get Truora API-key.Content-Type
: the value should beapplication/x-www-form-urlencoded
.
-
Set required values for the request body
type
[Required]: Indicates the type of validation to be performed. Set this value toface-search
.account_id
[Optional]: Validation account ID linked with this validation. An automated account id is created if left blank, otherwise, a validation account is created with the custom account id provided. Use this ID to trace the validations performed by the account later on.
Only Account IDs following the regex pattern [a-zA-Z0-9_.-]+ are supported. Please go to Create an Account ID to learn more about it.- Note: For better tracking, it is recommended that your company sets this ID with a traceable system.
user_authorized
[Required]: Indicates whether the person subject to the validation authorized the validation. Must betrue
in order to proceed.country
[Required]: Allowed:ALL
|BR
|CL
|CO
|CR
|EC
|MX
|PE
Note: If you are going to use TruFace as a Face Validation compliment, you must useALL
as country.timeout
[Optional]: The time, in seconds, users will have to complete the validation. If omitted, the timeout from the client’s config will be used. The default value is 300 seconds (5 minutes), with a maximum of 21600 seconds (6 hours).
Send the Create validation request you just created. You will receive a response similar to the following:
/v1/validations
Note
- The
validation_id
andfile_upload_link
returned by this endpoint will be used in subsequent steps.
2. Upload Picture
The reference image must be submitted through a PUT
request to the URL returned in the file_upload_link
field of the previous step, selecting the Binary type in the Body.
The image formats supported are: jpeg, png and webp. Maximum size is 10 MB.
After sending the PUT
request you will receive a response similar to the following:
{{file_upload_link}}
3. Get Validation
The Get validation request allows you to retrieve the current status and results of a validation. The validation_status
begins as pending
. Upon completion, the validation can either be success
or failure
.
- To obtain the validation results, send a GET request to the endpoint
https://api.validations.truora.com/v1/validations/{{validation_id}}
, wherevalidation_id
is the identifier returned in the Create validation (Check a Face) request. - If you want to obtain links of the reported face image and the photo uploaded by the user, send the query parameter
show_details
with valuetrue
in the Get validation request, and you will receive the response with the linksvalidation_input_files
andinput_files
.- NOTE: These links will be valid for 15 minutes. To generate new links, the Get Result endpoint must be called again to return the result of the process with new links.
Once executed you will receive a response similar to the following:
/v1/validations/{{validation_id}}
Note:
- If the
validation_status
issuccess
, it indicates that the user’s face was not found in any collection of reported faces.- If the
validation_status
isfailure
and thedeclined_reason
isfraudster_face_match_in_client_collection
, it indicates that the user’s face matched one reported as a fraudster.
Unblocking a Face
Delete enrollment (Unblock a face)
In order to unblock faces from Truora’s services you must:
- Know the
enrollment_id
returned in Create enrollment (Report a Face) step. - Create a DELETE request to the endpoint
api.validations.truora.com/v1/enrollments/{{enrollment_id}}
.
The following success message
confirms that the face has been unblocked:
/v1/enrollments/{{enrollment_id}}
Getting results automatically (Webhooks)
To get validation results automatically, you must subscribe webhooks. For more information, please see Webhooks section.
Note: The hook only contains the validation result information. If you want to obtain links of the reported face image and the photo uploaded by the user, you must:
- Decode the hook response and extract the value of
validation_id
field. - Use the
validation_id
to make the Get validation request with the query parametershow_details
set totrue
. - The Get validation response will include the links in the fields
validation_input_files
andinput_files
. - These links will be valid for 15 minutes. To generate new links, the Get validation endpoint must be called again to return the result of the process with new links.
Declined and Expired reasons
Whenever a validation fails due to inconsistencies in the validation process or expires in the validation process, the API provides a reason to indicate why the validation was declined or expired:
- To learn more about the possible declined reasons, please visit the Declined Reasons section.
- To learn more about the possible expired reason, please visit Expired Reasons section.
Additional configurations
Using our API you can configure other parameters to improve the behavior of the validators and the user experience according to your particular needs. Please see the Config Validator Guide for more information on customization.
Please Note:
- The config parameters you will see in the Config Validator Guide are global parameters for your account and will affect all the validations across your account.
- However, validations performed using the flow you created will prioritize the configuration in the Validator Block of your flow. All other parameters, not configurable within the Flow Builder, will take the global configuration values.