> 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/english/documentos/cancel-document.md).

# Cancel document

This endpoint allows you to cancel/reject an in-progress document to interrupt the signing process.

N**otes**

* **Permissions:** Can be used by administrators, owners, or groups with access.
* **Final status:** The document is set to **"rejected"** and can no longer be signed.
* **Watermark:** Adds the watermark **"Rejected document"** to the final PDF indicating the cancellation.
* **Webhook:** May trigger the **"doc\_signed"** webhook after the cancellation (updated PDF).
* **Document status:** Must be **"in progress"** to be canceled.
* **User-Agent:** Mandatory header to prevent spam.

### Endpoint

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

**Headers:**

<table><thead><tr><th width="153">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td>API token prefixed by the text "Bearer". Example: <code>Bearer c7f35c84-7893-4087-b4fb-d1f06c23</code>.</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="183">Name</th><th width="126">Type</th><th>Description</th></tr></thead><tbody><tr><td>doc_token<mark style="color:red;">*</mark></td><td>string</td><td>Document token</td></tr><tr><td>rejected_reason<mark style="color:red;">*</mark></td><td>string</td><td>Reason for canceling the document. This information will be available on the web platform in the document details.</td></tr><tr><td>notify_signer</td><td>boolean</td><td>If true, notify signers by email when the document is canceled. If false, no notification is sent. Default: false</td></tr></tbody></table>

**Example request:**

```
{
  "doc_token": "bfe4e2c7-33be-4a70-8669-a0491f92e795",
  "rejected_reason": "Document canceled by the company"
}
```

**Response**

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

```json
{
    "message": "Document successfully refused. Please note: this endpoint is asynchronous, so wait for the final PDFs to be ready via webhooks or check them in a few minutes."
}
```

{% endtab %}
{% endtabs %}

#### Error codes

* **400 missing\_doc\_token:** You must send the `doc_token` (string)
* **400 missing\_rejected\_reason:** You must send the `rejected_reason` (string)
* **400 invalid\_json:** The JSON sent is invalid
* **403 document\_already\_signed:** A signed document cannot be canceled
* **403 document\_already\_refused:** A document that has already been canceled/rejected cannot be canceled again
* **403 refuse\_not\_allowed:** Rejection of this document is not allowed
* **404 document\_not\_found:** Document not found
* **500 internal\_error:** Internal error while processing the reques


---

# 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/english/documentos/cancel-document.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.
