> For the complete documentation index, see [llms.txt](https://docs.zapsign.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zapsign.com.br/documentos/validacao-de-assinaturas.md).

# Validação de assinaturas

Ideal para automatizar a checagem de documentos e garantir que estejam completos e inalterados.

A ZapSign disponibiliza um endpoint que valida se um PDF foi corretamente assinado e mantido íntegro, assegurando conformidade com padrões de segurança e validade jurídica.&#x20;

\
Este endpoint permite validar a integridade de assinaturas digitais em um arquivo PDF. A validação confirma se:<br>

* O PDF contém uma ou mais assinaturas digitais;
* Todas as assinaturas foram emitidas pela ZapSign;
* As assinaturas são criptograficamente válidas;
* O documento não foi alterado após a assinatura;
* Não há assinaturas pendentes ou recusadas.

{% hint style="warning" %}
Em caso de documento inválido, o endpoint retorna uma mensagem com a razão pela qual foi invalidado.
{% endhint %}

***

### Como utilizar:

\
Envie uma requisição com o método `POST`  em formato `multipart/form-data`  contendo o arquivo PDF no campo `file` .\
\ <mark style="color:yellow;">`POST`</mark>`https://api.zapsign.com.br/api/v1/validate-pdf-signature`

#### Headers

| Name         | Type                | Description |
| ------------ | ------------------- | ----------- |
| Content-Type | multipart/form-data |             |

#### Request Body (form-data)

| Name | Type          | Description                |
| ---- | ------------- | -------------------------- |
| file | arquivo (PDF) | Arquivo PDF a ser validado |

<figure><img src="https://3085168645-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4noMoX5ZGb2-RhWjjf-887967055%2Fuploads%2Fzv8v1EO8kblvbyVrHniy%2Fvalidar%20doc1.gif?alt=media&amp;token=8465771a-dabd-4806-bd35-9267f8b61dda" alt=""><figcaption><p>Chamando o endpoint via Postman</p></figcaption></figure>

***

### Exemplo de Resposta

{% tabs %}
{% tab title="200- Documento Válido" %}

```
{
    "isValid": true,
    "message": "Document signed correctly (CN=ZAPSIGN) and without subsequent notes.",
    "authority": "AC Certisign Multipla G7",
    "signingDate": "05/20/2025 20:56:55",
    "commonName": "ZAPSIGN PROCESSAMENTO DE DADOS LTDA"
}
```

{% endtab %}

{% tab title="200-Documento inválido" %}

```json
{
    "isValid": false,
    "message": "Untracked exception: Incorrect file header",
    "authority": "N/A",
    "signingDate": "N/A",
    "commonName": "N/A"
}
```

{% endtab %}

{% tab title="Erro 400" %}

```
{
    "error": "Nenhum arquivo foi enviado."
}
```

{% endtab %}
{% endtabs %}

***

### Possíveis mensagens em caso de documento inválido

| Mensagem                                                                                       | Descrição                                                                              |
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| Signature `signature1` does not cover the whole document                                       | A assinatura não cobre o documento inteiro                                             |
| Certificate validation failed: CN is not ZAPSIGN PROCESSAMENTO DE DADOS LTDA                   | O documento contém uma ou mais assinaturas que não foram realizadas pela ZapSign       |
| Signature `signature1` not valid because the document contains pending signature indicators    | O documento é inválido porque contém indicadores de que existem assinaturas pendentes  |
| Signature `signature1` is not valid because the document contains refused signature indicators | O documento é inválido porque contem indicadores de que existem assinaturas recusadas  |
| Document does not contain digital signatures                                                   | O documento não está assinado                                                          |
| Signature `signature1` is not cryptographically valid                                          | O documento contém uma assinatura inválida ou foi alterado depois de ter sido assinado |

***

#### Converse com o Gepeto! <a href="#converse-com-o-gepeto" id="converse-com-o-gepeto"></a>

Tem alguma duvida? Utilize nossa inteligência artificial treinada com toda a documentação da API

{% embed url="<https://n8n.zapsign.com.br/webhook/fee2c476-7f23-4a4f-8928-5c7ab081ffcd/chat>" %}


---

# 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.zapsign.com.br/documentos/validacao-de-assinaturas.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.
