Adds templates to an envelope
Adds templates to the specified envelope.
Authorization
OAuth2 OAuth 2.0 access token obtained via Authorization Code Grant or JWT Grant.
In: header
Path Parameters
The external account number (int) or account ID GUID.
The envelope's GUID.
Example: 93be49ab-xxxx-xxxx-xxxx-f752070d71ec
Query Parameters
If omitted or set to false (the default), envelope recipients will be removed if the template being applied includes only tabs positioned via anchor text for the recipient, and none of the documents include the anchor text.
When true, the recipients will be preserved after the template is applied.
Request Body
application/json
Response Body
application/json
application/json
curl -X POST "https://example.com/v2.1/accounts/string/envelopes/string/templates" \ -H "Content-Type: application/json" \ -d '{}'{ "documentTemplates": [ { "documentEndPage": "string", "documentId": "string", "documentStartPage": "string", "errorDetails": { "errorCode": "string", "message": "string" }, "templateId": "string" } ]}Gets templates used in an envelope GET
This returns a list of the server-side templates, their name and ID, used in an envelope.
Returns a list of the account's folders GET
Returns a list of the account's folders. Use the `include` query parameter to specify the kinds of folders to return. By default, only the first level of subfolders is shown. Set the `sub_folder_depth` query parameter to `-1` to return the entire folder hierarchy. <ds-column> <ds-step open="false" hideIcon="true"> Default returns only top-level folders. Click to show. <div> `GET 'https://demo.docusign.net/restapi/v2.1/accounts/624e3e00-xxxx-xxxx-xxxx-43918c520dab/folders'` ```json { "resultSetSize": "5", "startPosition": "0", "endPosition": "4", "totalSetSize": "5", "folders": [ { "name": "Draft", "type": "draft", "itemCount": "1", "subFolderCount": "0", "hasSubFolders": "false" }, { "name": "Inbox", "type": "inbox", "itemCount": "0", "subFolderCount": "1", "hasSubFolders": "true", "folders": [ { "name": "Project Fair", "type": "normal", "hasSubFolders": "false", "parentFolderId": "3ed02ee3-xxxx-xxxx-xxxx-e6795f96a840", "parentFolderUri": "/folders/3ed02ee3-xxxx-xxxx-xxxx-e6795f96a840" } ] }, { "name": "Deleted Items", "type": "recyclebin", "itemCount": "0", "subFolderCount": "0", "hasSubFolders": "false" }, { "name": "Sent Items", "type": "sentitems", "itemCount": "3", "subFolderCount": "0", "hasSubFolders": "false" } ] } ``` </div></ds-step> <ds-step open="false" hideIcon="true"> Setting `sub_folder_depth` to `-1` returns the entire folder hierarchy. Click to show. <div> `GET 'https://demo.docusign.net/restapi/v2.1/accounts/624e3e00-xxxx-xxxx-xxxx-43918c520dab/folders?sub_folder_depth=-1'` One envelope has been moved from the `Inbox` folder to the `Project Fair/Phase 1` folder, and the endpoint is invoked with `sub_folder_depth=-1`. ```json { "resultSetSize": "5", "startPosition": "0", "endPosition": "4", "totalSetSize": "4", "folders": [ { "name": "Draft", "type": "draft", "itemCount": "1", "hasSubFolders": "false" }, { "name": "Inbox", "type": "inbox", "itemCount": "0", "hasSubFolders": "true", "folders": [ { "name": "Project Fair", "type": "normal", "itemCount": "0", "hasSubFolders": "true", "parentFolderId": "3ed02ee3-xxxx-xxxx-xxxx-e6795f96a840", "parentFolderUri": "/folders/3ed02ee3-xxxx-xxxx-xxxx-e6795f96a840", "folders": [ { "name": "NDAs", "type": "normal", "itemCount": "0", "hasSubFolders": "false", "parentFolderId": "12882f2f-xxxx-xxxx-xxxx-e04a714f8e2d", "parentFolderUri": "/folders/12882f2f-xxxx-xxxx-xxxx-e04a714f8e2d" }, { "name": "Phase 1", "type": "normal", "itemCount": "1", "hasSubFolders": "false", "parentFolderId": "12882f2f-xxxx-xxxx-xxxx-e04a714f8e2d", "parentFolderUri": "/folders/12882f2f-xxxx-xxxx-xxxx-e04a714f8e2d" } ] } ] }, { "name": "Deleted Items", "type": "recyclebin", "itemCount": "0", "hasSubFolders": "false" }, { "name": "Sent Items", "type": "sentitems", "itemCount": "1", "hasSubFolders": "false" } ] } ``` </div></ds-step> </ds-column> ### Related topics - [Searching for envelopes](https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/envelopes/search/) - [Sharing templates](https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/templates/sharing/)