> 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/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/v2/reference/envelopes/envelopetemplates/listbydocument

## Authentication

- `Authorization` header (required) — OAuth 2.0 access token (JWT or auth-code grant). Sent as Authorization: Bearer \<token>.

## 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 being accessed.
- `envelopeId` (string, required) — The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec

### Query parameters

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

## Response

### 200

Successful response.

- `templates` (list of templateSummary, optional)

## Errors

### 400 Bad Request Error

Error encountered.

- `errorCode` (string, optional) — An error code associated with the error.
- `message` (string, optional) — A short error message.

## Types

### templateSummary

- `applied` (string, optional) — Reserved: TBD
- `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)
- `name` (string, optional)
- `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)

### templateMatch

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

## Examples

**Response**

```json
{
  "templates": [
    {
      "applied": "string",
      "documentId": "string",
      "documentName": "string",
      "name": "string",
      "templateId": "string",
      "templateMatch": {
        "documentEndPage": "string",
        "documentStartPage": "string",
        "matchPercentage": "string"
      },
      "uri": "string"
    }
  ]
}
```