ID Verification (Document Front/Back)
ID Verification
ID Verification (Document Front/Back)
Verify identity document (front and optional back), extract MRZ and data, get Approved or Declined in a single API call β in the gu1 KYC API for identity.
POST
ID Verification (Document Front/Back)
Documentation Index
Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ID Verification is a Gu1 verification service that validates an identity document by sending the front image (required) and optionally the back image (for two-sided documents such as national IDs). The API returns Approved or Declined, plus extracted data (name, document number, date of birth, address, MRZ, etc.) and optional warnings. No hosted session is involvedβyou send the images and get the result in one call.When to use which
- Session-based KYC (
POST /api/kyc/validations): Full flow with hosted URL, live selfie, liveness, and document capture. Best for onboarding and regulated flows. - Face Match (
POST /api/kyc/face-match): Compare two images (document portrait + selfie) to verify they are the same person; returns match + score. - ID Verification (
POST /api/kyc/id-verification): Send document front (and optional back); get document validation, extracted data (MRZ, name, address, etc.), and Approved/Declined. Best when you already have document images and need extraction + validation only.
Prerequisites
Before using ID Verification:- ID Verification integration enabled: Your organization must have the ID Verification KYC integration activated (e.g. in Marketplace / Integrations).
- Credentials configured: The API key for the ID Verification integration must be set in your organizationβs KYC settings (configured by the Gu1 administrator). Only the API key is required (no webhook secret for this endpoint).
ID Verification is a Gu1 service. All verification is performed by Gu1 infrastructure.
Request
Endpoint
Content-Type
Onlymultipart/form-data is accepted. You can send images in either of two ways (or mix):
- As file parts: attach image/files to the form fields
documentFrontand (optional)documentBack. - As base64 strings: send the same field names with base64-encoded image strings (with or without
data:image/...;base64,prefix).
Headers
Content-Type manually when using FormData; the client will set it with the correct boundary.
If your account uses organization scoping, include:
Form Fields
Front image of the identity document. Send as a file part (recommended) or as a string (base64, with or without
data:image/...;base64, prefix). Formats: JPEG, PNG, WebP, TIFF, PDF. Max 5MB.Back image of the document (optional; required for two-sided documents such as national IDs). Same as
documentFront: file part or base64 string.Optional UUID of the person entity to associate with this check. Used for audit and for listing verifications by entity.
Optional reference (e.g. your user ID) for tracking. Stored with the audit record.
When
true, after document verification is approved, runs RENAPER data check (DNI + gender + trΓ‘mite from OCR vs renaper/data). Requires org RENAPER credentials. Query overrides body.Same as query param
doubleCheckRenaper.Whether to perform document liveness (detect screen/copy). Default
false. Send as string "true" or "false" in form.Minimum age (1β120); users below are Declined. Optional. Send as string in form.
"NO_ACTION" or "DECLINE" when expiration date is not detected. Optional."NO_ACTION" or "DECLINE" when MRZ is invalid or unreadable. Optional."NO_ACTION" or "DECLINE" when visual zone data does not match MRZ. Optional.Response
Success Response (200 OK)
| Field | Type | Description |
|---|---|---|
status | string | "approved" | "declined". |
verificationId | string (optional) | ID of the audit record in id_verification_verifications (for support and listing). |
requestId | string (optional) | Internal request ID (for support). |
extractedData | object (optional) | Normalized OCR and verification metadata from the Gu1 ID Verification service, persisted in audit. See extractedData fields below. |
warnings | string[] (optional) | Array of risk codes from the verification (e.g. DOCUMENT_EXPIRED, POSSIBLE_DUPLICATED_USER). Use for display or i18n. See Warning risk codes for all possible values. |
debugProviderResponse | object (optional) | Non-production only (Gu1 API NODE_ENV=development). Sanitized full verification response for debugging (image/base64 redacted). Do not rely on this in production integrations. |
doubleCheckRenaper | boolean (optional) | true when RENAPER double-check was requested. |
responseDoubleChecks | object (optional) | When doubleCheckRenaper=true: renaper with data/trΓ‘mite result. See KYC validations RENAPER. |
status becomes "declined" and RENAPER codes are added to warnings.
extractedData fields
The following fields are returned inextractedData and stored on id_verification_verifications.extracted_data (list/get audit endpoints). Empty fields are omitted.
Identity and document (common):
| Field | Type | Description |
|---|---|---|
providerStatus | string | Document verification status detail (e.g. Approved, Declined). Top-level status is normalized to approved / declined. |
fullName, firstName, lastName | string | Name from OCR. |
firstSurname, secondSurname | string | When returned in supplementary fields (e.g. some LATAM IDs). |
documentNumber, personalNumber | string | Document number and personal/national ID number when present. |
documentType | string | e.g. Driver's License, National ID. |
taxNumber | string | Tax ID when present (e.g. CPF in supplementary extraction). |
dateOfBirth, age | string / number | Date of birth and computed age. |
expirationDate, dateOfIssue, firstIssueDate | string | Document dates (ISO YYYY-MM-DD when provided). |
nationality, gender | string | ISO country code and gender code when present. |
placeOfBirth, maritalStatus | string | When returned by OCR. |
address, formattedAddress | string | Address lines when present. |
issuingState, issuingStateName | string | Issuing jurisdiction (e.g. BRA, Brazil). |
| Field | Type | Description |
|---|---|---|
extraFields | object | Document keys not promoted to top-level fields (e.g. license category, regional codes). Extension bucket for future OCR keys. |
warningMeta | object | Metadata from warnings, e.g. duplicatedSessionId, duplicatedSessionNumber, duplicatedApiService when POSSIBLE_DUPLICATED_USER is returned. |
frontImageQualityScore, backImageQualityScore | object | OCR quality scores (focus, brightness, overall, etc.) when available. |
mrz | object | Parsed MRZ fields when non-empty. |
parsedAddress | object | Structured address when returned. |
barcodes | array | Barcode reads when returned. |
Promoted fields vs. extension bucket
- Common keys (
taxNumber,firstSurname,secondSurname,firstIssueDate, etc.) are promoted to the top level ofextractedDatawhen OCR returns them. - Any other document keys stay in
extractedData.extraFields(same object on POST and audit list/get).
Not included in API responses or audit JSON
- Temporary external image URLs from the verification pipeline β use stored document images (
document-front-image/document-back-image) for images Gu1 saved from your upload. - Full raw verification response body (not exposed in production APIs).
Example Request
Error Responses
Common error codes:| Code | HTTP | Meaning |
|---|---|---|
NOT_CONFIGURED | 403 | ID Verification credentials (API key) not set in organization KYC settings. |
NOT_ENABLED | 403 | ID Verification integration is not enabled for this organization. |
INVALID_REQUEST | 400 | Content-Type not multipart/form-data, or missing/invalid document front (no file and no base64, or format/size). |
FORBIDDEN | 403 | Verification could not be completed (e.g. credits). |
VERIFICATION_FAILED | 500 | Verification could not be completed; retry or try another document. |
Audit and Listing Verifications
Every ID Verification request (success or failure) is stored inid_verification_verifications for audit and compliance. The response includes verificationId (the audit record ID) when persistence succeeds. All endpoints below are part of the Gu1 API.
Get a Single Verification
id β UUID of the verification (from the POST response verificationId or from the list).
Response (200): Same shape as one item in the list: id, organizationId, entityId, status, requestId, vendorData, errorMessage, warnings, extractedData, createdAt, documentFrontStoragePath, documentBackStoragePath, storageProvider, etc.404 if not found or not in your organization.
List Audit Records
| Parameter | Type | Description |
|---|---|---|
entityId | string (UUID) | Optional. Filter by person entity. |
withoutEntity | boolean | If true, only returns verifications with no associated entity (e.g. for the KYC page βID Verification without entityβ tab). |
status | string | Optional. Filter by status (approved, declined, failed). |
limit | number | Max items (default 50, max 100). |
offset | number | Pagination offset. |
{ "verifications": [ ... ], "pagination": { "limit", "offset", "total" } }. Each verification includes id, entityId, status, requestId, extractedData, warnings, errorMessage, createdAt, and storage paths when images were stored.
Get Stored Document Images
If the verification has stored images (documentFrontStoragePath / documentBackStoragePath), you can stream them with:
id β UUID of the verification. Response: Image bytes (e.g. Content-Type: image/jpeg). 404 if the verification does not exist or that side was not stored.
Coexistence with Other KYC Flows
- Session flow creates a
kyc_validationsrecord and uses a hosted URL; the stored decision can include document, liveness, and face match from the live session. - Face Match compares document portrait + selfie and returns match + score; audit in
face_match_verifications. - ID Verification validates the document (front/back), extracts data, and returns Approved/Declined; audit in
id_verification_verifications. It does not create akyc_validationsrecord. Use it when you need document-only validation and extraction without a hosted session.
Next Steps
Face Match (Document + Selfie)
Compare document photo and selfie
Create KYC Validation
Session-based verification with hosted URL