# Download Envelope Documents Archive

Everyone who has access to the envelope can download it. You can download a full envelope or a specific document from it using the following request:

| Method                      | GET                                                                                                                  |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| URL                         | `/api/v1/envelope/{envelopeUuid}/zip`                                                                                |
| Authorization \* (required) | Bearer {token}                                                                                                       |
| content-type                | application/json                                                                                                     |
| mailboxUuid \* (required)   | {uuid}                                                                                                               |
| envelopeUuid \* (required)  | {uuid}                                                                                                               |
| documentId                  | {uuid}                                                                                                               |
| excludeFiles                | Mask to exclude some files. c - for signature/processing Certificate, p - for Printable version, a - for Audit trail |
| zipStructureName            | The name of pre-saved zip structure in the template                                                                  |

### Query parameters for ZIP contents configuration

Depending on the query parameters, you can configure what will be included in the archive:

1. Send a request without query parameters — downloads the full envelope (all documents contained in the envelope, such as the audit trail, a folder for each document with original documents, printable versions, signatures, and processing/signing certificates).
2. Send a request with documentId in query parameters — downloads an archive of a specific document (all documents related to a certain document in the envelope defined by documentId, such as original documents, printable versions, signatures, processing/signing certificates, and the envelope audit trail).
3. Send a request with excludeFiles in query parameters — downloads an archive excluding specified files (if you send excludeFiles=c — processing/signing certificates will be excluded from the archive; if you send excludeFiles=p — the printable version of the documents will be excluded from the archive; if you send excludeFiles=a — the audit trail will be excluded from the archive).

{% hint style="info" %}
You can combine the excludeFiles mask. excludeFiles=cp will exclude processing/signing certificates and the printable version of documents.
{% endhint %}

ZIP archive with documents will be returned in response.

### ZIP content depending on the document state

Depending on the document state, you will receive different ZIP content.

1. If not all dynamic fields (such as text, number, currency, date, dropdown, choice, checkbox, file, dictionary, lookup, dynamic table, duplicate, formula, autonumber, and signature) are filled in the document — you will only get the audit trail in the archive, because the platform is not able to generate files while the document is not completed.
2. If the document is completed and all dynamic fields are filled (described above) — you will get a ZIP with original documents, printable versions, and processing/signing certificates.
3. If the document is completed, all dynamic fields are filled (described above), and at least one QES is applied to the document — you will get a ZIP with original documents, printable versions, signatures that are already set, and processing/signing certificates.

{% hint style="info" %}
ZIP content will change dynamically according to the processing flow step and document state, so in different phases of the envelope processing flow you may get different content in a ZIP with the same request.
{% 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://support.docstudio.com/docstudio-docs/docstudio-for-developers/api-documentation/api-methods/download-envelope-documents-archive.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.
