Authenticate User V3
/authenticateUser/v3
Description
This service provides biometric template persistence and 1:1 facial authentication against stored templates. It supports two operating modes within a single endpoint, determined by the request body:
Enroll mode: Validates the liveness check and performs facial matching between a provided Biometric Template and a live capture, then persists the template associated with a
userId.Authenticate mode: Retrieves a previously stored template by
userIdand performs 1:1 facial matching and liveness check validation against a new live capture.
Functionality
Enroll: The
userIdis sent along with the Biometric Template (templateRaw) and the best tokenized image (bestImageToken). The liveness check and facial matching are validated. If both succeed, the template associated with the user is persisted. If the user already exists, the template is updated.Authenticate: The
userIdis sent along with thebestImageTokenfrom the current session. The stored template is retrieved and 1:1 matching is performed against the live capture. The authentication result is returned with the similarity score.
Use cases
Customer without prior onboarding with Facephi: During password recovery, the customer completes Onboarding, which generates a Biometric Template. This template is enrolled through this endpoint and associated with a
userId. Future password recoveries authenticate directly against the stored template without repeating Onboarding.Customer with prior onboarding with Facephi: The customer already has a stored template. Subsequent authentications use the 1:1 matching flow against the stored template.
Integration
Requires implementation of the Selphi Mobile Widget or the Selphi Web Widget to generate the bestImageToken and Biometric Template (templateRaw).
Endpoint
POST /services/authenticateUser/v3Headers
x-api-key
String
Yes
Tenant API key
Content-Type
String
Yes
application/json
family
String
No
Required family header for Tracking
All calls to Endpoints with Tracking in Identity Platform must include the header
family.
Enroll mode
Enrolls or updates a biometric template for a user. Requires successful liveness check and facial matching validation before persisting the template.
The presence of the field templateRaw in the request body activates this mode.
Request body
Content-Type: application/json
Parameters
userId
String
Yes
Unique user identifier. Must be at least 2 characters long.
templateRaw
String (Base64)
Yes
Facial biometric template generated from the best image during the onboarding process. Its presence activates enroll mode.
bestImageToken
String (Base64)
Yes
Best tokenized facial image generated by the Selphi Widget. Used for liveness check validation and facial matching against templateRaw to verify that they correspond to the same living person.
tracking
JSON Object
No
Object containing tracking information.
extraData
String (Base64)
No
Token generated by the SDK Mobile/Web containing tokenized tracking information.
operationId
String
No
Operation identifier generated by the SDK Mobile/Web.
Example request: Enroll
Enroll behavior
Liveness check: Validates that
bestImageTokencorresponds to a living person.Facial matching: Performs 1:1 matching between
templateRawandbestImageTokento verify that they belong to the same person.Persistence: If both checks pass, looks up the
userId:If the user does not exist: creates the user and stores the template.
If the user already exists: updates the stored template with the new one.
TTL (if configured): The template token has a configurable validity period for use in the service. Once expired, it is no longer valid for enrollment.
Authenticate Mode
Authenticates a user by comparing a live capture against their previously stored biometric template. This mode is activated when templateRaw is not included in the request body.
Important: The user must have been enrolled previously (through enroll mode or the v1/v2 self-registration flow) before they can be authenticated. Attempting to authenticate a user who has not been enrolled returns a
User not found.
Parameters
userId
String
Yes
Unique identifier of the user to authenticate. Must be at least 2 characters long.
bestImageToken
String (Base64)
Yes
Best tokenized facial image from the current authentication session. Used for liveness check validation and 1:1 Matching against the stored template.
tracking
JSON Object
No
Object containing tracking information.
extraData
String (Base64)
No
Token generated by the SDK Mobile/Web containing tokenized tracking information.
operationId
String
No
Operation identifier generated by the SDK Mobile/Web.
Example request: Authenticate
Authentication behavior
User lookup: Retrieves the stored template associated with
userId.TTL check: If the template has an expiration configured and it has expired, returns
Template expired.Liveness check: Validates that
bestImageTokencorresponds to a living person.Facial Matching: Performs 1:1 Matching between the stored template and
bestImageToken.Result: Returns the Matching result, including the similarity score, authentication status, and liveness check diagnostics.
Responses
200 Success
Response parameters
serviceResultCode
Integer
Code indicating the overall result of the service execution. See the Service Result Code table below.
serviceResultLog
String
Descriptive field for the execution result. Empty on success.
serviceFacialSimilarityResult
Float
Value indicating facial similarity between the template and bestImageToken. 1.0 = 100%. Present only when biometric Matching is performed.
serviceFacialAuthenticationLog
String
Descriptive field for the facial authentication result (e.g., "Positive", "Negative", "Uncertain"). Present only when biometric Matching is performed.
serviceFacialAuthenticationResult
Integer
Code indicating the facial authentication result. See Table 2 - Service Facial Authentication Result.
serviceLivenessLog
String
Descriptive field for the passive liveness check result (e.g., "Live", "Spoof"). Present only when the liveness check is evaluated.
serviceLivenessResult
Integer
Code indicating the result of the passive liveness check evaluation. See Table 3 - Service Liveness Result.
timestamp
String
Response timestamp (UTC) in the format: YYYY-MM-DDThh🇲🇲ssZ
transactionId
String
Transaction identifier associated with the request processed by the API.
Service Result Code
The serviceResultCode indicates the overall result of the service execution:
0
Operation successful (enroll completed or user authenticated).
200
-101
The bestImageToken does not correspond to a live person.
200
-102
User authentication failed — negative facial match.
200
-103
User not found (authenticate mode only).
404
-104
Template not found — the user exists but has no stored template.
404
-105
Template expired — TTL exceeded; the template is no longer available.
200
Service Liveness Result
The serviceLivenessResult indicates the result of the passive liveness check evaluation:
Service Facial Authentication Result
The serviceFacialAuthenticationResult indicates the result of the facial matching operations:
Example response: Successful enrollment
Example response: Successful authentication (positive match)
Example response: Negative match
Example response: User not found
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
413 Payload Too Large
The request exceeds the maximum allowed size. The gateway rejects it without processing it: the response does not include serviceResultCode or serviceTransactionId. See Request size limit.
Request greater than 6 MB and up to 10 MB (Content-Type: application/json):
Request greater than 10 MB (10,485,760 bytes) (Content-Type: text; charset=utf-8, plain text, not JSON):
502 Bad Gateway
504 Gateway Timeout
Differences from v1/v2
Template field in request
registeredTemplateRaw
templateRaw
merchantReferenceId
Required
Not used
image / template as input
Supported
Not supported — only templateRaw + bestImageToken
Automatic enrollment on first authentication
Yes
No — explicit enrollment required
Template in response
Yes (registeredTemplateRaw)
No (not returned for security reasons — avoids unnecessary transfer of PII)
Liveness check + match during enrollment
N/A
Required before persistence
Template TTL / expiration
Not supported
Supported (configurable per tenant using templateTTLSeconds)
New error codes
N/A
-104 (Template not found), -105 (Template expired)
Last updated