Match face images against selfies
Scenario: you have an image of your user, and want to perform a selfie match against that image, to check if the current user matches the photo you have on record. This could be used when changing very sensitive data, or as an additional verification step for transactions involving large sums of money.
Create a workflow
Configure the initialization step
Set up the initialization step to require a photo that you have saved in your system:
- Add a field name. In this tutorial we'll use
faceImage. - Add a linked field. Set it to Document face image if you have a face image, or if you have an image of a document, set it to "Raw document image front".

Add the selfie capability
The workflow could involve more steps if you need them, but to just perform a selfie (biometric) check, only one step is required: Selfie, Liveness & Face Match.

Send the face image when you create the transaction
After you've published your workflow, it's ready to be used. The workflow expects to find a face image in the initialization step.
You provide that image from your backend, in the same request that creates the transaction:
- The user starts the face check in your app.
- Your backend authenticates the user.
- Your backend fetches the face image you have on record for that user.
- Your backend Base64-encodes the image and calls
POST /api/v2/transactionon the Agent API, with the image informValues. - The Agent API returns
sdkConfiguration, and your backend returns it to your app. - Your app passes
sdkConfigurationto the SDK, and the user takes a selfie.
The image never passes through your app, and the SDK needs no extra configuration.
Request body
Put the image in the formValues object, under the name you gave the field in the initialization step:
{
"workflowId": "ed8f5b8efd2a90c37e0b8aac",
"platform": "Browser",
"formValues": {
"faceImage": "/9j/4AAQSkZJRgABAQAASABIAAD/4QB..."
},
"consent": {
"userId": "unique-user-id",
"isProcessingStoringAllowed": true
}
}
Workflow user experience
The end user goes through only one step: the selfie match.
Since the face image is added on your backend, the user only takes a selfie, while the administrator sees the face image in the transaction history for that transaction.