Templates & detection
Extract biometric templates to manage them in your own system, and detect faces to validate a capture.
Extract a face template
/extraction/face Access tokenExtracts the biometric template of a face sample, in base64, to store it in your own system and use it later in the template endpoints of enrolment, verification, identification and matching.
Roles: API · SDK
Headers
applicationIdstring· uuidRequiredYour application ID.
transactionIdstringOptionalYour own identifier of a transaction that groups several operations (for example, detections followed by an enrolment), for monitoring and audit.
Request bodyapplication/json
samplefileRequiredFace image (JPEG, PNG) or video (MP4).
livenessMethodnumberOptionalLiveness method for presentation attack detection:
1passive video (the user holds still for a moment),2passive image. Omit it to send a single image without liveness.
Response200 · application/json
operationIdstringRequiredIdentifier of the operation.
templatestring· base64RequiredBiometric template, in base64.
Status codes
- 200Template extracted.
- 400The sample cannot be used, or liveness failed.
BAD_SAMPLE_FORMAT,BAD_SAMPLE_QUALITY,NO_SAMPLE_DETECTED,NOT_ENOUGH_SAMPLE_DATA_DETECTED,MULTIPLE_SAMPLES_DETECTED,NO_LIVENESS_DETECTED. - 401Invalid or expired auth token.
TOKEN_NOT_VALID. - 403The biometric method is not enabled for the application.
BIOMETRIC_METHOD_NOT_ENABLED. - 429Too many requests: the caller's IP is temporarily or permanently blocked.
curl -X POST 'https://{SERVER-URL}/api/v7/extraction/face' \
-H 'Authorization: Bearer <AUTH_TOKEN>' \
-H 'applicationId: <applicationId>' \
-H 'transactionId: <transactionId>' \
-H 'Content-Type: application/json' \
-d '{
"sample": "<sample>",
"livenessMethod": 1
}'
application/json{
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c",
"template": "CgRGQUNFEhQyMDI2LTExLTA0VDEwOjE1OjMwWhoE…"
}
Extract a voice template
/extraction/voice Access tokenExtracts the biometric template of a voice sample, in base64, to store it in your own system and use it later in the template endpoints of enrolment, verification, identification and matching.
Roles: API · SDK
Headers
applicationIdstring· uuidRequiredYour application ID.
transactionIdstringOptionalYour own identifier of a transaction that groups several operations (for example, detections followed by an enrolment), for monitoring and audit.
Request bodymultipart/form-data
samplefileRequiredVoice recording (OGG, MP3, WAV).
livenessMethodnumberOptionalLiveness method for voice:
0(VOICE_PLA) detects replayed recordings and AI-generated voices. Omit it to skip liveness.
Response200 · application/json
operationIdstringRequiredIdentifier of the operation.
templatestring· base64RequiredBiometric template, in base64.
Status codes
- 200Template extracted.
- 400The sample cannot be used, or liveness failed.
BAD_SAMPLE_FORMAT,BAD_SAMPLE_QUALITY,NO_SAMPLE_DETECTED,NO_LIVENESS_DETECTED. - 401Invalid or expired auth token.
TOKEN_NOT_VALID. - 403The biometric method is not enabled for the application.
BIOMETRIC_METHOD_NOT_ENABLED. - 429Too many requests: the caller's IP is temporarily or permanently blocked.
curl -X POST 'https://{SERVER-URL}/api/v7/extraction/voice' \
-H 'Authorization: Bearer <AUTH_TOKEN>' \
-H 'applicationId: <applicationId>' \
-H 'transactionId: <transactionId>' \
-F 'livenessMethod=0' \
-F 'sample=@voice.wav'
application/json{
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c",
"template": "CgRGQUNFEhQyMDI2LTExLTA0VDEwOjE1OjMwWhoE…"
}
Detect faces
/detection/face Access tokenLocates the faces in an image or video and, with livenessMethod, checks that the sample comes from a live person. Useful to validate a capture before enrolling or verifying.
Roles: API · SDK
Headers
applicationIdstring· uuidRequiredYour application ID.
transactionIdstringOptionalYour own identifier of a transaction that groups several operations (for example, detections followed by an enrolment), for monitoring and audit.
Request bodymultipart/form-data
livenessMethodnumberOptionalLiveness method for presentation attack detection:
1passive video (the user holds still for a moment),2passive image. Omit it to send a single image without liveness.samplefileRequiredFace image (JPEG, PNG) or video (MP4).
Response200 · application/json
facesobject[]RequiredFaces found in the sample.
scorenumberOptionalLiveness confidence, from 0.5 to 1.0. Only when
livenessMethodis sent.operationIdstringRequiredIdentifier of the detection operation.
Status codes
- 200Faces detected.
- 400The sample cannot be used.
BAD_SAMPLE_FORMAT,BAD_SAMPLE_QUALITY,NO_SAMPLE_DETECTED,NOT_ENOUGH_SAMPLE_DATA_DETECTED,MULTIPLE_SAMPLES_DETECTED. - 401Invalid or expired auth token.
TOKEN_NOT_VALID. - 403The biometric method is not enabled for the application.
BIOMETRIC_METHOD_NOT_ENABLED. - 429Too many requests: the caller's IP is temporarily or permanently blocked.
curl -X POST 'https://{SERVER-URL}/api/v7/detection/face' \
-H 'Authorization: Bearer <AUTH_TOKEN>' \
-H 'applicationId: <applicationId>' \
-H 'transactionId: <transactionId>' \
-F 'livenessMethod=1' \
-F 'sample=@selfie.jpg'
application/json{
"faces": [
{
"detected": true,
"box": {
"x": 412,
"y": 236,
"w": 318,
"h": 402
},
"extractedSelfie": "CgRGQUNFEhQyMDI2LTExLTA0VDEwOjE1OjMwWhoE…"
}
],
"score": 0.93,
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c"
}