> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-api/caf-api-pt-br/api-core/transaction-details/services/document-ocr.md). Agents can also search and read this documentation through its [MCP server](https://docs.caf.io/~gitbook/mcp).

# OCR de documentos

Reconhecimento Óptico de Caracteres — extração de dados de documentos enviados.

**Seção**: `ocr`

**Arquivos obrigatórios:** `any document images`

#### Atributos específicos (RG)

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

| Atributo               | Tipo   | Descrição                  |
| ---------------------- | ------ | -------------------------- |
| federativeUnit         | String | Estado                     |
| rg                     | String | RG                         |
| via                    | String |                            |
| issueDate              | String | Data de emissão            |
| name                   | String | Nome                       |
| fatherName             | String | Nome do pai                |
| motherName             | String | Nome da mãe                |
| birthPlace             | String | Local de nascimento        |
| birthDate              | String | Data de nascimento         |
| referenceDocument      | String | Origem do documento        |
| CPF                    | String | CPF                        |
| issueState             | String | Estado de emissão          |
| issuingAuthority       | String | Órgão emissor              |
| rgIssuingAuthority     | String | Órgão emissor do RG        |
| rgIssueState           | String | Estado de emissão do RG    |
| department             | String | Departamento               |
| documentTypeRgFront    | String | Tipo de documento          |
| footerRgBack           | String | Rodapé do verso do RG      |
| graphicName            | String | Nome do gráfico            |
| headerRgFront          | String | Cabeçalho da frente do RG  |
| institute              | String | Instituto                  |
| issuingAuthorityHeader | String | Cabeçalho do órgão emissor |
| lawRgBack              | String | Lei no verso do RG         |
| parentsSeparator       | String | Separador dos pais         |
| {% endtab %}           |        |                            |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "federativeUnit": "ESTADO DA BAHIA",
    "rg": "00.000.000-00",
    "via": "",
    "issueDate": "13/04/2015",
    "name": "JANE DOE",
    "fatherName": "JOHN DOE",
    "motherName": "MARIA DOE",
    "birthPlace": "JAGUAQUARA BA",
    "birthDate": "25/02/1952",
    "referenceDocument": "C.NAS. CM JAGUAQUARA BA",
    "cpf": "00000000000",
    "issueState": "BA",
    "issuingAuthority": "SSP",
    "rgIssuingAuthority": "SSP",
    "rgIssueState": "BA",
    "department": "SPTC / DEPARTAMENTO DE IDENTIFICACAO",
    "documentTypeRgFront": "CARTEIRA DE IDENTIDADE",
    "footerRgBack": "",
    "graphicName": "THOMAS GREG & SONS",
    "headerRgFront": "REPUBLICA FEDERATIVA DO BRASIL",
    "institute": "POLICIA CIVIL",
    "issuingAuthorityHeader": "SECRETARIA DE ESTADO DE SEGURANCA PUBLICA",
    "lawRgBack": "LEI NO 7.116 DE 29/08/83",
    "parentsSeparator": "E"
  }
}
```

{% endtab %}

{% tab title="Regras de validação" %}

| Regra                                           | Descrição                                                                                                                                          |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| is\_readable                                    | Verifica se os documentos estão legíveis                                                                                                           |
| is\_cnh                                         | Verifica se o documento enviado é uma CNH                                                                                                          |
| has\_cpf                                        | Verifica se a transação tem um CPF (lido pelo OCR ou inserido manualmente)                                                                         |
| cnh\_has\_valid\_date                           | Verifica se a data de validade da CNH não expirou                                                                                                  |
| valid\_issue\_date                              | Verifica se a data de emissão do documento é válida.                                                                                               |
| valid\_cpf\_number                              | Verifica se o número do CPF é válido                                                                                                               |
| valid\_rg\_number                               | Verifica se o número do documento de identidade é válido.                                                                                          |
| valid\_cnh\_registration\_number                | Verifica se o número de registro da CNH é válido.                                                                                                  |
| valid\_rg\_issue\_authority                     | Verifica se o órgão emissor da carteira de identidade é válido.                                                                                    |
| valid\_issue\_state                             | Verifica se a UF do órgão emissor do documento é válida.                                                                                           |
| parameters\_and\_document\_are\_equal           | Verifica se há divergências entre os dados do documento e os inseridos manualmente.                                                                |
| ocr\_equals\_parameters                         | A regra será inválida se as informações fornecidas nos parâmetros forem diferentes das lidas pelo OCR.                                             |
| rg\_issue\_less\_than\_25                       | A regra será inválida se o documento de identidade tiver sido emitido há mais de 25 anos.                                                          |
| is\_literate                                    | A regra será inválida se o OCR identificar que o documento pertence a uma pessoa não alfabetizada.                                                 |
| rg\_has\_cpf                                    | A regra será inválida se o documento de identidade não tiver o campo do CPF preenchido.                                                            |
| company\_qsa\_data\_compatibility               | A regra será inválida se o nome e o CPF dos sócios enviados no onboarding de PJ forem diferentes dos informados no onboarding de PF.               |
| data\_and\_document\_are\_equal                 | A regra será inválida se houver divergência entre as informações dos parâmetros e as do OCR.                                                       |
| has\_cnh\_for\_more\_than\_three\_years         | A regra será inválida se o motorista tiver menos de 3 anos de habilitação.                                                                         |
| has\_definitive\_cnh                            | A regra será inválida se o motorista não tiver uma habilitação definitiva.                                                                         |
| document\_issue\_less\_than\_10                 | A regra será inválida se o documento tiver sido emitido há mais de 10 anos.                                                                        |
| issued\_over\_16\_years                         | Verifica se o intervalo entre a data de nascimento e a data de emissão do documento de identidade é maior ou igual a 16 anos.                      |
| first\_and\_last\_name\_similarity              | Verifica a similaridade entre a união do primeiro e do último nome enviados nos parâmetros e a união do primeiro nome com cada sobrenome na fonte. |
| is\_passport                                    | A regra será inválida se o documento não for um passaporte.                                                                                        |
| is\_not\_passport                               | A regra será inválida se o documento for um passaporte.                                                                                            |
| is\_not\_ctps                                   | A regra será inválida se o documento não for uma carteira de trabalho.                                                                             |
| document\_is\_known                             | A regra será inválida se o documento for categorizado como "outros", "nulo" ou "inválido".                                                         |
| parameters\_and\_document\_undefined\_or\_equal | Verifica se os dados do documento e os informados manualmente são inexistentes ou divergentes.                                                     |
| invalid\_range\_ages                            | Verifica se a idade do titular do CPF está dentro da faixa etária configurada.                                                                     |
| ocr\_over\_18                                   | Verifica se a idade indicada no documento é inferior a 18 anos.                                                                                    |
| {% endtab %}                                    |                                                                                                                                                    |
| {% endtabs %}                                   |                                                                                                                                                    |

#### Atributos específicos (CNH)

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

| Atributo               | Tipo   | Descrição                    |
| ---------------------- | ------ | ---------------------------- |
| birthDate              | String | Data de nascimento           |
| CPF                    | String | CPF                          |
| name                   | String | Nome                         |
| motherName             | String | Nome da mãe                  |
| fatherName             | String | Nome do pai                  |
| issueDate              | String | Data de emissão              |
| rg                     | String | RG                           |
| rgIssueState           | String | Estado emissor do RG         |
| rgIssuingAuthority     | String | Órgão emissor do RG          |
| acc                    | String | Permissão para ciclomotor    |
| category               | String | Categoria da CNH             |
| firstDriverLicenseDate | String | Data da primeira habilitação |
| placeOfIssue           | String | Local de emissão da CNH      |
| mirrorNumber           | String | Número do espelho da CNH     |
| registrationNumber     | String | Número de registro da CNH    |
| renachNumber           | String | Número do RENACH             |
| securityNumber         | String | Número de segurança          |
| notes                  | String | Observações                  |
| expirationDate         | String | Data de validade             |
| cnhIssueState          | String | Estado emissor da CNH        |
| {% endtab %}           |        |                              |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "name": "JANE DOE",
    "rg": "00XXXXXXX99",
    "rgIssuingAuthority": "SSP",
    "rgIssueState": "RS",
    "cpf": "00000000000",
    "birthDate": "08/05/1999",
    "fatherName": "JOHN DOE",
    "motherName": "MARIA DOE",
    "acc": "",
    "category": "AB",
    "registrationNumber": "06XXXXXXX02",
    "expirationDate": "07/05/2032",
    "firstDriverLicenseDate": "26/07/2017",
    "mirrorNumber": "23XXXXXX51",
    "notes": "",
    "placeOfIssue": "PORTO ALEGRE, RS",
    "issueDate": "07/05/2022",
    "securityNumber": "02XXXXXXX60",
    "renachNumber": "RSXXXXXX070",
    "cnhIssueState": "RS"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (CRLV)

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

| Atributo               | Tipo   | Descrição                        |
| ---------------------- | ------ | -------------------------------- |
| issueState             | String | Estado emissor                   |
| crlvNumber             | String | Número do CRLV                   |
| via                    | String | Via                              |
| renavamCode            | String | Código Renavam                   |
| rntrc                  | String | rntrc                            |
| assignmentYear         | String | Ano de atribuição                |
| name                   | String | Nome                             |
| CPF                    | String | CPF                              |
| cnpj                   | String | CNPJ                             |
| plate                  | String | Placa                            |
| previousPlateAndState  | String | Placa e estado anteriores        |
| chassi                 | String | Chassi                           |
| type                   | String | Tipo                             |
| combustível            | String | Combustível                      |
| brandAndMovel          | String | Marca e modelo                   |
| manufactureYear        | String | Ano de fabricação                |
| modelYear              | String | Ano do modelo                    |
| capacityPowerCylinders | String | Capacidade, potência e cilindros |
| category               | String | Categoria                        |
| predominantColor       | String | Cor predominante                 |
| issueDate              | String | Data de emissão                  |
| {% endtab %}           |        |                                  |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "issueState": "SC",
    "crlvNumber": "00000000000000",
    "via": "",
    "renavamCode": "00000000000",
    "rntrc": "",
    "assignmentYear": "2017",
    "name": "CAF",
    "cpf": "",
    "cnpj": "0000000000000000",
    "plate": "00000",
    "previousPlateAndState": "000000",
    "chassis": "000000000000000000000000",
    "type": "PAS/AUTOMOVEL",
    "fuel": "",
    "brandAndModel": "VW/VOYAGE CL MB",
    "manufactureYear": "2014",
    "modelYear": "2015",
    "capacityPowerCylinders": "5P/104CV",
    "category": "ALCO/GASOL OFICIAL",
    "predominantColor": "PRATA",
    "issueDate": "20/07/2017"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (CTPS)

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

| Atributo          | Tipo   | Descrição               |
| ----------------- | ------ | ----------------------- |
| pisPasep          | String | PIS/PASEP               |
| documentNumber    | String | Número do documento     |
| documentSeries    | String | Série do documento      |
| federativeUnit    | String | Unidade federativa      |
| name              | String | Nome                    |
| motherName        | String | Nome da mãe             |
| fatherName        | String | Nome do pai             |
| birthDate         | String | Data de nascimento      |
| maritalStatus     | String | Estado civil            |
| referenceDocument | String | Documento de referência |
| CPF               | String | CPF                     |
| issuePlace        | String | Local de emissão        |
| issueDate         | String | Data de emissão         |
| {% endtab %}      |        |                         |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "pisPasep": "0000000000000",
    "documentNumber": "00000000",
    "documentSeries": "0000",
    "federativeUnit": "MG",
    "name": "JANE DOE",
    "motherName": "JOHN DOE",
    "fatherName": "MARIA DOE",
    "birthDate": "02/08/1979",
    "maritalStatus": "SOLTEIRO",
    "birthPlace": "BELO HORIZONTE - MG",
    "referenceDocument": "C. I. MG 000000 19/11/2004 PC MG",
    "cpf": "00000000000000",
    "issuePlace": "SRTE/MG -",
    "issueDate": "18/05/2015"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (RNE)

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

| Atributo         | Tipo   | Descrição           |
| ---------------- | ------ | ------------------- |
| birthDate        | String | Data de nascimento  |
| classification   | String | Classificação       |
| entryDate        | String | Data de entrada     |
| fatherName       | String | Nome do pai         |
| gender           | String | Gênero              |
| issueDate        | String | Data de emissão     |
| issuingAuthority | String | Autoridade emissora |
| legalProtection  | String | Proteção legal      |
| motherName       | String | Nome da mãe         |
| mrz              | String | MRZ                 |
| name             | String | Nome                |
| nationality      | String | Nacionalidade       |
| nativeCountry    | String | País de origem      |
| rne              | String | RNE                 |
| validity         | String | Validade            |
| via              | String | Via                 |
| {% endtab %}     |        |                     |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "birthDate": "01/11/1988",
    "classification": "PERMANENTE",
    "entryDate": "31/08/2011",
    "fatherName": "JOHN DOE",
    "gender": "M",
    "issueDate": "17/11/2017",
    "issuingAuthority": "CGPI/DIREX/DPF",
    "legalProtection": "",
    "motherName": "MARIE DOE",
    "mrz": "",
    "name": "JAMES DEE",
    "nationality": "ANGOLANA",
    "nativeCountry": "ANGOLA",
    "rne": "0000000",
    "validity": "06/11/2026",
    "via": "1"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (RNM)

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

| Atributo         | Tipo   | Descrição           |
| ---------------- | ------ | ------------------- |
| birthDate        | String | Data de nascimento  |
| classification   | String | Classificação       |
| CPF              | String | CPF                 |
| fatherName       | String | Nome do pai         |
| gender           | String | Gênero              |
| issueDate        | String | Data de emissão     |
| issuingAuthority | String | Autoridade emissora |
| legalProtection  | String | Proteção legal      |
| motherName       | String | Nome da mãe         |
| mrz              | String | MRZ                 |
| name             | String | Nome                |
| nationality      | String | Nacionalidade       |
| protocol         | String | Protocolo           |
| residenceTerm    | String | Prazo de residência |
| rnm              | String | RNM                 |
| validity         | String | Validade            |
| {% endtab %}     |        |                     |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "birthDate": "30/05/1989",
    "classification": "TEMPORARIO",
    "cpf": "0000000000",
    "fatherName": "MARIE DEE",
    "gender": "M",
    "issueDate": "22/01/2019",
    "issuingAuthority": "CGPI/DIREX/PF",
    "legalProtection": "ART. 14. I. LETRA C DA LEI 13.445/2017.",
    "motherName": "ROSEMOND DEE",
    "mrz": "<<<<<<<<< 000 <<<<<<<<<< 0 000",
    "name": "JEAN DEE",
    "nationality": "HAITI",
    "protocol": "",
    "residenceTerm": "22/10/2020",
    "rnm": "000000000",
    "validity": "22/10/2020"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (PASSAPORTE)

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

| Atributo         | Tipo   | Descrição           |
| ---------------- | ------ | ------------------- |
| birthDate        | String | Data de nascimento  |
| expirationDate   | String | Data de validade    |
| frontNumber      | String | Número da frente    |
| gender           | String | Gênero              |
| issueDate        | String | Data de emissão     |
| issuingAuthority | String | Autoridade emissora |
| issuingCountry   | String | País emissor        |
| motherName       | String | Nome da mãe         |
| mrz              | String | MRZ                 |
| name             | String | Nome                |
| nationality      | String | Nacionalidade       |
| naturality       | String | Nacionalidade       |
| number           | String | Número              |
| type             | String | Tipo                |
| {% endtab %}     |        |                     |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "birthDate": "23/07/1982",
    "expirationDate": "05/06/2027",
    "fatherName": "JOSE DEE",
    "front_number": "000000",
    "gender": "M",
    "issueDate": "06/06/2017",
    "issuingAuthority": "DPF/CAS/SP",
    "issuingCountry": "BRA",
    "motherName": "MARIA DEE",
    "mrz": "0<000<000<000 << 000<000 <<<<<<<<<<<<<< 00000<000000 <<<<<<<<<<<<<< 00",
    "name": "JOSE DEE JUNIOR",
    "nationality": "BRASILEIRO(A)",
    "naturality": "MARILIA/SP",
    "number": "00000",
    "type": "P"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (NOVO CRLV)

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

| Atributo               | Tipo   | Descrição                        |
| ---------------------- | ------ | -------------------------------- |
| assignmentYear         | String | Ano de atribuição                |
| axles                  | String | Eixos                            |
| body                   | String | Carroceria                       |
| brandAndModel          | String | Marca e modelo                   |
| capacityInPeople       | String | Capacidade de passageiros        |
| capacityInWeight       | String | Capacidade em peso               |
| capacityPowerCylinders | String | Capacidade, potência e cilindros |
| cat                    | String | Categoria                        |
| category               | String | Categoria                        |
| chassi                 | String | Chassi                           |
| claSecurityNumber      | String | Número de segurança CLA          |
| cmt                    | String | CMT                              |
| cnpj                   | String | CNPJ                             |
| CPF                    | String | CPF                              |
| cpfMask                | String | Máscara do CPF                   |
| crlvNumber             | String | Número do CRLV                   |
| crvNumber              | String | Número do CRV                    |
| combustível            | String | Combustível                      |
| issueAuthority         | String | Órgão emissor                    |
| issueDate              | String | Data de emissão                  |
| issuePlace             | String | Local de emissão                 |
| issueState             | String | Estado emissor                   |
| manufactureYear        | String | Ano de fabricação                |
| modelYear              | String | Ano do modelo                    |
| motor                  | String | Motor                            |
| name                   | String | Nome                             |
| plate                  | String | Placa                            |
| predominantColor       | String | Cor predominante                 |
| previousPlateAndState  | String | Placa e estado anteriores        |
| renavamCode            | String | Código Renavam                   |
| type                   | String | Tipo                             |
| vehicleObservations    | String | Observações do veículo           |
| {% endtab %}           |        |                                  |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "assignmentYear": "",
    "axles": "3",
    "body": "NAO APLICAVEL CARROCERIA ABERTA",
    "brandAndModel": "SR/RANDON SR CA",
    "capacityInPeople": "00P",
    "capacityInWeight": "26.0",
    "capacityPowerCylinders": "0CV/****",
    "cat": "",
    "category": "BRANCA",
    "chassis": "00000000000000",
    "claSecurityNumber": "",
    "cmt": "*.*",
    "cnpj": "00000000000000",
    "cpf": "",
    "cpfMask": "",
    "crlvNumber": "",
    "crvNumber": "",
    "fuel": "",
    "issueAuthority": "DETRAN-GO",
    "issueDate": "06/04/2020",
    "issuePlace": "RIO VERDE GO",
    "issueState": "GO",
    "manufactureYear": "",
    "modelYear": "",
    "motor": "0000000000000",
    "name": "CAF",
    "plate": "",
    "predominantColor": "",
    "previousPlateAndState": "00000/MT",
    "renavamCode": "",
    "type": "SEMI-REBOQUE",
    "vehicleObservations": ""
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (NOVA CNH)

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

| Atributo                  | Tipo   | Descrição                                     |
| ------------------------- | ------ | --------------------------------------------- |
| name                      | String | Nome                                          |
| firstDriverLicenseDate    | String | Data da primeira habilitação                  |
| birthDate                 | String | Data de nascimento                            |
| birthPlace                | String | Local de nascimento                           |
| birthState                | String | Estado de nascimento                          |
| birthDateCityState        | String | Data, cidade e estado de nascimento           |
| issueDate                 | String | Data de emissão                               |
| expirationDate            | String | Data de validade                              |
| acc                       | String | Acc                                           |
| definitiveOrPermissionary | String | Definitiva ou permissão                       |
| rg                        | String | RG                                            |
| rgMask                    | String | Máscara do RG                                 |
| rgIssuingAuthority        | String | Autoridade emissora do RG                     |
| rgIssueState              | String | Estado de emissão do RG                       |
| rgNumberAuthorityState    | String | Estado da autoridade emissora do número do RG |
| CPF                       | String | CPF                                           |
| cpfMask                   | String | Máscara do CPF                                |
| registrationNumber        | String | Número de registro                            |
| category                  | String | Categoria                                     |
| nationality               | String | Nacionalidade                                 |
| fatherName                | String | Nome do pai                                   |
| motherName                | String | Nome da mãe                                   |
| mirrorNumber              | String | Número espelho                                |
| notes                     | String | Observações                                   |
| placeOfIssue              | String | Local de emissão                              |
| securityNumber            | String | Número de segurança                           |
| renachNumber              | String | Número Renach                                 |
| cnhIssueState             | String | Estado emissor da CNH                         |
| {% endtab %}              |        |                                               |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "name": "EDIO DEE",
    "firstDriverLicenseDate": "24/04/1985",
    "birthDate": "27/09/1966",
    "birthPlace": "BLUMENAU",
    "birthState": "SC",
    "birthDateCityState": "27/09/1966 BLUMENAU/SC",
    "issueDate": "30/06/2022",
    "expirationDate": "09/06/2027",
    "acc": "",
    "definitiveOrPermissionary": "D",
    "rg": "00000000",
    "rgMask": "9999999",
    "rgIssuingAuthority": "SSP",
    "rgIssueState": "SC",
    "rgNumberAuthorityState": "000000 SSP SC",
    "cpf": "00000000000",
    "cpfMask": "999.999.999-99",
    "registrationNumber": "0000000000000",
    "category": "AB",
    "nationality": "BRASILEIRO",
    "fatherName": "WALTER DEE",
    "motherName": "INGELORE DEE",
    "mirrorNumber": "000000000000000",
    "notes": "",
    "placeOfIssue": "FLORIANOPOLIS, SC",
    "securityNumber": "000000000000",
    "renachNumber": "SC00000000",
    "cnhIssueState": "SC"
  }
}
```

{% endtab %}
{% endtabs %}

#### Atributos específicos (NOVO RG)

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

| Atributo               | Tipo   | Descrição                       |
| ---------------------- | ------ | ------------------------------- |
| birthDate              | String | Data de nascimento              |
| birthPlace             | String | Local de nascimento             |
| CPF                    | String | CPF                             |
| cpfMask                | String | Máscara do CPF                  |
| department             | String | Departamento                    |
| documentTypeRgFront    | String | Tipo de documento: frente do RG |
| expirationDate         | String | Data de validade                |
| fatherName             | String | Nome do pai                     |
| federativeUnit         | String | Unidade federativa              |
| footerRgBack           | String | Rodapé do verso do RG           |
| graphicName            | String | Nome do gráfico                 |
| headerRgFront          | String | Cabeçalho da frente do RG       |
| institute              | String | Instituto                       |
| issueDate              | String | Data de emissão                 |
| issueState             | String | Estado emissor                  |
| issuingAuthority       | String | Autoridade emissora             |
| issuingAuthorityHeader | String | Cabeçalho do órgão emissor      |
| lawRgBack              | String | Lei no verso do RG              |
| motherName             | String | Nome da mãe                     |
| name                   | String | Nome                            |
| parentsSeparator       | String | Separador dos pais              |
| referenceDocument      | String | Documento de referência         |
| rg                     | String | RG                              |
| rgIssueState           | String | Estado de emissão do RG         |
| rgIssuingAuthority     | String | Autoridade emissora do RG       |
| rgMask                 | String | Máscara do RG                   |
| via                    | String | Via                             |
| {% endtab %}           |        |                                 |

{% tab title="Exemplo" %}

```json
{
  "ocr": {
    "birthDate": "27/07/1978",
    "birthPlace": "GUARULHOS - SP",
    "cpf": "00000000000",
    "cpfMask": "999999999/99",
    "department": "",
    "documentTypeRgFront": "CARTEIRA DE IDENTIDADE",
    "expirationDate": "01/01/2030",
    "fatherName": "JOHN DEE",
    "federativeUnit": "ESTADO DE SAO PAULO",
    "footerRgBack": "VAL",
    "graphicName": "VALI5",
    "headerRgFront": "REPUBLICA FEDERATIVA DO BRASIL",
    "institute": "INSTITUTO DE IDENTIFICACAO 'RICARDO GUMBLETON DAUNT'",
    "issueDate": "06/01/2020",
    "issueState": "SP",
    "issuingAuthority": "SSP-SP",
    "issuingAuthorityHeader": "SIPA SECRETARIA DA SEGURANCA PUBLICA",
    "lawRgBack": "LEINO 7.116, DE 29 DE AGOSTO DE 1983",
    "motherName": "MARIA DEE",
    "name": "REIS DEE",
    "parentsSeparator": "",
    "referenceDocument": "GUARULHOS - SP 1.SUBDISTRITO CC:LV.0000/0000 /N.00000",
    "rg": "0000000000",
    "rgIssueState": "SP",
    "rgIssuingAuthority": "SSP-SP",
    "rgMask": "99.999.999-9",
    "via": "2 via"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.caf.io/caf-api/caf-api-pt-br/api-core/transaction-details/services/document-ocr.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
