---
title: Create Document Process
description: Capture a new document or reuse a previously captured one linked to a biometric process.
canonical: https://developer.unico.io/dual-api/developers/api-reference/api/post-processes-document
locale: en
generated_by: markdown-export
---

- [/](/)
- [API Reference](/dual-api/developers/api-reference/)
- [API](/dual-api/developers/api-reference/api/)
- Create Document Process

**On this page# Create Document Process

This endpoint handles two document flows that share the same path but differ in body parameters:

**New capture** — submits document image(s) in base64 for processing (`document.files` required).
**Reuse** — skips capture by referencing a previously captured document (`document.documentId` required).

The active flow is determined by whether `document.documentId` is provided in the request body.
Before creating a document process, use [Get Reusable Documents](/dual-api/developers/api-reference/api/get-document) to check if the user already has a document available for reuse.
For the full integration flow, see [API Overview](/dual-api/developers/api-reference/api/).
### Endpoint​

EnvironmentURL**Production**`POST https://api.id.unico.app/processes/v1`**Sandbox**`POST https://api.id.uat.unico.app/processes/v1`
### Request​

Headers
HeaderValue`Authorization``Bearer <access_token>` (see [Authentication](/dual-api/developers/api-reference/authentication))`APIKEY`Provisioned API key with Document Capture and Reuse enabled.`Content-Type``application/json`
Body parameters
New captureReuseFieldTypeRequiredDescription`subject.duiType`integeryesDocument type identifier. See [`duiType` values](#duitype-values) below.`subject.code`stringyesUser identifier value as defined by `subject.duiType`. No dots or dashes.`subject.name`stringnoFull name.`subject.gender`stringno`M` or `F`.`subject.birthDate`string (ISO 8601)noDate of birth (`YYYY-MM-DD`).`subject.email`stringnoEmail address.`subject.phone`stringnoE.164 phone number.`document.purpose`stringyesBusiness purpose. Values: `creditprocess`, `carpurchase`, `paybypaycheck`, `onboarding`, `fgts`.`document.authProcessId`stringyesID of the biometric process linked to this document capture.`document.files`arrayyesDocument images in base64 (front and/or back).`document.files[].data`stringyesDocument image in base64 (PNG, JPEG or WebP, max 800 KB).`subsidiaryId`stringnoBranch ID — required only if multiple branches exist.FieldTypeRequiredDescription`subject.duiType`integeryesDocument type identifier. See [`duiType` values](#duitype-values) below.`subject.code`stringyesUser identifier value as defined by `subject.duiType`. No dots or dashes.`subject.name`stringnoFull name.`subject.gender`stringno`M` or `F`.`subject.birthDate`string (ISO 8601)noDate of birth (`YYYY-MM-DD`).`subject.email`stringnoEmail address.`subject.phone`stringnoE.164 phone number.`document.purpose`stringyesBusiness purpose. Values: `creditprocess`, `carpurchase`, `paybypaycheck`, `onboarding`, `fgts`.`document.authProcessId`stringyesID of the biometric process linked to this document.`document.documentId`stringyesID of a previously captured document (obtained from [Get Reusable Documents](/dual-api/developers/api-reference/api/get-document)). When provided, `document.files` can be omitted.`subsidiaryId`stringnoBranch ID — required only if multiple branches exist.
**`duiType` values**CountryCodeDescriptionAR6Argentine PassportAR7Argentine DNIAR49Argentine Driving Licence (Licencia Nacional de Conducir)AT34Austrian Tax Number (STNR)BE36Belgian National Number (NN)BR1Brazilian CPFBR5Brazilian PassportBR14Brazilian CNPJCA28Canadian SINCH33Swiss AHV/AVS NumberCL9Chilean RUNCL52Chilean PassportCL57Chilean Driving Licence (Licencia de Conducir)CO26Colombian NITCO53Colombian PassportCO55Colombian Driving Licence (Licencia de Conducción)CO56Colombian Citizenship Card (Cédula de Ciudadanía)DE41German Tax Identification Number (IdNr)DK29Danish CPREC10Ecuadorian NIES50Spanish Foreigner Identity Number (NIE)ES51Spanish National Identity Document (DNI)FI35Finnish Personal Identity Code (HETU)FR46French Tax Reference Number (SPI)GB30British National Insurance Number (NINO)GT12Guatemalan CUIID16Indonesian NIKIE47Irish Personal Public Service Number (PPSN)IT37Italian Codice Fiscale (CF)LU48Luxembourg National Identification Number (Matricule)MX2Mexican CURPMX25Mexican RFC (Persona Física)MX58Mexican Driving Licence (Licencia de Conducir)NG8Nigerian NINNG20Nigerian Bank Verification Number (BVN)NG43Nigerian BVN Token (hashed)NG44Nigerian NIN Token (hashed)NL42Dutch Citizen Service Number (BSN)NO39Norwegian National Identity Number (Fødselsnummer)PE27Peruvian RUCPE40Peruvian DNIPE54Peruvian PassportPL31Polish PESELPT45Portuguese Tax Identification Number (NIF)SE32Swedish Personal Number (PNR)SE38Swedish Coordination Number (Samordningsnummer)TR24Turkish Identification Number (TCKN)US4United States SSNUS11United States PassportUS18United States Driver's LicenseUS21United States Passport CardUS22United States Polycarbonate PassportUS23United States ID CardUY13Uruguayan CIZZ15Email addressZZ17Phone number—0Unspecified—3Internal Unico identifier
### Example​

New capture — cURLNew capture — Node.jsReuse — cURLReuse — Node.js```
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": {      "duiType": 1,      "code": "12345678909",      "name": "Luke Skywalker"    },    "document": {      "purpose": "onboarding",      "authProcessId": "80371b2a-3ac7-432e-866d-57fe37896ac6",      "files": [        { "data": "/9j/4AAQSkZJR..." }      ]    }  }'
```

```
import fetch from 'node-fetch';const res = await fetch('https://api.id.unico.app/processes/v1', {  method: 'POST',  headers: {    'Authorization': `Bearer ${process.env.UNICO_ACCESS_TOKEN}`,    'APIKEY': process.env.UNICO_API_KEY,    'Content-Type': 'application/json'  },  body: JSON.stringify({    subject: {      duiType: 1,      code: '12345678909',      name: 'Luke Skywalker'    },    document: {      purpose: 'onboarding',      authProcessId: '80371b2a-3ac7-432e-866d-57fe37896ac6',      files: [{ data: documentImageBase64 }]    }  })});const result = await res.json();
```

```
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": {      "duiType": 1,      "code": "12345678909"    },    "document": {      "purpose": "onboarding",      "authProcessId": "80371b2a-3ac7-432e-866d-57fe37896ac6",      "documentId": "doc-abc-123"    }  }'
```

```
import fetch from 'node-fetch';const res = await fetch('https://api.id.unico.app/processes/v1', {  method: 'POST',  headers: {    'Authorization': `Bearer ${process.env.UNICO_ACCESS_TOKEN}`,    'APIKEY': process.env.UNICO_API_KEY,    'Content-Type': 'application/json'  },  body: JSON.stringify({    subject: {      duiType: 1,      code: '12345678909'    },    document: {      purpose: 'onboarding',      authProcessId: '80371b2a-3ac7-432e-866d-57fe37896ac6',      documentId: 'doc-abc-123'    }  })});const result = await res.json();
```

### Responses​

200 OK
```
{  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",  "status": 3,  "document": {    "id": "doc-abc-123",    "type": "unico.moja.dictionary.br.cnh.v2.Cnh",    "cpfMatch": true,    "faceMatch": true,    "content": {      "numero": "12345678",      "nomeCivil": "Luke Skywalker",      "dataNascimento": "2000-05-20T00:00:00Z",      "categoria": "B",      "dataExpiracao": "2030-05-20T00:00:00Z"    },    "fileUrls": [      "https://storage.unico.app/documents/doc-abc-123/front.jpg"    ]  }}
```

FieldTypeDescription`id`string (UUID)Process identifier.`status`integer`3` (finished with success), `5` (finished with failure).`document.id`stringCaptured document identifier. Use this value in future `document.documentId` requests for reuse.`document.type`stringIdentified document type, as a fully qualified dictionary name. See [`document.type` values](#document-type-values) below.`document.cpfMatch`boolean`true` if the identifier extracted from the document matches `subject.code`.`document.faceMatch`boolean`true` if the document face matches the biometric selfie from `document.authProcessId`.`document.content`objectFields extracted via OCR. Structure varies by document type — [click here for field details](/assets/files/document-content-fields-0e4663f2ade946e901bbc7523c21f032.json).`document.fileUrls`arrayTemporary URLs (10-minute validity) for downloading the document images.
Only fields successfully extracted are present in `document.content`; anything the OCR could not read is omitted rather than returned empty.
**`document.type` values**Unified schemaAll document types that use the unified schema — `unified_schema` in the [field reference](/assets/files/document-content-fields-0e4663f2ade946e901bbc7523c21f032.json) — are reported in `document.type` as `unico.moja.dictionary.<country>.generic.v1.<DocumentType>`, where `<country>` is the lowercase ISO 3166-1 alpha-2 code and `<DocumentType>` the identified type. For instance:
`unico.moja.dictionary.ar.generic.v1.IdCard`: Argentinian ID card
`unico.moja.dictionary.us.generic.v1.PolycarbonatePassport`: U.S. polycarbonate passport
Specific schemasDocument types that use their own field schema — listed under `specific_document_schemas` in the [field reference](/assets/files/document-content-fields-0e4663f2ade946e901bbc7523c21f032.json) — are shown in the table below:CountryValueDocumentBR`unico.moja.dictionary.br.rg.v2.Rg`RGBR`unico.moja.dictionary.br.cnh.v2.Cnh`CNH (driver's license)BR`unico.moja.dictionary.br.cin.v1.Cin`CINBR`unico.moja.dictionary.br.passaporte.v1.Passaporte`PassportMX`unico.moja.dictionary.mx.ine.v1.Ine`INE voter credentialMX`unico.moja.dictionary.mx.lpc.v1.Lpc`Licencia para conducir (driver's license)MX`unico.moja.dictionary.mx.pasaporte.v1.Pasaporte`Passport—`unico.moja.dictionary.other.unknown.v1.Unknown`Type could not be identified — `document.content` is emptyNo OCR extraction is performed and no field is reported when `document.type` is `unico.moja.dictionary.other.unknown.v1.Unknown`.
### Error Codes​

400 Bad Request403 Forbidden409 Conflict500 Internal Server ErrorCodeMessageDescription`99989`The document is invalid.`document` object has an invalid structure.`99988`The document is empty.`document` object is missing from the request body.`20900`O base64 informado não é válido.The base64 parameter is invalid. Possible causes: it's not an image or it's an injection attempt.`20807`A imagem precisa estar no padrão HD ou possuir uma resolução superior a 640 x 480.The resolution of the uploaded image is too low.`20509`The subject.name field is invalid.`subject.name` contains invalid characters.`20508`The subject.gender field is invalid.`subject.gender` must be `M` or `F`.`20507`O parâmetro subject.code é inválido.Non-standard or non-existent identifier value.`20506`O base64 informado é muito grande. O tamanho máximo suportado é até 800kb.Image size exceeds 800 KB; compress to JPEG92.`20505`O base64 informado não é suportado. Os formatos aceitos são png, jpeg e webp.The base64 format is invalid or unsupported.`20068`The document.documentId or document.files parameter must be present.Neither `document.documentId` nor `document.files` were provided.`20067`The document.purpose parameter is invalid.Unrecognized value in `document.purpose`.`20066`The document.authProcessId parameter is invalid.Invalid value in `document.authProcessId`.`20062`The useCase field is invalid.Unrecognized value in the `useCase` field.`20021`The subject.phone field is invalid.`subject.phone` format is invalid (IDD + area code + number, 13 chars).`20019`The subject.birthDate field is invalid.`subject.birthDate` is outside ISO 8601 format (`YYYY-MM-DD`).`20009`O parâmetro imagebase64 não foi informado.The document image parameter is missing.`20008`The subject.email field is invalid.Invalid email format in `subject.email`.`20005`O parâmetro subject.code não foi informado.The subject.code parameter is missing.`20004`O parâmetro subject não foi informado.The subject parameter is missing.`20003`The request body is missing or invalid.Null or invalid payload.`20002`O parâmetro APIKey não foi informado.The APIKEY parameter is missing from the request header.`20001`O parâmetro authtoken não foi informado.The integration token parameter is missing from the request header.`10508`The JWT with the captured face has already been used.The JWT can only be used once.`10507`The JWT with the captured face is expired.JWT expired; must be sent within 10 minutes.`10506`The imageBase64 field is not a valid JWT from SDK.The `imageBase64` is not a valid JWT generated by the SDK.Bearer token or `APIKEY` missing, expired, or invalid. See [Authentication](/dual-api/developers/api-reference/authentication).CodeMessageDescription`30017`User does not have permission to perform this action.Malformed JWT or user without permission to perform this operation.`10502`O token informado está expirado.The access-token has expired.`10501`O token informado é inválido.The authentication token is invalid.`10201`O AppKey informado é inválido.The APIKEY is invalid or does not exist.CodeMessageDescription`20073`The processID already exists.The `processId` provided already exists for this tenant.CodeMessageDescription`99999`Internal failure! Try again laterWhen there is an internal error.
### What's next​

To check if a document is already available before this call, see [Get Reusable Documents](/dual-api/developers/api-reference/api/get-document).
For biometric process creation (required for `document.authProcessId`), see [Create Process](/dual-api/developers/api-reference/api/post-processes).
Last updated on Oct 8, 2026**