> 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/zapsign-api/espanol/validacion-de-firmas.md).

# Validación de firmas

Ideal para automatizar la verificación de documentos y garantizar que estén completos e inalterados.

ZapSign ofrece un endpoint que valida si un archivo PDF fue firmado correctamente y se mantiene íntegro, asegurando conformidad con los estándares de seguridad y validez jurídica.

Este endpoint permite validar la integridad de firmas digitales en un archivo PDF. La validación confirma si:

* El PDF contiene una o más firmas digitales;
* Todas las firmas fueron emitidas por ZapSign;
* Las firmas son criptográficamente válidas;
* El documento no fue alterado después de la firma;
* No hay firmas pendientes o rechazadas.

{% hint style="warning" %}
En caso de documento inválido, el endpoint devuelve un mensaje con la razón por la cual fue invalidado.
{% endhint %}

***

### Cómo usar

<mark style="color:yellow;">`POST`</mark>`https://api.zapsign.com.br/api/v1/validate-pdf-signature/`

Envíe una solicitud con el método POST en formato `multipart/form-data` conteniendo el archivo PDF en el campo `file`.

**Headers**

| Clave        | Valor               |
| ------------ | ------------------- |
| Content-Type | multipart/form-data |

**Request Body (form-data)**

| Clave | Tipo          | Descripción                |
| ----- | ------------- | -------------------------- |
| file  | archivo (PDF) | Archivo PDF a ser validado |

<figure><img src="https://1265384129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5FrVBe47d9qwlLisqx07%2Fuploads%2FWFPN2ndqDEd1WO2kDYFZ%2Fvalidar%20doc1.gif?alt=media&amp;token=436af144-f664-4d36-8462-03bce22c411b" alt=""><figcaption><p>Llamando al endpoint vía Postman</p></figcaption></figure>

### Ejemplo de respuesta

{% 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": "11/19/2024 14:34:58",
    "commonName": "ZAPSIGN PROCESSAMENTO DE DADOS LTDA"
}
```

{% endtab %}

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

```
{
    "isValid": false,
    "message": "Signature Signature1 does not cover the whole document",
    "authority": "N/A",
    "signingDate": "N/A",
    "commonName": "N/A"
}
```

{% endtab %}

{% tab title="400-error" %}
{\
"error": "Nenhum arquivo foi enviado."\
}
{% endtab %}
{% endtabs %}

### Posibles mensajes en caso de documento inválido

| Mensaje                                                                                        | Descripción                                                                             |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `Signature signature1 does not cover the whole document`                                       | La firma no cubre todo el documento                                                     |
| `Certificate validation failed: CN is not ZAPSIGN PROCESSAMENTO DE DADOS LTDA`                 | El documento contiene una o más firmas que no fueron realizadas por ZapSign             |
| `Signature signature1 not valid because the document contains pending signature indicators`    | El documento es inválido porque contiene indicadores de firmas pendientes               |
| `Signature signature1 is not valid because the document contains refused signature indicators` | El documento es inválido porque contiene indicadores de firmas rechazadas               |
| `Document does not contain digital signatures`                                                 | El documento no está firmado                                                            |
| `Signature signature1 is not cryptographically valid`                                          | El documento contiene una firma inválida o fue modificado después de haber sido firmado |

***

### ¡Habla con Gepeto!

¿Tienes alguna duda? Utiliza nuestra inteligencia artificial entrenada con toda la documentación de la 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/zapsign-api/espanol/validacion-de-firmas.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.
