Skip to main content

Age Verification

For the full integration flow, see API Overview.

Endpoint

EnvironmentURL
ProductionPOST https://api.id.unico.app/processes/v1
SandboxPOST https://api.id.uat.unico.app/processes/v1

Request

Headers
HeaderValue
AuthorizationBearer <access_token> (see Authentication)
APIKEYProvisioned API key — must have Age Verification capabilities enabled.
Content-Typeapplication/json
Body parameters
FieldTypeRequiredDescription
subjectobjectyesUser information container.
subject.codestringconditionalCPF (BR) or CURP (MX), without formatting. Required when the flow includes Liveness or Identity Verification (see Age Verification capability); not required for Age Verification-only flows.
subject.namestringnoUser's full name.
subject.genderstringnoM for male or F for female.
subject.birthDatestring (ISO 8601)noDate of birth (YYYY-MM-DD).
subject.emailstringnoUser's email address.
subject.phonestringnoPhone number: country code + area code + number, no separators (e.g. 5519725570707).
useCasestringnoOperation's use case identifier.
subsidiaryIdstringnoBranch ID — required only if multiple branches exist.
imageBase64stringyesEncrypted SDK output or base64 image (PNG, JPEG, WebP).
Image requirements
  • Minimum resolution: 640 × 480 (HD standard)
  • Maximum file size: 800 KB (JPEG92 compression recommended)
  • JWT tokens from the SDK expire after 10 minutes and can only be used once

Example

curl -X POST https://api.id.unico.app/processes/v1 \
-H "Authorization: Bearer $TOKEN" \
-H "APIKEY: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": {
"code": "12345678909",
"name": "Luke Skywalker",
"birthDate": "2000-05-20",
"email": "[email protected]",
"phone": "5519725570707"
},
"useCase": "AgeVerification",
"imageBase64": "/9j/4AAQSkZJR..."
}'

Responses

200 OK

The response fields returned depend on which capabilities are enabled for your APIKEY.

Age Verification only (no Liveness, no Identity Verification):

{
"id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
"status": 3,
"idAge": { "result": "yes" }
}

Age Verification + Liveness + Identity Verification:

{
"id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
"status": 3,
"unicoId": { "result": "yes" },
"idAge": { "result": "yes" },
"liveness": 1
}
FieldTypeDescription
idstring (UUID)Process identifier. Use with Get Process for re-queries.
statusinteger3 (finished with success), 5 (error). Only use status = 3 for business decisions. For all possible values, see Get Process.
idAge.resultstringyes, no, inconclusive — Age Verification result. Present in all responses.
unicoId.resultstringyes, no, inconclusive — present only when Identity Verification is enabled.
livenessinteger1 (passed), 2 (failed) — present only when Liveness is enabled.
400 Bad Request

The payload is malformed, the image is invalid, or required fields are missing.

403 Forbidden

Bearer token or APIKEY missing, expired, or invalid. See Authentication.

409 Conflict

The processId provided already exists for this tenant. See Error Codes below.

429 Too Many Requests

Rate limit reached. Retry after the interval indicated in the Retry-After response header. See Rate limits.

500 Internal Server Error

Unexpected server error.

Error Codes

CodeMessageDescription
20900O base64 informado não é válido.Invalid base64 parameter; potential image or injection issue.
20807A imagem precisa estar no padrão HD ou possuir uma resolução superior a 640 x 480.Image resolution below minimum threshold.
20509The subject.name field is invalid.subject.name contains invalid characters.
20508The subject.gender field is invalid.subject.gender must be M or F.
20507O parâmetro subject.code é inválido.Malformed or non-existent identifier value. Only fires when Liveness or Identity Verification is included in the flow — not required for Age Verification-only flows.
20506O base64 informado é muito grande. O tamanho máximo suportado é até 800kb.Payload exceeds 800 KB; compress to JPEG92.
20505O base64 informado não é suportado. Os formatos aceitos são png, jpeg e webp.Unsupported format or invalid base64 prefix.
20062The useCase field is invalid.Unrecognized value in the useCase field.
20021The subject.phone field is invalid.subject.phone format is invalid (IDD + area code + number, 13 chars).
20019The subject.birthDate field is invalid.subject.birthDate is outside ISO 8601 format (YYYY-MM-DD).
20009O parâmetro imagebase64 não foi informado.Missing selfie image parameter.
20008The subject.email field is invalid.Invalid email format in subject.email.
20005O parâmetro subject.code não foi informado.Missing subject.code parameter. Only fires when Liveness or Identity Verification is included in the flow — not required for Age Verification-only flows.
20004O parâmetro subject não foi informado.Missing subject object.
20003The request body is missing or invalid.Null or malformed payload.
20002O parâmetro APIKey não foi informado.Missing APIKEY header.
20001O parâmetro authtoken não foi informado.Missing authentication token header.
10508The JWT with the captured face has already been used.JWT can only be consumed once.
10507The JWT with the captured face is expired.JWT exceeds 10-minute validity window.
10506The imageBase64 field is not a valid JWT from SDK.The imageBase64 is not a valid JWT generated by the SDK.

What's next