> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# Get document or all documents from envelope

GET https://demo.docusign.net/restapi/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:

```text
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:

```bash
$ 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:

```bash
$ 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/)
* [eSignature API rules and resource limits](/docs/esign-rest-api/esign101/rules-and-limits/)

Reference: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopedocuments/get

## Authentication

- `Authorization` header (required) (prefixed with ` Bearer  `) — OAuth 2.0 access token (JWT or auth-code grant). Sent as `Authorization: Bearer <token>` on every request except `GET /v2.1` and `GET /service_information`, which are public discovery endpoints.

## Servers

- `https://demo.docusign.net/restapi` (Demo, default)
- `https://www.docusign.net/restapi` (Production)

## Request

### Path parameters

- `accountId` (string, required) — The external account number (int) or account ID Guid.
- `documentId` (string, required) — The ID of the document to retrieve. Alternatively, you can use one of the following special keywords: - `combined`: Retrieves all of the documents as a single PDF file. When the query parameter `certificate` is **true,** the certificate of completion is included in the PDF file. When the query parameter `certificate` is **false,** the certificate of completion is not included in the PDF file. - `archive`: Retrieves a ZIP archive that contains all of the PDF documents and the certificate of completion. - `certificate`: Retrieves only the certificate of completion as a PDF file. - `portfolio`: Retrieves the envelope documents as a [PDF portfolio](https://helpx.adobe.com/acrobat/using/overview-pdf-portfolios.html).
- `envelopeId` (string, required) — The envelope's GUID. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`

### Query parameters

- `certificate` (string, optional) — Used only when the `documentId` parameter is the special keyword `combined`. When **true,** the certificate of completion is included in the combined PDF file. When **false,** (the default) the certificate of completion is not included in the combined PDF file.
- `documents_by_userid` (string, optional) — When **true,** allows recipients to get documents by their user id. For example, if a user is included in two different routing orders with different visibilities, using this parameter returns all of the documents from both routing orders.
- `encoding` (string, optional) — Reserved for Docusign.
- `encrypt` (string, optional) — When **true,** the PDF bytes returned in the response are encrypted for all the key managers configured on your Docusign account. You can decrypt the documents by using the Key Manager DecryptDocument API method. For more information about Key Manager, see the Docusign Security Appliance Installation Guide that your organization received from Docusign.
- `language` (string, optional) — Specifies the language for the Certificate of Completion in the response. The supported languages are: Chinese Simplified (zh_CN), Chinese Traditional (zh_TW), Dutch (nl), English US (en), French (fr), German (de), Italian (it), Japanese (ja), Korean (ko), Portuguese (pt), Portuguese (Brazil) (pt_BR), Russian (ru), Spanish (es).
- `recipient_id` (string, optional) — Allows the sender to retrieve the documents as one of the recipients that they control. The `documents_by_userid` parameter must be set to **false** for this functionality to work.
- `shared_user_id` (string, optional) — The ID of a shared user that you want to impersonate in order to retrieve their view of the list of documents. This parameter is used in the context of a shared inbox (i.e., when you share envelopes from one user to another through the Docusign Admin console).
- `show_changes` (string, optional) — When **true,** any changed fields for the returned PDF are highlighted in yellow and optional signatures or initials outlined in red. The account must have the **Highlight Data Changes** feature enabled.
- `watermark` (string, optional) — When **true,** the account has the watermark feature enabled, and the envelope is not complete, then the watermark for the account is added to the PDF documents. This option can remove the watermark.

## Response

### 200

Successful response.

- `string`

## Errors

### 400 Bad Request Error

Error encountered.

- `errorCode` (string, optional) — The code associated with the error condition.
- `message` (string, optional) — A brief message describing the error condition.

## Examples

**Response**

```json
"string"
```