> 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/documentos/cancelar-documentos.md).

# Cancelar documentos

Este endpoint permite cancelar/rechazar un documento en curso para interrumpir el proceso de firma

**Observaciones**

* **Permisos:** Puede ser usado por administradores, propietarios o grupos con acceso.
* **Estado final:** El documento queda con estado **"rechazado"** y no puede ser firmado nuevamente.
* **Marca de agua:** Se añade la marca de agua **"Documento rechazado"** en el PDF final indicando la cancelación.
* **Webhook:** Puede disparar el webhook **"doc\_signed"** después de la cancelación (PDF actualizado).
* **Estado del documento:** Debe estar **"en curso"** para poder ser cancelado.
* **User-Agent:** Header obligatorio para evitar spam.

### Endpoint

<mark style="color:green;">`POST`</mark>`https://api.zapsign.com.br/api/v1/refuse/`

**Headers**

<table><thead><tr><th width="152">Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td>Token de API precedido del texto "Bearer".<br>Ejemplo: <code>Bearer c7f35c84-7893-4087-b4fb-d1f06c23</code>.</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="158">Name</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td>doc_token<mark style="color:red;">*</mark></td><td>string</td><td>Token del documento</td></tr><tr><td>rejected_reason<mark style="color:red;">*</mark></td><td>string</td><td>Motivo de la cancelación del documento. Esta información estará disponible en la plataforma web en los detalles del documento.</td></tr><tr><td>notify_signer</td><td>boolean</td><td>Si true, notifica a los firmantes por correo electrónico cuando el documento se cancele. Si false, no se envía ninguna notificación. Default: false.</td></tr></tbody></table>

Ejemplo request

```json
{
  "doc_token": "bfe4e2c7-33be-4a70-8669-a0491f92e795",
  "rejected_reason": "Documento cancelado por la empresa"
}
```

Response

{% tabs %}
{% tab title="200 - exitoso" %}

```json
{
    "message": "Documento rechazado con éxito. Recuerde: este endpoint es asíncrono, por lo tanto, espere a que los PDF finales estén listos a través de webhooks o verifíquelos en unos minutos."
}
```

{% endtab %}
{% endtabs %}

#### Códigos de error

* **400 missing\_doc\_token:** Debe enviar el `doc_token` (string)
* **400 missing\_rejected\_reason:** Debe enviar el `rejected_reason` (string)
* **400 invalid\_json:** El JSON enviado es inválido
* **403 document\_already\_signed:** No se puede cancelar un documento ya firmado
* **403 document\_already\_refused:** No se puede cancelar un documento que ya fue cancelado/rechazado
* **403 refuse\_not\_allowed:** No está permitido rechazar este documento
* **404 document\_not\_found:** Documento no encontrado
* **500 internal\_error:** Error interno al procesar la solicitud


---

# 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/documentos/cancelar-documentos.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.
