---
title: "Retrieves a single document or all documents from an envelope."
method: GET
path: "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}"
tags: ["EnvelopeDocuments"]
---

# Retrieves a single document or all documents from an envelope.

`GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}`

Retrieves a single document or all documents from an envelope.

To retrieve a single document, provide the ID of the document in the `documentId` path parameter.
Alternatively, by setting the `documentId` parameter to special keyword values,
you can retrieve all the documents (as a combined PDF, portfolio PDF, or ZIP archive)
or just the certificate of completion. See the `documentId` description for how to retrieve each format.


The response body of this method
is a file. If you request multiple documents,
the result is a ZIP archive
that contains all of the documents.

In all other cases, the response is a PDF
file or PDF portfolio.


You can get the file name and document ID from the response's `Content-Disposition` header:

```
Content-Disposition: file; filename="NDA.pdf"; documentid="1
```

By default, the response is the PDF file
as a byte stream.
For example a request/response in `curl` looks like this:

```
$ curl --request GET 'https://demo.docusign.net/restapi/v2/accounts/0cdb3ff3-xxxx-xxxx-xxxx-e43af011006d/envelopes/ea4cc25b-xxxx-xxxx-xxxx-a67a0a2a4f6c/documents/1/' \
       --header 'Authorization: Bearer eyJ...bqg'


HTTP/1.1 200 OK
Content-Length: 167539
Content-Type: application/pdf
. . .
Content-Disposition: file; filename="Lorem_Ipsum.pdf"; documentid="1"
Date: Tue, 23 Aug 2022 01:13:15 GMT

%PDF-1.4
%˚¸˝˛
6 0 obj
<</Length 14>>stream
. . .
```

By using the `Content-Transfer-Encoding`
header in the request, you can obtain the PDF file
encoded in base64. The same `curl` request with
the base64 header would look like this:

```
$ curl --request GET 'https://demo.docusign.net/restapi/v2/accounts/0cdb3ff3-xxxx-xxxx-xxxx-e43af011006d/envelopes/ea4cc25b-xxxx-xxxx-xxxx-a67a0a2a4f6c/documents/1/' \
       --header 'Authorization: Bearer eyJ...bqg' \
       --header 'Content-Transfer-Encoding: base64'


HTTP/1.1 200 OK
Content-Length: 223384
Content-Type: application/pdf
. . .
Content-Disposition: file; filename="Lorem_Ipsum.pdf"; documentid="1"
Content-Transfer-Encoding: base64
Date: Tue, 23 Aug 2022 01:12:30 GMT

JVBERi0xLjQKJfv8/f4KNiAwIG9iago8PC9MZW. . .==
```


(In an actual `curl` request you would use the `--output` switch to
save the byte stream into a file.)

### Related topics

- [How to download envelope documents](/docs/esign-rest-api/how-to/download-envelope-documents/)

## Path parameters

- `accountId` string, required
- `documentId` string, required
- `envelopeId` string, required

## Query parameters

- `certificate` string
- `documents_by_userid` string
- `encoding` string
- `encrypt` string
- `language` string
- `recipient_id` string
- `shared_user_id` string
- `show_changes` string
- `watermark` string

## Response `200`

Successful response.

## Other responses

- `400` — Error encountered.

---

[API](https://skmtc.net/docusign/apis/docusign-esignature-rest-api.md) · [All operations](https://skmtc.net/docusign/apis/docusign-esignature-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docusign/docusign-esignature-rest-api/versions/77f1998c313d/schema)
