Skip to main content

Templates & detection

Extract biometric templates to manage them in your own system, and detect faces to validate a capture.

Extract a face template​

POST/extraction/face Access token

Extracts 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· uuidRequired

    Your application ID.

  • transactionIdstringOptional

    Your own identifier of a transaction that groups several operations (for example, detections followed by an enrolment), for monitoring and audit.

Request bodyapplication/json

  • samplefileRequired

    Face image (JPEG, PNG) or video (MP4).

  • livenessMethodnumberOptional

    Liveness method for presentation attack detection: 1 passive video (the user holds still for a moment), 2 passive image. Omit it to send a single image without liveness.

Response200 · application/json

  • operationIdstringRequired

    Identifier of the operation.

  • templatestring· base64Required

    Biometric 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
}'
Responses
200OKapplication/json
{
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c",
"template": "CgRGQUNFEhQyMDI2LTExLTA0VDEwOjE1OjMwWhoE…"
}

Extract a voice template​

POST/extraction/voice Access token

Extracts 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· uuidRequired

    Your application ID.

  • transactionIdstringOptional

    Your own identifier of a transaction that groups several operations (for example, detections followed by an enrolment), for monitoring and audit.

Request bodymultipart/form-data

  • samplefileRequired

    Voice recording (OGG, MP3, WAV).

  • livenessMethodnumberOptional

    Liveness method for voice: 0 (VOICE_PLA) detects replayed recordings and AI-generated voices. Omit it to skip liveness.

Response200 · application/json

  • operationIdstringRequired

    Identifier of the operation.

  • templatestring· base64Required

    Biometric 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'
Responses
200OKapplication/json
{
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c",
"template": "CgRGQUNFEhQyMDI2LTExLTA0VDEwOjE1OjMwWhoE…"
}

Detect faces​

POST/detection/face Access token

Locates 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· uuidRequired

    Your application ID.

  • transactionIdstringOptional

    Your own identifier of a transaction that groups several operations (for example, detections followed by an enrolment), for monitoring and audit.

Request bodymultipart/form-data

  • livenessMethodnumberOptional

    Liveness method for presentation attack detection: 1 passive video (the user holds still for a moment), 2 passive image. Omit it to send a single image without liveness.

  • samplefileRequired

    Face image (JPEG, PNG) or video (MP4).

Response200 · application/json

  • facesobject[]Required

    Faces found in the sample.

  • scorenumberOptional

    Liveness confidence, from 0.5 to 1.0. Only when livenessMethod is sent.

  • operationIdstringRequired

    Identifier 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'
Responses
200OKapplication/json
{
"faces": [
{
"detected": true,
"box": {
"x": 412,
"y": 236,
"w": 318,
"h": 402
},
"extractedSelfie": "CgRGQUNFEhQyMDI2LTExLTA0VDEwOjE1OjMwWhoE…"
}
],
"score": 0.93,
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c"
}