Skip to content

Consent

To use authorization services like Voice Recognition and Face Recognition we need to get the authorization consent from the end-user.

If the end-user does not agree, authorization services will not be processed.

What each call needs

CallAuthorization consentStorage consentWithout it
/v2/liveness——Runs normally. Liveness services never need consent.
/v2/face-verify, /v2/voice-verifyrequired—Face/Voice Recognition is skipped (not failed) and recorded in decision.reasons.
/v2/enrollments/face, /v2/enrollments/voicerequiredrequiredThe request is rejected.
PUT /v2/users/{user_id}/reference-imagerequired—The request is rejected.

How often to record it

Once per user, before the first call that needs it — typically at onboarding, before enrollment. Consent is stored per user and checked on every later call, so you do not need to record it again for each login or session.

Recording is idempotent: giving a consent the user has already given returns the existing record unchanged and adds nothing to its history. The history only grows when the user’s answer changes (for example a re-give after a revocation), so it stays an accurate audit trail.

Pass session_id when you record consent (below) if you want it to appear with the rest of that session in the Console.

Give, withdraw or read both consents for a user with one endpoint, keyed by the same user_id you send to enrollment and verification.

PUT https://api.biometrysolutions.com/api-gateway/v2/users/{user_id}/consents
Authorization

Project API token as Bearer, so call it from your backend (for example in your onboarding flow), not from a browser or app holding the token.

Body
  • authorization (boolean) - Consent to process the user’s biometric data.
  • storage (boolean) - Consent to store it for later verification.
  • session_id (string, optional) - Shows the consent with this session in the Console. The session must belong to your project (404 otherwise) and must not already belong to a different user_id (400).

true gives a consent, false withdraws it, and an omitted field is left as it is. Send at least one. Setting a consent to the value it already has is a no-op. user_id must be 3 to 128 characters of A-Za-z0-9._:@-.

Example
curl --request PUT 'https://api.biometrysolutions.com/api-gateway/v2/users/3fa85f64-5717-4562-b3fc-2c963f66afa6/consents' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{ "authorization": true, "storage": true, "session_id": "sess_fe402c29-b543-4413-8624-af1a2a0b2f2c" }'
Response

The user’s consent after the change:

{
"data": {
"user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"authorization": true,
"storage": true
},
"meta": { "request_id": "9e0f…", "message": "consents updated successfully" }
}
GET https://api.biometrysolutions.com/api-gateway/v2/users/{user_id}/consents

Returns the same data object. A user who never gave consent comes back with both false, not 404.

curl --request PUT 'https://api.biometrysolutions.com/api-gateway/v2/users/3fa85f64-5717-4562-b3fc-2c963f66afa6/consents' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{ "authorization": false, "storage": false }'

Enrollment is rejected with 403 again until consent is given back. Withdrawing consent does not delete enrollments or stored data; use Delete enrollments or Delete a user for that.


The consent service records the same two consents and is what API v1 integrations and Web SDK 3.x use (with X-Session-ID for the session). It also returns the full history, which v2 does not have yet. Use your user_id as user_fullname; despite the name, it is not the user’s real name.

POST https://api.biometrysolutions.com/api-consent/consent # authorization consent
POST https://api.biometrysolutions.com/api-consent/strg-consent # storage consent

Body: { "is_consent_given": true, "user_fullname": "<your user_id>" }, with your API token as Bearer.

Retrieve the full consent history for an end-user, including both authorization consent and storage consent records.

GET https://api.biometrysolutions.com/api-consent/history
Headers
  • Authorization* - Your API Token.
Query Parameters
  • user_fullname* (string) - The unique identifier of the end-user whose consent history you want to retrieve.
Example
curl --location 'https://api.biometrysolutions.com/api-consent/history?user_fullname=3fa85f64-5717-4562-b3fc-2c963f66afa6' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhbGciO...ANYea8r2xOG-Urc'
Response
{
"data": {
"user_fullname": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"consent": {
"is_consent_given": true,
"history": [
{ "is_consent_given": true, "date": "2024-01-15T10:30:00Z" },
{ "is_consent_given": false, "date": "2024-06-01T14:00:00Z" }
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-06-01T14:00:00Z"
},
"storage_consent": {
"is_consent_given": true,
"history": [
{ "is_consent_given": true, "date": "2024-01-15T10:35:00Z" }
],
"created_at": "2024-01-15T10:35:00Z",
"updated_at": "2024-01-15T10:35:00Z"
}
}
}