---
title: "Adds templates to a document in an envelope."
method: POST
path: "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/templates"
tags: ["EnvelopeTemplates"]
---

# Adds templates to a document in an envelope.

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

## Request

- Base URL: `https://www.docusign.net/restapi`
- URL: `https://www.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/templates`
- Auth: none declared

Adds templates to a document in the specified envelope.

## Path parameters

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

## Query parameters

- `preserve_template_recipient` string

## Request body

- DocumentTemplateList
  - `documentTemplates` DocumentTemplate[]
    - `documentEndPage` string
    - `documentId` string: Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.
    - `documentStartPage` string
    - `errorDetails` ErrorDetails: This object describes errors that occur. It is only valid for responses and ignored in requests.
      - `errorCode` string: The code associated with the error condition.
      - `message` string: A brief message describing the error condition.
    - `templateId` string: The unique identifier of the template. If this is not provided, Docusign generates an error and the call fails.

## Response `201`

Successful response.

## Other responses

- `400`: Error encountered.

## Changes

- **2020-11-05** (v2) `deba7c083bb4`: 1 info
  - added the new optional `query` request parameter `preserve_template_recipient`
- **2020-10-06** (v2) `a555432b7bf9`: 1 warning
  - deleted the `query` request parameter `preserve_template_recipient`
- **2020-07-13** (v2) `0c6a0c5bd03e`: 1 info
  - added the new optional `query` request parameter `preserve_template_recipient`
- **2019-07-18** (v2) `8ad1b5a40f1b`: 1 warning
  - deleted the `query` request parameter `preserve_template_recipient`

[Operation history](https://skmtc.dev/docusign/apis/docusign-esignature-rest-api/changes/v2.1/accounts/:accountId/envelopes/:envelopeId/documents/:documentId/templates/post.md)

---

[API](https://skmtc.dev/docusign/apis/docusign-esignature-rest-api.md) - [All operations](https://skmtc.dev/docusign/apis/docusign-esignature-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/docusign/apis/docusign-esignature-rest-api/revisions/77f1998c313d?raw)
