# Get Process

{% hint style="info" %}
**URL Base**:

* UAT: <mark style="color:blue;">`https://api.cadastro.uat.unico.app`</mark>.
* Production: <mark style="color:blue;">`https://api.cadastro.unico.app`</mark>.
  {% endhint %}

## Get Process Result

> Endpoint to fetch the result of a process on by Unico.

```json
{"openapi":"3.0.0","info":{"title":"GetProcess","version":"1.0.0"},"servers":[{"url":"https://api.cadastro.uat.unico.app"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/client/v1/process/{processId}":{"get":{"summary":"Get Process Result","description":"Endpoint to fetch the result of a process on by Unico.","parameters":[{"name":"processId","in":"path","required":true,"description":"Process ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Process details successfully obtained.","content":{"application/json":{"schema":{"type":"object","properties":{"process":{"type":"object","description":"Process information from by Unico.","properties":{"id":{"type":"string","description":"Process ID."},"flow":{"type":"string","description":"Flow used in the process."},"callbackUri":{"type":"string","description":"Callback URI."},"userRedirectUrl":{"type":"string","description":"User redirect URL."},"state":{"type":"string","enum":["PROCESS_STATE_CREATED","PROCESS_STATE_FAILED","PROCESS_STATE_FINISHED"],"description":"Process state. Possible values: 'PROCESS_STATE_CREATED' - Process created; 'PROCESS_STATE_FINISHED' - Process finished; PROCESS_STATE_FAILED' - Process failed."},"result":{"type":"string","enum":["PROCESS_RESULT_OK","PROCESS_RESULT_ERROR","PROCESS_RESULT_INVALID_IDENTITY","PROCESS_RESULT_UNSPECIFIED","PROCESS_RESULT_EXPIRED"],"description":"Process result. Possible values: 'PROCESS_RESULT_OK' - Process finished successfully; 'PROCESS_RESULT_EXPIRED' - Process expired; 'PROCESS_RESULT_ERROR' - Process finished with error; 'PROCESS_RESULT_INVALID_IDENTITY' - Process finished with Liveness refusal, 'inconclusive' result (in flows with only Identity Verification), prolonged divergence (in flows with risk score) or identity refusal ('negative' return in Identity Verification or 1:1 Validation); 'PROCESS_RESULT_UNSPECIFIED' - Process has not been finished yet."},"createdAt":{"type":"string","description":"Process creation date."},"finishedAt":{"type":"string","description":"Process finish date."},"person":{"type":"object","properties":{"duiType":{"type":"string","description":"Identification document type."},"duiValue":{"type":"string","description":"Identification document value."},"friendlyName":{"type":"string","description":"Person's name."},"notifications":{"type":"array","description":"Notifications information.","items":{"type":"object","properties":{"notificationChannel":{"type":"string","description":"Notification channel."}}}}}},"purpose":{"type":"string","description":"Process purpose."},"authenticationInfo":{"type":"object","description":"Authentication information.","properties":{"authenticationResult":{"type":"string","enum":["AUTHENTICATION_RESULT_UNSPECIFIED","AUTHENTICATION_RESULT_INCONCLUSIVE","AUTHENTICATION_RESULT_POSITIVE","AUTHENTICATION_RESULT_NEGATIVE"],"description":"Identity Verification capacity result. Possible values: 'AUTHENTICATION_RESULT_UNSPECIFIED' - returned if the Identity Verification flow is not used or if there is a failure; 'AUTHENTICATION_RESULT_INCONCLUSIVE' - we cannot precisely confirm if the face belongs to the CPF holder. Only return where orchestration with Risk Score will occur; 'AUTHENTICATION_RESULT_POSITIVE' - the face is the CPF holder's; AUTHENTICATION_RESULT_NEGATIVE - the face is not the CPF holder's."},"authenticationId":{"type":"string","description":"Authentication ID."},"livenessResult":{"type":"string","enum":["LIVENESS_RESULT_UNSPECIFIED","LIVENESS_RESULT_LIVE","LIVENESS_RESULT_NOT_LIVE"],"description":"Liveness capacity result. Possible values: 'LIVENESS_RESULT_UNSPECIFIED' - associated with some failure; 'LIVENESS_RESULT_LIVE' - the user was live at the time of capture; 'LIVENESS_RESULT_NOT_LIVE' - the user was not live at the time of capture."},"bioTokenEngineResult":{"type":"string","enum":["BIO_TOKEN_ENGINE_RESULT_UNSPECIFIED","BIO_TOKEN_ENGINE_RESULT_POSITIVE","BIO_TOKEN_ENGINE_RESULT_NEGATIVE"],"description":"1:1 Validation capacity result. Possible values: 'BIO_TOKEN_ENGINE_RESULT_UNSPECIFIED' - returned if the 1:1 Validation flow is not used or if there is a failure; 'BIO_TOKEN_ENGINE_RESULT_POSITIVE' - the user's face is the same as the reference process; 'BIO_TOKEN_ENGINE_RESULT_NEGATIVE' - the user's face is not the same as the reference process."},"trustResult":{"type":"string","enum":["TRUST_RESULT_UNSPECIFIED"],"description":"Deprecated field."},"identityFraudstersResult":{"type":"string","enum":["TRUST_RESULT_UNSPECIFIED","TRUST_RESULT_INCONCLUSIVE","TRUST_RESULT_YES"],"description":"Behavior Alert capacity result. Possible values: 'TRUST_RESULT_UNSPECIFIED' - returned if the Behavior Alert flow is not used or if there is a failure; 'TRUST_RESULT_INCONCLUSIVE' - we found no indication of fraud with this face; 'TRUST_RESULT_YES' - we found fraud associated with this face."},"faceWithOtherIdResult":{"type":"string","enum":["TRUST_RESULT_UNSPECIFIED"],"description":"Deprecated field."},"frictionlessResult":{"type":"string","enum":["FRICTIONLESS_RESULT_UNSPECIFIED"],"description":"Deprecated field."},"riskLevelResult":{"type":"string","enum":["TRUST_RESULT_UNSPECIFIED"],"description":"Deprecated field."},"smartRevalidationResult":{"type":"string","enum":["SMART_REVALIDATION_RESULT_UNSPECIFIED","SMART_REVALIDATION_RESULT_POSITIVE","SMART_REVALIDATION_RESULT_NEGATIVE"],"description":"Smart Revalidation capacity result. Possible values: 'IDSMART_RESULT_UNSPECIFIED' - returned if the Smart Revalidation flow is not used or if there is a failure; 'IDSMART_RESULT_POSITIVE' - the user is the same as the reference process; 'IDSMART_RESULT_NEGATIVE' - the user is not the same as the reference process."},"idAgeResult":{"type":"string","enum":["ID_AGE_RESULT_UNSPECIFIED","ID_AGE_RESULT_POSITIVE","ID_AGE_RESULT_NEGATIVE","ID_AGE_RESULT_INCONCLUSIVE"],"description":"Result of the age validation. Possible values: 'ID_AGE_RESULT_UNSPECIFIED' - returned if the idAge flow is not used or if there is a failure; 'ID_AGE_RESULT_POSITIVE' - The person has been verified as of legal age (18+); 'ID_AGE_RESULT_NEGATIVE' - The person has been verified as below legal age (under 18); 'ID_AGE_RESULT_INCONCLUSIVE' - The legal age verification could not be performed due to insufficient or conflicting data."},"scoreEngineResult":{"type":"object","description":"Risk Score capacity information.","properties":{"scoreEnabled":{"type":"string","enum":["SCORE_ENABLED_TRUE","SCORE_ENABLED_FALSE"],"description":"Indicates if the score is enabled."},"score":{"type":"number","description":"Risk Score capacity result. A score to be interpreted is only returned when the authenticationResult is AUTHENTICATION_RESULT_INCONCLUSIVE."}}},"serproResult":{"type":"object","description":"Serpro similarity score information. Only returned for flows with idSerpro.","properties":{"score":{"type":"number","description":"Serpro similarity score feature result."}}}}},"capacities":{"type":"array","items":{"type":"string"},"description":"Process capacities."},"services":{"type":"array","description":"Information of the use of documents or electronic signature or idcash.","items":{"type":"object","properties":{"documents":{"type":"array","items":{"type":"object","properties":{"doc":{"type":"object","properties":{"version":{"type":"number","description":"Document version."},"code":{"type":"string","description":"Document code."},"data":{"type":"object","properties":{"dataExpiracao":{"type":"string","description":"Document expiration date."},"dataHabilitacao":{"type":"string","description":"Document qualification date."},"dataNascimento":{"type":"string","description":"Person's birth date."},"nomeCivil":{"type":"string","description":"Person's civil name."},"rgNumero":{"type":"string","description":"RG number."},"categoria":{"type":"string","description":"Category."},"cpfNumero":{"type":"string","description":"CPF number."},"dataEmissao":{"type":"string","description":"Document issue date."},"localEmissao":{"type":"string","description":"Document issue location."},"numero":{"type":"string","description":"Document number."},"renachNumero":{"type":"string","description":"RENACH number."}}}}},"typified":{"type":"boolean","description":"Indicates if the document was typified."},"cpf_match":{"type":"boolean","description":"Indicates if the CPF matches the document."},"face_match":{"type":"boolean","description":"Indicates if the face matches the document."},"doc_id":{"type":"string","description":"Document ID."},"validate_doc":{"type":"boolean","description":"Indicates if the document was validated."},"reused_doc":{"type":"boolean","description":"Indicates if the document was reused."},"signed_url":{"type":"string","description":"Signed URL for the document."}}}},"consent_granted":{"type":"boolean","description":"Indicates if consent was granted."},"envelopeId":{"type":"string","description":"Document envelope ID."},"documentIds":{"type":"array","items":{"type":"string"},"description":"Document IDs."}}}},"expiresAt":{"type":"string","description":"Process expiration date."},"token":{"type":"string","description":"Signed token that contains the necessary parameters to initialize the by Unico web SDK, allowing integration via iFrame."},"companyData":{"type":"object","description":"Company information where the process was created. Refers to the 'companyBranchId' field, used during process creation.","properties":{"branchId":{"type":"string"},"countryCode":{"type":"string"}}},"bioTokenData":{"type":"object","description":"Reference process information for the biometric token.","properties":{"referenceProcessId":{"type":"string"},"authenticationId":{"type":"string"}}},"clientReference":{"type":"string","required":true,"description":"This is an optional identifier that will be used as an indexer in the portal and you can use it as a way to associate (foreign key) between your system and the IDCloud."},"useCase":{"type":"string","required":false,"description":"This is the use case for smart revalidation."}}}}}}}},"400":{"description":"When the process ID is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","description":"Error code."},"message":{"type":"string","description":"Error description."},"details":{}}}}}},"401":{"description":"Access-token error.","content":{"application/json":{"schema":{"type":"string","description":"Error description."}}}},"404":{"description":"When the process could not be found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","description":"Error code."},"message":{"type":"string","description":"Error description."},"details":{}}}}}}}}}}}
```

The content returned in the `process.services.documents.doc.data` parameter, referring to the OCR Extraction technology, can be consulted below:

{% tabs %}
{% tab title="CNH" %}

* Type: CNH
* Content: Brazilian National Driving License
  * String numero;
  * String rgNumero;
  * String cpfNumero;
  * String nomeCivil;
  * List string filiacao;
  * Datetime dataNascimento;
  * Datetime data\_habilitacao;
  * Datetime data\_expiracao;
  * Datetime data\_emissao;
  * String local\_emissao;
  * String categoria;
  * String renachNumero;

```json
"content": {
    "numero": "044589731564",
    "rgNumero": "123456789 SESP PR",
    "nomeCivil": "Homer Simpson",
    "filiacao": [
        "Monasimpson",
        "Monasimpson"
    ],
    "dataNascimento": "1990-05-12T00:00:00Z",
    "dataHabilitacao": "1997-11-18T00:00:00Z",
    "dataExpiracao": "2017-12-07T00:00:00Z",
    "dataEmissao": "2012-12-07T00:00:00Z",
    "localEmissao": "Curitiba PR",
    "categoria": "B",
    "renachNumero": "PR904987581"
}
```

{% endtab %}

{% tab title="RG" %}

* Type: RG
* Content: Brazilian General Registration
  * String numero;
  * String orgao\_emissor;
  * String uf\_emissor;
  * String cpfNumero;
  * String carteira\_profissionalNumero;
  * String certificado\_militarNumero;
  * String cnsNumero;
  * String nis\_pis\_pasepNumero;
  * String ctpsNumero;
  * String ctps\_serie;
  * String ctps\_uf;
  * String titulo\_eleitorNumero;
  * String nomeCivil;
  * String nome\_social;
  * List string filiacao;
  * Datetime dataNascimento;
  * String naturalidade;
  * Datetime data\_emissao;

```json
"content": {
    "dataEmissao": "2012-12-21T02:00:00Z",
    "dataNascimento": "1980-12-19T03:00:00Z",
    "filiacao": [
     "Rosa Coelho Da Costa",
     "Edivaldo Da Costa",
     "Rosa Coelho Da Costa",
     "Edivaldo Da Costa"
    ],
    "naturalidade": "Sao Paulo SP",
    "nomeCivil": "Daniel Coelho Da Costa",
    "numero": "4815162342",
    "orgaoEmissor": "Secretaria Da Segurança Pública (SSP)",
    "ufEmissor": "UF_SP"
}
```

{% endtab %}

{% tab title="CIN" %}

* Type: CIN
* Content: Brazilian national Identity Card
  * string rgNumero;
  * string cpfNumero;
  * string nomeCivil;
  * string nome\_social;
  * List string filiacao;
  * Datetime dataNascimento;
  * Datetime data\_expiracao;
  * Datetime data\_emissao;
  * string orgao\_emissor;
  * string local\_emissao;
  * string naturalidade;
  * string nacionalidade;

```json
"content": {
    "nomeCivil": "Vitor Ra",
    "nomeSocial": "Vitor Ra",
    "filiacao": [
        "Danilo Luis Renan Ramos",
        "Giovanna Vitoria",
        "Danilo Luis Renan Ramos",
        "Giovanna Vitoria"
    ],
    "dataExpiracao": "2034-03-02T00:00:00Z",
    "dataEmissao": "2024-03-02T00:00:00Z",
    "orgaoEmissor": "Detran/Rj",
    "localEmissao": "Rio De Janeiro RJ",
    "naturalidade": "Rio De Janeiro RJ",
    "nacionalidade": "BRA"
}
```

{% endtab %}

{% tab title="Passport" %}

* Type: Passport
* Content: Brazilian Passport
  * string numero;
  * string nome;
  * string sobrenome;
  * string pais\_emissor;
  * string nacionalidade;
  * string naturalidade;
  * Datetime data\_nascimento;
  * Datetime data\_emissao;
  * Datetime data\_expiracao;
  * string autoridade.

```json
"content": {
            "numero": "AA011906",
            "nome": "CHANCHÃO AMARELO",
            "sobrenome": "PASSAREDO",
            "paisEmissor": "BRA",
            "nacionalidade": "BRASILEIRO(A)",
            "naturalidade": "<nil>",
            "dataNascimento": "1920-06-01T00:00:00Z",
            "dataEmissao": "2000-01-01T00:00:00Z",
            "dataExpiracao": "2010-01-01T00:00:00Z",
            "autoridade": "SR/DPF/DF"
        }
```

{% endtab %}

{% tab title="UNKNOWN" %}

* Type: UNKNOWN
* Content: Unknown document.&#x20;

```
content {
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}

* If the response from the result parameter is "`PROCESS_RESULT_INVALID_IDENTITY`" we will not request the steps following the capture of the selfie (documents and/or electronic signature).
* If we are unable to extract a field from the document, it is not listed in the API return.
* The link returned in `signed_url` is valid for 5 minutes. A GET request must be made during the process to refresh the link and extend its validity.
* The document returned in the `signed_url` will always be a single PDF with the documents separated into front and back.
  {% endhint %}

{% hint style="success" %}
**Tips**:

* To implement your business rules, always validate the response from the capabilities by checking the parameters in the following order:
  * `state = PROCESS_STATE_FINISHED` AND `result = PROCESS_RESULT_OK:`
    * THEN, you can proceed with decision-making by analyzing the `authenticationInfo` parameter.
    * If you receive `state = PROCESS_STATE_FINISHED` AND `result = PROCESS_RESULT_ERROR`, interpret this as an error in the biometric process and attempt the process again.
* To improve the performance of your operation, you can use our Webhooks and only query the results of processes that are in the finalized statuses.
  {% endhint %}

### Errors <a href="#duvidas" id="duvidas"></a>

{% tabs %}
{% tab title="400 Bad Request" %}

<table><thead><tr><th width="102">code</th><th width="205">message</th><th align="center">description</th></tr></thead><tbody><tr><td>3</td><td><code>process id is invalid</code></td><td align="center">When the process ID is invalid.</td></tr></tbody></table>
{% endtab %}

{% tab title=" 401 Unauthorized" %}

| message                         | description                                               |
| ------------------------------- | --------------------------------------------------------- |
| `Jwt header is an invalid JSON` | When the access token used contains incorrect characters. |
| `Jwt is expired`                | When the access token used has expired.                   |
| {% endtab %}                    |                                                           |

{% tab title="404 Not Found" %}

<table><thead><tr><th width="120.800048828125">code</th><th>message</th><th>description</th></tr></thead><tbody><tr><td>5</td><td><code>error getting process: rpc error: code = NotFound desc = process not found</code></td><td>When the process ID was not found.</td></tr></tbody></table>
{% endtab %}

{% tab title="429 Too Many Requests " %}
No detailed error code will be provided for this situation, only the HTTP status code.
{% endtab %}

{% tab title="500 Internal Server Error" %}

<table><thead><tr><th width="99">code</th><th width="299">message</th><th>description</th></tr></thead><tbody><tr><td>99999</td><td><code>Internal failure! Try again later</code></td><td>When there is an internal error.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devcenter.unico.io/unico-idcloud/by-unico-integration/by-unico-api/api-reference/get-process.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
