API Calls
API Calls Overview
The Biometry API is a RESTful API—which means it allows your application to communicate with Biometry’s services over the internet. It processes data that you send and returns the results in JSON format (a standard format that computers use to share information).
This documentation covers API v2. All gateway endpoints live under the /api-gateway/v2 prefix.
Base URL
All API v2 calls are made to the following base URL:
https://api.biometrysolutions.com/api-gateway/v2
Authorization
To use the Biometry API, you must first authenticate your request. This ensures that only authorised users and applications can access the API. You will need an API Token for this, which must be included as a Bearer token in the Authorization header of every request.
Identifying the end user
API v2 identifies the end user with an opaque, customer-provided user_id — any stable string you control (3–128 chars, A-Za-z0-9._:@-). You send it inside a JSON request part rather than a header.
For multipart endpoints (enrollment, verification, face-match, document check), send a form field named request containing a JSON object, alongside the binary file parts:
curl --location 'https://api.biometrysolutions.com/api-gateway/v2/liveness' \ --header 'Authorization: Bearer <api-key>' \ --form 'request={"user_id":"user-123","phrase":"one two three four five"}' \ --form 'video=@"/path/to/video.mp4"'The request object carries the identity and options for the call (user_id, session_id, phrase, vocabulary, trigger, provider, use_session_video, services, …). Each endpoint page lists the fields it accepts.
Responses
When you send a request to Biometry, the API returns a response in JSON format using a standard success envelope:
{ "data": { }, "decision": { "status": "pass", "score": 0.95, "reasons": [] }, "meta": { "request_id": "fc5605c5-...-87cc-979cd72564d4", "message": "human-readable status message" }}data— the endpoint-specific payload (raw service results, extracted document data, etc.). Omitted when the operation returns no data.decision— the scoring decision (status=pass/fail/refer, plusscoreandreasons). Present only when a scoring system is configured for your API key.meta.request_id— the transaction ID (also returned in theX-Request-Idresponse header). Use it with Get samples and Result tagging.
Reading the verdict
Decide on decision.status, not on the per-service entries. It is always
one of three lowercase strings:
decision.status | Meaning | What to do |
|---|---|---|
pass | The weighted score reached the pass threshold and no critical service failed. | Accept. |
fail | A critical service failed, or the weighted score is at or below the fail threshold. | Reject. Let the user retry with a new capture if your flow allows it. |
refer | Not conclusive: the score fell between the thresholds, or an active service could not be evaluated (it errored, or the user has no enrolled face/voice yet). | A final state for this transaction, not a “try again later”. Route it to manual review, or ask for a fresh capture / a step-up check. |
decision.reasons says which service tipped the verdict. See
Scoring Systems for how it is computed.
The entries under data are the raw service outputs, keyed by service, and
their result field has no common type — it is whatever that service measures:
| Service key | result | Notes |
|---|---|---|
face_liveness_detection | boolean | true = live face. |
active_speaker_detection | number | Speaker-agreement measure; use score. |
visual_speech_recognition | string | The transcription read from the lips. |
face_recognition | — | Use score. |
voice_recognition | — | Carries status (e.g. good, not_enrolled) and score instead. |
A service that could not run returns an error entry in place of a result.
Treat these values as diagnostics for logging and support, not as a pass/fail
contract — that contract is decision.status.
Response Codes
The API returns standard response codes:
200 OK: The request was successful.201 Created: An asynchronous resource (e.g. a deepfake check) was created.400 Bad Request: Parameter validation failed.401 Unauthorized: The API token is missing or invalid.403 Forbidden: A required service is not enabled, or consent is required.404 Not Found: The requested resource (user, session, reference image, …) does not exist.422 Unprocessable Entity: The media could not be processed (e.g. no face detected, audio unreadable).500 Internal Server Error: There was an issue on Biometry’s end.
Handling Response Errors
If something goes wrong, the API returns an error envelope:
{ "error": { "code": "invalid_request", "message": "human-readable message, or a field-error array for validation failures" }, "meta": { "request_id": "fc5605c5-...-87cc-979cd72564d4" }}Example Error
If you send a request with an invalid API token:
curl --location 'https://api.biometrysolutions.com/api-gateway/v2/liveness' \ --header 'Authorization: Bearer eyJh...9JuAXxxJAxkkzk'Response:
{ "error": { "code": "unauthorized", "message": "malformed token" }, "meta": {}}