# Document Audit Trail

The main purpose of this endpoint is to enable the recovery of the activity history for a specific document. The route also provides the possibility of returning it in standard JSON format, or in PDF file format for download.

#### Get Audit Trail

#### <mark style="color:blue;">`GET`</mark> `https://api.zapsign.com.br/api/v1/docs/signer-log/{{doc_token}}?download_pdf=boolean`

#### Headers

<table><thead><tr><th width="158">Name</th><th width="77">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td><p>apiToken written ahead of the "Bearer" text. </p><p>Ex: Bearer c7f35c84-7893-4087-b4fb-d1f06c23</p></td></tr></tbody></table>

#### Path Parameters

<table><thead><tr><th width="156">Name</th><th width="79">Type</th><th>Description</th></tr></thead><tbody><tr><td>doc_token</td><td>string</td><td>Token of the document for which you want to get the activity history</td></tr></tbody></table>

#### Query Parameters

<table><thead><tr><th width="156">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>download_pdf</td><td>boolean</td><td><p>Value that allows you to decide the type of return that the endpoint will return.</p><p></p><p>Ex.:</p><p><code>download_pdf=true</code></p><p>or</p><p><code>download_pdf=false</code></p><p></p><p>If the value is true, the return will be a PDF file with the activity history. In case if it's false or not filled in, a list will be returned, in JSON format, with the values ​​of each activity of the document token sent.<br></p></td></tr></tbody></table>

#### Sucessfull examples

{% tabs %}
{% tab title="Status 200 - JSON Format" %}

```json
[
    {
        "time": "2024-11-27 17:44:32.117577+00:00",
        "user": "jose.da.silva@teste.com.br",
        "event": "Documento visualizado",
        "description": "Documento visualizado por jose.da.silva@teste.com.br"
    },
    {
        "time": "2024-11-27 17:44:34.395952+00:00",
        "user": "jose.da.silva@teste.com.br",
        "event": "Confirmação de leitura",
        "description": "Confirmação de leitura de jose.da.silva@teste.com.br"
    },
    {
        "time": "2024-11-27 17:45:29.398835+00:00",
        "user": "jose.da.silva@teste.com.br",
        "event": "Validação reconhecimento facial",
        "description": "Validação do rosto de jose.da.silva@teste.com.br com a foto do documento de identidade (anexo no relatório de assinaturas)"
    },
    {
        "time": "2024-11-27 17:45:40.904009+00:00",
        "user": "jose.da.silva@teste.com.br",
        "event": "Aceitação do processamento de dados pessoais",
        "description": "jose.da.silva@teste.com.br concordou com o processamento de dados pessoais de acordo com a Política de Privacidade"
    },
    {
        "time": "2024-11-21 05:18:45.733798+00:00",
        "user": "jose.da.silva@teste.com.br",
        "event": "Documento created",
        "description": "O documento foi criado por jose.da.silva@teste.com.br via web"
    }
]
```

{% endtab %}

{% tab title="Status 200 - PDF file" %}
In this way, the endpoint returns a direct download file, in the following model:

<figure><img src="/files/I8OV8aacx1ZNP1oBE1hj" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### Errors examples

{% tabs %}
{% tab title="Status 401 - Unauthorized" %}
For this error, the endpoint returns the value 401 in the StatusCode attribute, indicating that the token sent does not have permission to view the information in this document.

In this case, we suggest that you check whether the token sent in the Headers is correct according to the example already described above.
{% endtab %}

{% tab title="Status 404 - Not Found" %}
In this error, the endpoint returns the StatusCode with a value of 404, indicating that the doc token sent was not found.&#x20;

When this error occurs, we suggest checking whether the token sent in the endpoint url was the correct token.
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

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

```
GET https://docs.zapsign.com.br/english/documentos/document-audit-trail.md?ask=<question>
```

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

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