# Cancel document

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: 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/cancel-document.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.
