Quick start
This guide enrols a user's face and verifies it, using only the API. You need curl, the application ID, an API role key and the SERVER-URL provided by Mobbeel, a few face images and a short selfie video.
How it works
GET /authorizationThe API key must never reach a mobile app or a web page. Your front end only handles the captures; every call in this guide is made from your backend.
1. Authenticate
curl --location 'https://{SERVER-URL}/api/v7/authorization' \
--header 'applicationId: YOUR_APPLICATION_ID' \
--header 'apiKey: YOUR_API_KEY'
{ "authToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ..." }
Send it as Authorization: Bearer <AUTH_TOKEN> in every call that follows. It expires after 30 minutes by default.
2. Create a user
curl --location --request POST 'https://{SERVER-URL}/api/v7/application/YOUR_APPLICATION_ID/user' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data '{ "userId": "user-0001" }'
Use the identifier your own system already gives the person. If you omit it, MobbID assigns a UUID.
3. Enrol the face
Start the enrolment to get an operationId, then send the samples with it:
curl --location --request POST 'https://{SERVER-URL}/api/v7/enrollment/face/start' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'applicationId: YOUR_APPLICATION_ID' \
--header 'Content-Type: application/json' \
--data '{ "userId": "user-0001" }'
curl --location --request POST 'https://{SERVER-URL}/api/v7/enrollment/face' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'applicationId: YOUR_APPLICATION_ID' \
--form 'operationId="OPERATION_ID"' \
--form 'userId="user-0001"' \
--form 'livenessMethod="1"' \
--form 'samples=@"/path/to/selfie.mp4"'
A 201 means the user is enrolled. A 202 means MobbID needs more samples: send them with the same operationId until progress reaches 100. livenessMethod 1 checks passive liveness on the video; see Enrolment for the other options.
4. Verify the user
The same two steps, on the verification endpoints:
curl --location --request POST 'https://{SERVER-URL}/api/v7/verification/face/start' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'applicationId: YOUR_APPLICATION_ID' \
--header 'Content-Type: application/json' \
--data '{ "userId": "user-0001" }'
curl --location --request POST 'https://{SERVER-URL}/api/v7/verification/face' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'applicationId: YOUR_APPLICATION_ID' \
--form 'operationId="OPERATION_ID"' \
--form 'userId="user-0001"' \
--form 'livenessMethod="1"' \
--form 'samples=@"/path/to/new-selfie.mp4"'
{
"operationId": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c",
"userId": "user-0001",
"progress": 100,
"verified": true,
"score": { "liveness": 0.96, "matching": 0.91, "identityVerification": 0.93 },
"detectedFace": { "probe": { "detected": true, "box": { "x": 412, "y": 236, "w": 318, "h": 402 } } }
}
5. Confirm the result
Read the operation from your backend. Grant access only when status is SUCCESS and data.result is true:
curl --location 'https://{SERVER-URL}/api/v7/application/YOUR_APPLICATION_ID/operation/OPERATION_ID' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN'
The operation also returns the scores, the thresholds applied, the quality controls and the files of the capture. See the operation object.