> 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 templates associated with document in envelope

GET https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/templates

Retrieves the templates associated with a document in the specified envelope.

Reference: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopetemplates/listbydocument

## 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 unique ID of the document within the envelope. Unlike other IDs in the eSignature API, you specify the `documentId` yourself. Typically the first document has the ID `1`, the second document `2`, and so on, but you can use any numbering scheme that fits within a 32-bit signed integer (1 through 2147483647). Tab objects have a `documentId` property that specifies the document on which to place the tab.
- `envelopeId` (string, required) — The envelope's GUID. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`

### Query parameters

- `include` (string, optional) — A comma-separated list that limits the results. Valid values are: - `applied` - `matched`

## Response

### 200

Successful response.

- `templates` (list of templateSummary, optional) — An array of `templateSummary` objects that contain information about templates.

## 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.

## Types

### templateSummary

Summary of a template request.

- `applied` (string, optional) — Reserved for Docusign.
- `documentId` (string, optional) — Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.
- `documentName` (string, optional) — The name of the document.
- `errorDetails` (errorDetails, optional) — This object describes errors that occur. It is only valid for responses, and ignored in requests.
- `name` (string, optional) — The name of the template.
- `templateId` (string, optional) — The unique identifier of the template. If this is not provided, DocuSign will generate a value.
- `templateMatch` (templateMatch, optional)
- `uri` (string, optional) — A URI containing the user ID.

### errorDetails

This object describes errors that occur. It is only valid for responses, and ignored in requests.

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

### templateMatch

- `documentEndPage` (string, optional)
- `documentStartPage` (string, optional)
- `matchPercentage` (string, optional)

## Examples

**Response**

```json
{
  "templates": [
    {
      "applied": "sample string 1",
      "documentId": "sample string 2",
      "documentName": "sample string 3",
      "errorDetails": {
        "errorCode": "sample string 1",
        "message": "sample string 2"
      },
      "name": "sample string 4",
      "templateId": "sample string 5",
      "templateMatch": {
        "documentEndPage": "sample string 1",
        "documentStartPage": "sample string 2",
        "matchPercentage": "sample string 3"
      },
      "uri": "sample string 6"
    }
  ]
}
```