> 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/core-api/transaction-details/services/document-ocr.md).

# Document OCR

Optical Character Recognition - extraction of data from submitted documents.

**Section**: `ocr`

**Required files:** `any document images`

#### Specific attributes (RG)

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

| Attribute              | Type   | Description              |
| ---------------------- | ------ | ------------------------ |
| federativeUnit         | String | State                    |
| rg                     | String | RG                       |
| via                    | String |                          |
| issueDate              | String | Date of Issue            |
| name                   | String | Name                     |
| fatherName             | String | Father's name            |
| motherName             | String | Mother's name            |
| birthPlace             | String | Place of birth           |
| birthDate              | String | Date of birth            |
| referenceDocument      | String | Document Source          |
| cpf                    | String | CPF                      |
| issueState             | String | State of Issue           |
| issuingAuthority       | String | Issuing Agency           |
| rgIssuingAuthority     | String | RG Issuing Agency        |
| rgIssueState           | String | State of RG Issue        |
| department             | String | Department               |
| documentTypeRgFront    | String | Document Type            |
| footerRgBack           | String | Footer RG back           |
| graphicName            | String | Graphic Name             |
| headerRgFront          | String | Header RG front          |
| institute              | String | Institute                |
| issuingAuthorityHeader | String | Issuing Authority Header |
| lawRgBack              | String | Law Rg back              |
| parentsSeparator       | String | ParentsSeparator         |
| {% endtab %}           |        |                          |

{% tab title="Example" %}

```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="Validations Rules" %}

| Rule                                            | Description                                                                                                                                                       |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| is\_readable                                    | Checks that the documents are legible                                                                                                                             |
| is\_cnh                                         | Verifies if the document sent is a CNH                                                                                                                            |
| has\_cpf                                        | Checks whether the transaction has a CPF (read by the OCR or entered manually)                                                                                    |
| cnh\_has\_valid\_date                           | Checks that the expiry date of the CNH is not expired                                                                                                             |
| valid\_issue\_date                              | Checks that the document's issue date is valid.                                                                                                                   |
| valid\_cpf\_number                              | Verifies if the CPF number is valid                                                                                                                               |
| valid\_rg\_number                               | Check that the ID number is valid.                                                                                                                                |
| valid\_cnh\_registration\_number                | Check that the CNH registration number is valid.                                                                                                                  |
| valid\_rg\_issue\_authority                     | Check that the issuing body of the ID card is valid.                                                                                                              |
| valid\_issue\_state                             | Checks that the UF of the body issuing the document is valid.                                                                                                     |
| parameters\_and\_document\_are\_equal           | Checks for discrepancies between the data in the document and that entered manually.                                                                              |
| ocr\_equals\_parameters                         | The rule will be invalid if the information provided in the parameters and read by the OCR are different.                                                         |
| rg\_issue\_less\_than\_25                       | The rule will be invalid if the RG document type was issued more than 25 years ago.                                                                               |
| is\_literate                                    | The rule will be invalid if the OCR identifies that the document belongs to a non-literate person.                                                                |
| rg\_has\_cpf                                    | The rule will be invalid if the RG document type does not have the CPF field filled.                                                                              |
| company\_qsa\_data\_compatibility               | The rule will be invalid if the name and CPF of the partners sent in the PJ onboarding are different from those in the PF onboarding.                             |
| data\_and\_document\_are\_equal                 | The rule will be invalid if there is a discrepancy between the parameter information and the OCR.                                                                 |
| has\_cnh\_for\_more\_than\_three\_years         | The rule will be invalid if the driver has less than 3 years of licensing.                                                                                        |
| has\_definitive\_cnh                            | The rule will be invalid if the driver does not have a permanent license.                                                                                         |
| document\_issue\_less\_than\_10                 | The rule will be invalid if the document was issued more than 10 years ago.                                                                                       |
| issued\_over\_16\_years                         | Checks that the difference between the date of birth and the issue of the ID document is greater than or equal to 16 years.                                       |
| first\_and\_last\_name\_similarity              | Checks the similarity between the union of the first and last name sent in the parameters compared to the union of the first name and each surname in the source. |
| is\_passport                                    | The rule will be invalid if the document is not a passport.                                                                                                       |
| is\_not\_passport                               | The rule will be invalid if the document is a passport.                                                                                                           |
| is\_not\_ctps                                   | The rule will be invalid if the document is not a work permit.                                                                                                    |
| document\_is\_known                             | The rule will be invalid if the document is categorized as "others", "null", or "invalid".                                                                        |
| parameters\_and\_document\_undefined\_or\_equal | Checks for non-existence or divergence between document data and manually entered data.                                                                           |
| invalid\_range\_ages                            | Checks that the CPF holder is within the configured age range.                                                                                                    |
| ocr\_over\_18                                   | Checks that the age on the document is less than 18 years old.                                                                                                    |
| {% endtab %}                                    |                                                                                                                                                                   |
| {% endtabs %}                                   |                                                                                                                                                                   |

#### Specific attributes (CNH)

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

| Attribute              | Type   | Description                         |
| ---------------------- | ------ | ----------------------------------- |
| birthDate              | String | Date of birth                       |
| cpf                    | String | CPF                                 |
| name                   | String | Name                                |
| motherName             | String | Mother's Name                       |
| fatherName             | String | Father's Name                       |
| issueDate              | String | Date of issue                       |
| rg                     | String | RG                                  |
| rgIssueState           | String | RG Issuing State                    |
| rgIssuingAuthority     | String | RG issuing agency                   |
| acc                    | String | Moped Permit                        |
| category               | String | Driver's license category           |
| firstDriverLicenseDate | String | Date of your first driver's license |
| placeOfIssue           | String | Place where CNH was issued          |
| mirrorNumber           | String | CNH mirror number                   |
| registrationNumber     | String | CNH registration number             |
| renachNumber           | String | RENACH number                       |
| securityNumber         | String | Security number                     |
| notes                  | String | Observations                        |
| expirationDate         | String | Expiration date                     |
| cnhIssueState          | String | CNH issue state                     |
| {% endtab %}           |        |                                     |

{% tab title="Example" %}

```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 %}

#### Specific attributes (CRLV)

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

| Attribute              | Type   | Description              |
| ---------------------- | ------ | ------------------------ |
| issueState             | String | Issue state              |
| crlvNumber             | String | CRLV number              |
| via                    | String | Via                      |
| renavamCode            | String | Renavam code             |
| rntrc                  | String | rntrc                    |
| assignmentYear         | String | Assignment year          |
| name                   | String | Name                     |
| cpf                    | String | CPF                      |
| cnpj                   | String | CNPJ                     |
| plate                  | String | Plate                    |
| previousPlateAndState  | String | Previous plate and state |
| chassis                | String | Chassis                  |
| type                   | String | Type                     |
| fuel                   | String | Fuel                     |
| brandAndMovel          | String | Brand and Movel          |
| manufactureYear        | String | Manufacture Year         |
| modelYear              | String | Model year               |
| capacityPowerCylinders | String | Capacity power cylinders |
| category               | String | Category                 |
| predominantColor       | String | PredominantColor         |
| issueDate              | String | Issue date               |
| {% endtab %}           |        |                          |

{% tab title="Example" %}

```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 %}

#### Specific attributes (CTPS)

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

| Attribute         | Type   | Description        |
| ----------------- | ------ | ------------------ |
| pisPasep          | String | Pis Pasep          |
| documentNumber    | String | Document Number    |
| documentSeries    | String | Document Series    |
| federativeUnit    | String | Federative Unit    |
| name              | String | Name               |
| motherName        | String | Mother name        |
| fatherName        | String | Father name        |
| birthDate         | String | Birth date         |
| maritalStatus     | String | Marital Status     |
| referenceDocument | String | Reference Document |
| cpf               | String | CPF                |
| issuePlace        | String | Issue Place        |
| issueDate         | String | Issue Date         |
| {% endtab %}      |        |                    |

{% tab title="Example" %}

```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 %}

#### Specific attributes (RNE)

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

| Attribute        | Type   | Description       |
| ---------------- | ------ | ----------------- |
| birthDate        | String | Birth Date        |
| classification   | String | Classification    |
| entryDate        | String | Entry date        |
| fatherName       | String | Father name       |
| gender           | String | Gender            |
| issueDate        | String | Issue date        |
| issuingAuthority | String | Issuing Authority |
| legalProtection  | String | Legal protection  |
| motherName       | String | Mother name       |
| mrz              | String | MRZ               |
| name             | String | Name              |
| nationality      | String | Nationality       |
| nativeCountry    | String | Native Country    |
| rne              | String | RNE               |
| validity         | String | Validity          |
| via              | String | Via               |
| {% endtab %}     |        |                   |

{% tab title="Example" %}

```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 %}

#### Specific attributes (RNM)

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

| Attribute        | Type   | Description       |
| ---------------- | ------ | ----------------- |
| birthDate        | String | Birth Date        |
| classification   | String | Classification    |
| cpf              | String | CPF               |
| fatherName       | String | Father name       |
| gender           | String | Gender            |
| issueDate        | String | Issue date        |
| issuingAuthority | String | Issuing Authority |
| legalProtection  | String | Legal protection  |
| motherName       | String | Mother name       |
| mrz              | String | MRZ               |
| name             | String | Name              |
| nationality      | String | Nationality       |
| protocol         | String | Protocol          |
| residenceTerm    | String | Resident Term     |
| rnm              | String | RNM               |
| validity         | String | Validity          |
| {% endtab %}     |        |                   |

{% tab title="Example" %}

```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 %}

#### Specific attributes (PASSPORT)

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

| Attribute        | Type   | Description       |
| ---------------- | ------ | ----------------- |
| birthDate        | String | Birth Date        |
| expirationDate   | String | Expiration date   |
| frontNumber      | String | Front number      |
| gender           | String | Gender            |
| issueDate        | String | Issue date        |
| issuingAuthority | String | Issuing authority |
| issuingCountry   | String | Issuing country   |
| motherName       | String | Mother name       |
| mrz              | String | MRZ               |
| name             | String | Name              |
| nationality      | String | Nationality       |
| naturality       | String | Nationality       |
| number           | String | Number            |
| type             | String | Type              |
| {% endtab %}     |        |                   |

{% tab title="Example" %}

```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 %}

#### Specific attributes (NEW CRLV)

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

| Attribute              | Type   | Description              |
| ---------------------- | ------ | ------------------------ |
| assignmentYear         | String | Assignment year          |
| axles                  | String | Axles                    |
| body                   | String | Body                     |
| brandAndModel          | String | Brand and Model          |
| capacityInPeople       | String | Capacity in people       |
| capacityInWeight       | String | Capacity in Weight       |
| capacityPowerCylinders | String | Capacity power cylinders |
| cat                    | String | Cat                      |
| category               | String | Category                 |
| chassis                | String | Chassis                  |
| claSecurityNumber      | String | Cla security number      |
| cmt                    | String | CMT                      |
| cnpj                   | String | CNPJ                     |
| cpf                    | String | CPF                      |
| cpfMask                | String | CPF mask                 |
| crlvNumber             | String | CRLV number              |
| crvNumber              | String | CRV number               |
| fuel                   | String | Fuel                     |
| issueAuthority         | String | Issue authority          |
| issueDate              | String | Issue date               |
| issuePlace             | String | Issue place              |
| issueState             | String | Issue state              |
| manufactureYear        | String | Manufacture Year         |
| modelYear              | String | Model year               |
| motor                  | String | Motor                    |
| name                   | String | Name                     |
| plate                  | String | Plate                    |
| predominantColor       | String | Predominant color        |
| previousPlateAndState  | String | Previous plate and state |
| renavamCode            | String | Renavam code             |
| type                   | String | Type                     |
| vehicleObservations    | String | Vehicle observations     |
| {% endtab %}           |        |                          |

{% tab title="Example" %}

```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 %}

#### Specific attributes (NEW CNH)

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

| Attribute                 | Type   | Description                 |
| ------------------------- | ------ | --------------------------- |
| name                      | String | Name                        |
| firstDriverLicenseDate    | String | First driver license date   |
| birthDate                 | String | Birth date                  |
| birthPlace                | String | Birth place                 |
| birthState                | String | Birth state                 |
| birthDateCityState        | String | Birth date, city and state  |
| issueDate                 | String | Issue date                  |
| expirationDate            | String | Expiration date             |
| acc                       | String | Acc                         |
| definitiveOrPermissionary | String | Definitive or permissionary |
| rg                        | String | RG                          |
| rgMask                    | String | RG mask                     |
| rgIssuingAuthority        | String | RG issuingAuthority         |
| rgIssueState              | String | RG issue state              |
| rgNumberAuthorityState    | String | RG number authority state   |
| cpf                       | String | CPF                         |
| cpfMask                   | String | CPF mask                    |
| registrationNumber        | String | Registration number         |
| category                  | String | Category                    |
| nationality               | String | Nationality                 |
| fatherName                | String | Father name                 |
| motherName                | String | Mother name                 |
| mirrorNumber              | String | Mirror number               |
| notes                     | String | Notes                       |
| placeOfIssue              | String | Place of issue              |
| securityNumber            | String | Security number             |
| renachNumber              | String | Renach number               |
| cnhIssueState             | String | CNH issue state             |
| {% endtab %}              |        |                             |

{% tab title="Example" %}

```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 %}

#### Specific attributes (NEW RG)

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

| Attribute              | Type   | Description              |
| ---------------------- | ------ | ------------------------ |
| birthDate              | String | Birth date               |
| birthPlace             | String | Birth place              |
| cpf                    | String | CPF                      |
| cpfMask                | String | CPF mask                 |
| department             | String | Department               |
| documentTypeRgFront    | String | Document type RG front   |
| expirationDate         | String | Expiration date          |
| fatherName             | String | Father name              |
| federativeUnit         | String | Federative Unit          |
| footerRgBack           | String | Footer RG Back           |
| graphicName            | String | Graphic Name             |
| headerRgFront          | String | Header RG front          |
| institute              | String | Institute                |
| issueDate              | String | Issue date               |
| issueState             | String | Issue state              |
| issuingAuthority       | String | Issuing Authority        |
| issuingAuthorityHeader | String | Issuing Authority Header |
| lawRgBack              | String | Law RG back              |
| motherName             | String | Mother name              |
| name                   | String | Name                     |
| parentsSeparator       | String | Parents separator        |
| referenceDocument      | String | Reference Document       |
| rg                     | String | RG                       |
| rgIssueState           | String | RG issue state           |
| rgIssuingAuthority     | String | RG issue authority       |
| rgMask                 | String | RG mask                  |
| via                    | String | Via                      |
| {% endtab %}           |        |                          |

{% tab title="Example" %}

```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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
