> 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-reference/fill-envelope.md).

# Fill Envelope

This document contains details for the /api/v1/envelope/fill endpoint, including headers, request body, response, and status codes.

### Endpoint

| Method | Endpoint                |
| ------ | ----------------------- |
| `PUT`  | `/api/v1/envelope/fill` |

### Headers

<table><thead><tr><th width="165">Header</th><th width="253">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>Authorization</code></td><td>Yes</td><td>Bearer authorization token</td></tr><tr><td><code>Content-Type</code></td><td>Yes</td><td><code>application/json</code></td></tr><tr><td><code>Mailbox</code></td><td>Yes</td><td>UUID of the mailbox filling the envelope</td></tr></tbody></table>

### Request body

<table><thead><tr><th width="81">Field</th><th width="82">Type</th><th width="198">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>uuid</code></td><td>UUID</td><td>Yes</td><td>UUID of the envelope to fill</td></tr><tr><td><code>data</code></td><td>string</td><td>Yes</td><td>Envelope XML containing the field values</td></tr></tbody></table>

### Request example

```http
PUT /api/v1/envelope/fill
Authorization: Bearer {token}
Content-Type: application/json
Mailbox: 42c95245-30c1-46ef-bd5b-a9a111deec10
```

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

Envelope XML:

```xml
<envelope
  templateUuid="500afafd-711e-471a-a18f-24a89cd4ede3"
  templateVersion="143a2a4b-325e-4c05-a4c1-52f44e21b745"
>
  <documents>
    <document id="ef247568-559a-4ec1-9ecc-6b44c9fb8215">
      <field name="Customer name">ACME Ltd</field>
      <field name="Contract amount">1000.00</field>
    </document>
  </documents>
</envelope>
```

{% hint style="warning" %}
Use document IDs and field names from the envelope template version.
{% endhint %}

### Response

The endpoint returns `200 OK` after updating the field values.

### Status codes

| Code  | Description                 |
| ----- | --------------------------- |
| `200` | Fields updated successfully |

### Related topics

* [Working with XML payloads](/guides/xml-payloads.md)
* [Envelope fields](/guides/envelope-fields.md)
* [Error handling and API error codes](/error-codes/error-handling-and-api-error-codes.md)
