# Reprocessing Documents and Webhooks

In scenarios where integration failures, validation errors, or the need for updates to the receiving system occur, reprocessing webhooks can be crucial to ensure correct data delivery and maintain consistency between integrated systems.

#### In this section:

* [Reprocessing webhooks via the web interface](#reprocessing-via-web)
* [Reprocessing webhooks and documents via API](#reprocessing-documents-and-webhooks-via-api)

***

#### Reprocessing webhooks via Web

To reprocess signed documents via the web interface, navigate to the documents tab, find your document, click the gear icon, and select "Reprocess Webhooks."\ <br>

<figure><img src="https://1401277393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4noMoX5ZGb2-RhWjjf-1703796690%2Fuploads%2FiyEiuS0D94PenzwCIpsV%2FCaptura%20de%20tela%202024-10-02%20083308.png?alt=media&#x26;token=99a136ea-e521-412f-9e07-b6b189b47eb3" alt="Screenshot of a document management interface showing a signed document titled &#x22;Test document.&#x22; The options menu is open, displaying actions such as &#x22;Date limit,&#x22; &#x22;Add signer,&#x22; &#x22;Edit fields,&#x22; and &#x22;Reprocess webhook"><figcaption><p>Interface with options for managing a signed document, including adding signers, editing fields, and reprocessing the webhook.</p></figcaption></figure>

***

#### Reprocessing Documents and Webhooks via API

In cases where the signed **document needs to be regenerated**—such as when there are integrity issues with the file **or a failure in webhook delivery**—**you can use the reprocessing endpoint.** This is useful, for instance, when the final document was corrupted or the associated webhook was not properly sent.

<mark style="color:green;">**`POST`**</mark>`https://api.zapsign.com.br/api/v1/docs/{{doc_principal_token}}/reprocess-doc/`

**Headers**<br>

<table data-header-hidden><thead><tr><th></th><th width="146"></th><th></th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>Authorization*</td><td>string</td><td>Api token a frente do texto "Bearer".Ex: Bearer c7f35c84-7893-4087-b4fb-d1f06c23</td></tr></tbody></table>

**Request Body**

```json
{
    "send_webhook": true,
    "resign_doc": false
}
```

| Name          | Type    | Description                                                                                     |
| ------------- | ------- | ----------------------------------------------------------------------------------------------- |
| send\_webhook | boolean | To activate the resending of the webhook of the selected document. Default: false               |
| resign\_doc   | boolean | To reprocess the signed document by creating a new pdf of the selected document. Default: false |

#### Response <a href="#respostas" id="respostas"></a>

{% tabs %}
{% tab title="200-OK" %}
Document successfully reprocessed.&#x20;
{% endtab %}

{% tab title="404- Not found" %}
Check if the document token is correct in the URL.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Since the **process is asynchronous,** monitor the webhooks or manually check the document status after a few minutes.
{% endhint %}


---

# 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/webhooks/reprocessing-documents-and-webhooks.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.
