> For the complete documentation index, see [llms.txt](https://developers.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.docstudio.com/api-documentation/envelope/send-envelope.md).

# Send Envelope

### Method

<table><thead><tr><th width="321">Method</th><th>POST</th></tr></thead><tbody><tr><td>URL</td><td><code>/api/v1/envelope/send</code></td></tr><tr><td>Authorization</td><td>Bearer {token}</td></tr><tr><td>Content-Type</td><td>application/json</td></tr><tr><td>Body</td><td><code>{"data":"string"}</code></td></tr></tbody></table>

Use this endpoint to create a new envelope from a template and send it to recipients. The response returns the envelope UUID.

### How it works

To create and send an envelope you should know what template will be used for envelope creation.

The request must reuse the same template objects that exist in the template definition, including the template UUID, template version, role IDs, document IDs, and field names.

#### Template example

This simplified template example shows which values you need to reuse in the send request.

```xml
<template uuid="56cacd6a-ffe7-4b77-9c0c-f928d9a18cb5" version="ab0d11cb-ebdd-42bd-a581-ddca1bb9b585">
    <flow>
        <roles>
            <role id="23f20eec-adad-4325-b553-1bde4be29198"/>
            <role id="b811f2b6-1656-42aa-9420-a9b8addb0246"/>
        </roles>
    </flow>
    <documents>
        <document id="4a61f258-fd9d-406c-b47e-81c90d4e5c47">
            <field name="date field" type="date"/>
        </document>
    </documents>
</template>
```

In the send request:

* `template/@uuid` maps to `envelope/@templateUuid`
* `template/@version` maps to `envelope/@templateVersion`
* `role/@id` is reused in `flow > roles > role`
* `document/@id` and `field/@name` are reused in `documents > document > field`

### Request body

Send the envelope XML as a string inside the `data` field.

### Request example

This example shows the XML payload that you pass inside the `data` field. It sends an envelope created from the template shown above.

```xml
<envelope templateUuid="56cacd6a-ffe7-4b77-9c0c-f928d9a18cb5" templateVersion="ab0d11cb-ebdd-42bd-a581-ddca1bb9b585">
    <info>
        <subject>Envelope subject</subject>
        <message>Envelope message</message>
    </info>
    <flow>
        <roles>
            <role id="23f20eec-adad-4325-b553-1bde4be29198" mailboxUuid="9baec31c-e940-4894-b6d1-52033e1af66e"/>
            <role id="b811f2b6-1656-42aa-9420-a9b8addb0246" mailboxUuid="42c95245-30c1-46ef-bd5b-a9a111deec10"/>
        </roles>
    </flow>
    <documents>
        <document id="4a61f258-fd9d-406c-b47e-81c90d4e5c47">
            <field name="date field">2020-12-02</field>
        </document>
    </documents>
</envelope>
```

The platform applies the provided values to the matching template fields and sends the envelope to the specified recipients.

### Response example

```json
{"uuid":"89499ba2-287d-404c-87b0-342dc5b01b6a"}
```

Use this UUID to track the envelope status and perform follow-up actions.

### Related topics

* [Envelope Structure](https://support.docstudio.com/docstudio-docs/docstudio-for-developers/api-documentation/envelope/envelope-structure)
* [Fill Envelope](https://support.docstudio.com/docstudio-docs/docstudio-for-developers/api-documentation/envelope/fill-envelope)
* [Envelope Forms](https://support.docstudio.com/docstudio-docs/docstudio-for-developers/api-documentation/envelope/envelope-forms)
* [Template Structure API](https://support.docstudio.com/docstudio-docs/docstudio-for-developers/template-api/template-structure-api)
