> 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/connect/transactions/services/global-doc-verification.md).

# Global Document Verification

Global Document Verification service processes identity documents, extracting information and performing checks such as image quality, document type, data integrity, document validity, and authenticity points, to ensure truthfulness and quality.

**Section**: `globalDocVerification`

**Required parameter:** `files (any document images)`

## Fields and rules

Check out the examples, rules, and attributes for the service to function.

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

| Attribute                                                                     | Type              | Description                                                                                                                                 |
| ----------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| data                                                                          | object            | Object containing the main data.                                                                                                            |
| data.documentCategory                                                         | string            | Document category.                                                                                                                          |
| data.documentType                                                             | string            | Document type and version.                                                                                                                  |
| data.documentNumber                                                           | string            | Document number.                                                                                                                            |
| data.name                                                                     | string            | Holder's full name.                                                                                                                         |
| data.sex                                                                      | string            | Holder's sex.                                                                                                                               |
| data.birthDate                                                                | string            | Holder's birth date.                                                                                                                        |
| data.birthPlace                                                               | string            | Holder's place of birth.                                                                                                                    |
| data.nationality                                                              | string            | Holder's nationality.                                                                                                                       |
| data.nationalityCode                                                          | string            | Holder's nationality code.                                                                                                                  |
| data.address                                                                  | string            | Holder's complete address.                                                                                                                  |
| data.issueState                                                               | string            | Document issuing state or country.                                                                                                          |
| data.issueStateCode                                                           | string            | Issuing state/country code (ISO 3166-1 alpha-3).                                                                                            |
| data.authority                                                                | string            | Document issuing authority.                                                                                                                 |
| data.issueDate                                                                | string            | Document issue date.                                                                                                                        |
| data.expirationDate                                                           | string            | Document expiration date.                                                                                                                   |
| data.validations.overallStatus                                                | [Status](#status) | Overall validations status.                                                                                                                 |
| data.validations.authenticityCheck                                            | object            | Document authenticity checks.                                                                                                               |
| data.validations.authenticityCheck.status                                     | [Status](#status) | Overall authenticity check status.                                                                                                          |
| data.validations.authenticityCheck.*{documentSide}*                           | object            | Results of authenticity checks performed on each document side. *{documentSide}* can be `front` or `back`.                                  |
| data.validations.authenticityCheck.*{documentSide}*.result                    | [Status](#status) | Overall authenticity check status for the corresponding image.                                                                              |
| data.validations.authenticityCheck.*{documentSide}*.imagePattern.result       | [Status](#status) | Status of the presence/absence verification of image patterns.                                                                              |
| data.validations.authenticityCheck.*{documentSide}*.photoEmbedType.result     | [Status](#status) | Status of the embedded photo verification.                                                                                                  |
| data.validations.authenticityCheck.*{documentSide}*.barcodeFormatCheck.result | [Status](#status) | Status of the barcode format verification.                                                                                                  |
| data.validations.documentType                                                 | object            | Document type checks .                                                                                                                      |
| data.validations.documentType.validityStatus                                  | [Status](#status) | Document type check status.                                                                                                                 |
| data.validations.textFieldsCheck                                              | object            | Document text fields checks.                                                                                                                |
| data.validations.textFieldsCheck.status                                       | [Status](#status) | Overall text fields check status (cross-comparison of different sources, dates and check digits verification).                              |
| data.validations.textFieldsCheck.mrz                                          | [Status](#status) | MRZ integrity verification status.                                                                                                          |
| data.validations.textFieldsCheck.documentExpiry.result                        | [Status](#status) | Document expiry verification status.                                                                                                        |
| data.validations.imageQualityCheck                                            | object            | Image quality checks.                                                                                                                       |
| data.validations.imageQualityCheck.status                                     | [Status](#status) | Overall image quality verification status.                                                                                                  |
| data.validations.imageQualityCheck.*{documentSide}*                           | object            | Results of image quality checks performed on each document side. *{documentSide}* can be `front` or `back`.                                 |
| data.validations.imageQualityCheck.*{documentSide}*.result                    | [Status](#status) | Overall image quality check status for the corresponding image.                                                                             |
| data.validations.imageQualityCheck.*{documentSide}*.imageColorness            | [Status](#status) | Indicates if the image is colorless.                                                                                                        |
| data.validations.imageQualityCheck.*{documentSide}*.imageFocus                | [Status](#status) | Indicates whether the image is in focus.                                                                                                    |
| data.validations.imageQualityCheck.*{documentSide}*.bounds                    | [Status](#status) | Indicates if the document is not fully present in the image.                                                                                |
| data.validations.imageQualityCheck.*{documentSide}*.imageGlares               | [Status](#status) | Indicates the presence of glare on the image.                                                                                               |
| data.validations.imageQualityCheck.*{documentSide}*.perspective               | [Status](#status) | Indicates if the document in the image has perspective distortion above threshold.                                                          |
| data.validations.imageQualityCheck.*{documentSide}*.portrait                  | [Status](#status) | Indicates if the portrait is present.                                                                                                       |
| data.validations.imageQualityCheck.*{documentSide}*.imageResolution           | [Status](#status) | Indicates if the image resolution is below the threshold.                                                                                   |
| statusCode                                                                    | string            | Refers to the status of this specific query, not the entire transaction. [Check our status guide](/caf-api/core-api/transaction-details.md) |
| {% endtab %}                                                                  |                   |                                                                                                                                             |

{% tab title="Example" %}

```json
{
    "data": {
        "documentCategory": "DRIVER_LICENSE",
        "documentType": "United Kingdom - Driver License (2021) #1",
        "documentNumber": "XXXXXXXXXXXXXXXX",
        "name": "JANE DOE",
        "sex": "F",
        "birthDate": "11/05/1993",
        "birthPlace": "UNITED KINGDOM",
        "nationality": "UNITED KINGDOM",
        "nationalityCode": "GBR",
        "address": "14 Meadow Lane, Nottingham, NGX XHQ",
        "issueState": "UNITED KINGDOM",
        "issueStateCode": "GBR",
        "authority": "DVLA",
        "issueDate": "01/04/2022",
        "expirationDate": "01/04/2032",
        "validations": {
            "overallStatus": 1,
            "authenticityCheck": {
                "status": 1,
                "back": {
                    "result": 1,
                    "imagePattern": {
                        "result": 1,
                    }
                },
                "front": {
                    "result": 1,
                    "imagePattern": {
                        "result": 1,
                    },
                    "photoEmbedType": {
                        "result": 1,
                    }
                }
            },
            "documentType": {
                "validityStatus": 1
            },
            "textFieldsCheck": {
                "status": 1,
                "mrz": 2,
                "documentExpiry": {
                    "result": 1,
                }
            },
            "imageQualityCheck": {
                "status": 1,
                "back": {
                    "result": 1,
                    "imageColorness": 2,
                    "imageFocus": 1,
                    "screenCapture": 2,
                    "bounds": 1,
                    "imageGlares": 1,
                    "perspective": 1,
                    "portrait": 2,
                    "imageResolution": 1
                },
                "front": {
                    "result": 1,
                    "imageColorness": 2,
                    "imageFocus": 1,
                    "screenCapture": 2,
                    "bounds": 1,
                    "imageGlares": 0,
                    "perspective": 1,
                    "portrait": 1,
                    "imageResolution": 1
                }
            }
        }
    },
    "statusCode": "01"
}
```

{% endtab %}

{% tab title="Validations Rules" %}

| Rule                           | Description                                                         |
| ------------------------------ | ------------------------------------------------------------------- |
| Validate document fields       | Indicates whether all fields extracted from the document are valid. |
| Validate document authenticity | Indicates whether all verified authenticity points are valid.       |
| {% endtab %}                   |                                                                     |
| {% endtabs %}                  |                                                                     |

{% hint style="info" %}
The date format used is `dd/MM/yyyy`.

* dd = two-digit day
* MM = two-digit month
* yyyy = four-digit year
  {% endhint %}

{% hint style="info" %}
Returned and undocumented fields are for internal use only.
{% endhint %}

## Status

When the document verification service is used, some statuses regarding what was analyzed may be returned:

| Value | Description                                     |
| ----- | ----------------------------------------------- |
| 0     | Check was performed and result is **negative**. |
| 1     | Check was performed and result is **positive**. |
| 2     | Check was **not performed**.                    |


---

# 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/connect/transactions/services/global-doc-verification.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.
