> 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-liveness.md).

# Document Liveness

This is a service that checks whether the photo on the document is a black and white photocopy, a color photocopy or a screenshot.

{% hint style="info" %}
This is a AI service integrated with CAF, and we are continuously improving its accuracy. Currently, the accuracy may be lower for less common documents, such as passports, RNE, functional documents, and others. The service is more effective at identifying documents like RG and CNH. Remember that the result provided is a probability that the document is a screen photo or a photocopy, not a final decision.
{% endhint %}

{% hint style="warning" %}
If the `decision` attribute is **false** and the confidence level (`confidence`) is **LOW**, the rule will be approved. Make sure to carefully review these cases, as a low confidence level may indicate uncertainty in the provided result.
{% endhint %}

**Section**: `documentLiveness`

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

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

| Attribute                         | Type    | Description                                                                                                                                                                                                                                    |
| --------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| statusCode                        | String  | Query status ([details](/caf-api/core-api/transaction-details/background-check/data-structure.md#status-code))                                                                                                                                 |
| data                              | Object  | Return data                                                                                                                                                                                                                                    |
| data.message                      | String  | Return message                                                                                                                                                                                                                                 |
| data.front                        | Object  | Object containing the image result description (front of document)                                                                                                                                                                             |
| data.front.decision               | Boolean | Decision result for the front of the document                                                                                                                                                                                                  |
| data.front.confidence             | String  | Confidence level for the front decision (e.g., **"LOW"**, **"MEDIUM"**, **"HIGH"**)                                                                                                                                                            |
| data.front.indicators             | Array   | Array of indicators for the front of the document                                                                                                                                                                                              |
| data.front.indicators\[x]         | Object  | Indicator object at index x                                                                                                                                                                                                                    |
| data.front.indicators\[x].id      | String  | Indicator ID for the front of the document (e.g., "real\_doc", **"screen\_photo\_doc"**, **"grayscale\_copy\_doc"**, **"colored\_copy\_doc"**)                                                                                                 |
| data.front.indicators\[x].message | String  | Message associated with the indicator for the front (e.g., **"The document is probably real"**, **"The document is probably a colored copy"**, **"The document is probably a grayscale copy"**, **"The document is probably a screen photo"**) |
| data.back                         | Object  | Object containing the image result description (back of document)                                                                                                                                                                              |
| data.back.decision                | Boolean | Decision result for the back of the document                                                                                                                                                                                                   |
| data.back.confidence              | String  | Confidence level for the back decision (e.g., **"LOW"**, **"MEDIUM"**, **"HIGH"**)                                                                                                                                                             |
| data.back.indicators              | Array   | Array of indicators for the back of the document                                                                                                                                                                                               |
| data.back.indicators\[x]          | Object  | Indicator object at index x                                                                                                                                                                                                                    |
| data.back.indicators\[x].id       | String  | Indicator ID for the back of the document (e.g., **"real\_doc"**, **"screen\_photo\_doc"**, **"grayscale\_copy\_doc"**, **"colored\_copy\_doc"**)                                                                                              |
| data.back.indicators\[x].message  | String  | Message associated with the indicator for the back (e.g., **"The document is probably real"**, **"The document is probably a colored copy"**, **"The document is probably a grayscale copy"**, **"The document is probably a screen photo"**)  |
| {% endtab %}                      |         |                                                                                                                                                                                                                                                |

{% tab title="Example" %}

```json
{
  "documentLiveness": {
    "statusCode": "01",
    "data": {
      "front": {
        "decision": true,
        "confidence": "MEDIUM",
        "indicators": [
          {
            "message": "The document is probably real.",
            "id": "real_doc"
          }
        ]
      },
      "back": {
        "decision": true,
        "confidence": "HIGH",
        "indicators": [
          {
            "message": "The document is probably real.",
            "id": "real_doc"
          }
        ]
      }
    }
  }
}
```

{% endtab %}

{% tab title="Validations Rules" %}

| Rule                                         | Description                                                                                                                                                                                                                                                                |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| is\_document\_liveness\_screen\_photo\_doc   | This rule checks whether the document provided is a screen photo, which could indicate an attempt at fraud. If the document is identified as a screen photo, the rule will be considered invalid, indicating that the document is not authentic.                           |
| is\_document\_liveness\_colored\_copy\_doc   | This rule checks whether the document provided is a color photocopy, which could indicate an attempt at fraud. If the document is identified as a color photocopy, the rule will be considered invalid, indicating that the document is not authentic.                     |
| is\_document\_liveness\_grayscale\_copy\_doc | This rule checks whether the document provided is a black and white photocopy, which could indicate an attempt at fraud. If the document is identified as a black and white photocopy, the rule will be considered invalid, indicating that the document is not authentic. |
| {% 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-liveness.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.
