> For the complete documentation index, see [llms.txt](https://support.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.docstudio.com/admin-panel/webhooks-callbacks/envelope-callbacks-overview/callback-example-basic-implementation.md).

# Callback Example (Basic Implementation)

Follow a simple end-to-end example to create a callback and inspect the payload your endpoint receives.

**To configure and receive callbacks, follow the instructions below.**

To create callbacks, you must meet the following requirements:

1. You must be a user of the platform with owner access to at least one mailbox.
2. You must have a URL that will receive callbacks.
3. You must be familiar with the API, as the callback interface does not have a UI.

**If you meet the three requirements above, you can start configuring your callback.**

Create a callback using the following data. This callback will be triggered for each received envelope with the following statuses: WAITING, COMPLETED, EXPIRED, CANCELLED.

<table data-header-hidden><thead><tr><th width="155"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td></td></tr><tr><td>Method</td><td>POST</td></tr><tr><td>request URL</td><td>/api/v1/envelope/callback/add</td></tr><tr><td><strong>Headers</strong></td><td></td></tr><tr><td>content-type</td><td>application/json</td></tr><tr><td>authorization</td><td>Bearer {token} where {token} is the authorisation token that which user received after successful authorisation on the platform</td></tr><tr><td>mailbox</td><td>UUID of the mailbox to which you configured callbacks</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="155"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td></td></tr><tr><td>Method</td><td>POST</td></tr><tr><td>request URL</td><td>/api/v1/envelope/callback/add</td></tr><tr><td><strong>Headers</strong></td><td></td></tr><tr><td>content-type</td><td>application/json</td></tr><tr><td>authorization</td><td>Bearer {token}, where {token} is the authorization token that the user received after successful authorization on the platform</td></tr><tr><td>mailbox</td><td>UUID of the mailbox to which you configured callbacks</td></tr></tbody></table>

**REQUEST BODY**

```json
 {
  "filter": {},
  "url": "URL which can receive callbacks",
  "retries": 5,
  "timeout": 10000,
  "successCode": 200,
  "login": "",
  "password": ""
}
```

* Send at least one envelope to the mailbox where the callback was created.
* Go to the URL you defined in the callback and wait for the callback data.
* As soon as your URL receives a callback, you will see the following JSON data. The values for UUIDs, status, labels, subject, dates, template, and sender will match the envelope you received.

```json
{
  "uuid": "74acfb70-78e9-4ca5-ac73-054c72402c0a",
  "label": ["string"],
  "status": "string",
  "subject": "string",
  "receiveDate": 1676039226765,
  "expireDate": 1678631226504,
  "template": "ebeb302b-597e-4b47-9de2-5ad3a33e4385",
  "sender": "fdfde267-6558-40a9-93fd-e59529baef36"
}
```


---

# 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://support.docstudio.com/admin-panel/webhooks-callbacks/envelope-callbacks-overview/callback-example-basic-implementation.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.
