DocuSign: Adds documents to a template document
DocuSign esignature.esignatureDocumentsPutTemplateDocuments: arguments, response, policy and SDK examples.
← Esignature operations · Get started
Operation docusign.esignature_documents_puttemplatedocuments
Provider route: PUT /restapi/v2.1/accounts/{accountId}/templates/{templateId}/documents. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/docusign with npm, or alter-sdk-docusign with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { DocuSignIntegration } from "@alter-ai/docusign";
async function execute(input: Parameters<DocuSignIntegration["esignature"]["esignatureDocumentsPutTemplateDocuments"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new DocuSignIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.esignature.esignatureDocumentsPutTemplateDocuments(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_docusign import DocuSignIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = DocuSignIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.esignature.esignature_documents_put_template_documents(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.accountId | string | Required within parent | |
path.templateId | string | Required within parent | |
body | Model | Optional | Expand Creates an envelope — request body — body |
Referenced models: Creates an envelope — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Deletes documents from a template — response body |
Referenced models: Deletes documents from a template — response body
Schemas
Section titled “Schemas”162 more schemas are linked from the tables above, on the schema pages.
Deletes documents from a template — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The results of this method. |
templateDocuments | array | Optional | An array of document objects that contain information about the documents associated with the template. |
templateDocuments[] | Model | Each item | Expand Updates a template document — response body |
templateId | string | Optional | The unique identifier of the template. If this is not provided, Docusign will generate a value. |
Referenced models: Updates a template document — response body
Updates a template document — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This object contains details about the envelope document. |
addedRecipientIds | array | Optional | If recipients were added by converting form fields into tabs, their IDs appear here. This property is read-only. |
addedRecipientIds[] | string | Each item | |
agreementType | string | Optional | |
agreementTypeSource | string | Optional | |
attachmentTabId | string | Optional | If this document is an attachment to another document in the envelope, this is the ID of the attachment tab it is associated with on the other document. |
authoritativeCopy | string | Optional | When **true,** marks all of the documents in the envelope as authoritative copies. **Note:** You can override this value for a specific document. For example, you can set the `authoritativeCopy` property to **true** at the envelope level, but turn it off for a single document by setting the `authoritativeCopy` property for the document to **false.** |
authoritativeCopyMetadata | Model | Optional | Expand Updates a template document — response body — name Metadata Metadata that indicates if the sender can edit the `authoritativeCopy` property. Not applicable for template documents. |
availableDocumentTypes | array | Optional | |
availableDocumentTypes[] | Model | Each item | Expand Updates a template document — response body — available Document Types item |
containsPdfFormFields | string | Optional | When **true,** the document has editable form fields that are made available through a PDF format. |
display | string | Optional | This string sets the display and behavior properties of the document during signing. Valid values: * `modal`<br> The document is shown as a supplement action strip and can be viewed, downloaded, or printed in a modal window. This is the recommended value for supplemental documents. * `inline`<br> The document is shown in the normal signing window. This value is not used with supplemental documents, but is the default value for all other documents. |
displayMetadata | Model | Optional | Expand Updates a template document — response body — name Metadata Metadata that indicates if the sender can edit the `display` property. Not applicable for template documents. |
docGenDocumentStatus | string | Optional | |
docGenErrors | array | Optional | |
docGenErrors[] | Model | Each item | Expand Updates a template document — response body — doc Gen Errors item |
docGenFormFields | array | Optional | |
docGenFormFields[] | Model | Each item | Expand Updates a template document — response body — doc Gen Form Fields item |
documentBase64 | string | Optional | The document's bytes. This field can be used to include a base64 version of the document bytes within an envelope definition instead of sending the document using a multi-part HTTP request. The maximum document size is smaller if this field is used due to the overhead of the base64 encoding. |
documentFields | array | Optional | An object containing information about the custom fields on the document. |
documentFields[] | Model | Each item | Expand Updates an existing brand — response body — colors item |
documentId | string | Optional | The ID of the document that the tab is placed on. This value must refer to the ID of an existing document. |
documentIdGuid | string | Optional | The GUID of the document. |
documentTemplateId | string | Optional | |
errorDetails | Model | Optional | Expand Locks a template — response body — error Details This object describes errors that occur. It is only valid for responses and ignored in requests. |
hasDigitalSignature | string | Optional | |
includeInDownload | string | Optional | When **true,** the document is included in the combined document download (`documentsCombinedUri`). This is only applied to [supplemental documents](/docs/esign-rest-api/esign101/concepts/documents/supplemental/). The default value is **true.** |
includeInDownloadMetadata | Model | Optional | Expand Updates a template document — response body — name Metadata Metadata that indicates if the sender can edit the `includeInDownload` property. Not applicable for template documents. |
isAceGenDocument | string | Optional | |
isDocGenDocument | string | Optional | |
isEdited | string | Optional | |
isExternallyAvailable | string | Optional | |
isFlattened | string | Optional | |
name | string | Optional | The document's file name. Example: `Q1-Report.docx` |
nameMetadata | Model | Optional | Expand Updates a template document — response body — name Metadata Metadata that indicates if the sender can edit the `name` property. Not applicable for template documents. |
order | string | Optional | The order in which to sort the results. Valid values are: * `asc`: Ascending order. * `desc`: Descending order. |
pages | array | Optional | An array of page objects that contain information about the pages in the document. |
pages[] | Model | Each item | Expand Creates a workspace file — response body — thumbnail |
signerMustAcknowledge | string | Optional | Sets how the signer interacts with the supplemental document. Valid values: * `no_interaction`<br> No recipient action is required. * `view`<br> The recipient is required to view the document. * `accept`<br> The recipient is required to accept the document by selecting accept during signing, but is not required to view the document. * `view_accept`<br> The recipient is required to view and accept the document. |
signerMustAcknowledgeMetadata | Model | Optional | Expand Updates a template document — response body — name Metadata Metadata that indicates if the sender can edit the `signerMustAcknowledge` property. Not applicable for template documents. |
sizeBytes | string | Optional | |
templateLocked | string | Optional | When **true,** the sender cannot change any attributes of the recipient. Used only when working with template recipients. |
templateRequired | string | Optional | When **true,** the sender may not remove the recipient. Used only when working with template recipients. |
type | string | Optional | The type of this tab. Values are: - `Approve` - `CheckBox` - `Company` - `Date` - `DateSigned` - `Decline` - `Email` - `EmailAddress` - `EnvelopeId` - `FirstName` - `Formula` - `FullName` - `InitialHere` - `InitialHereOptional` - `LastName` - `List` - `Note` - `Number` - `Radio` - `SignerAttachment` - `SignHere` - `SignHereOptional` - `Ssn` - `Text` - `Title` - `Zip5` - `Zip5Dash4` |
uri | string | Optional | The URI for retrieving the document. |
Referenced models: Updates a template document — response body — doc Gen Form Fields item, Updates a template document — response body — doc Gen Errors item, Locks a template — response body — error Details, Updates an existing brand — response body — colors item, Creates a workspace file — response body — thumbnail, Updates a template document — response body — name Metadata, Updates a template document — response body — available Document Types item
Gets a list of custom fields — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An `accountCustomField` is an envelope custom field that you set at the account level. Applying custom fields enables account administrators to group and manage envelopes. |
listCustomFields | array | Optional | An array of list custom fields. |
listCustomFields[] | Model | Each item | Expand Gets a list of custom fields — response body — list Custom Fields item |
textCustomFields | array | Optional | An array of text custom fields. |
textCustomFields[] | Model | Each item | Expand Gets a list of custom fields — response body — text Custom Fields item |
Referenced models: Gets a list of custom fields — response body — list Custom Fields item, Gets a list of custom fields — response body — text Custom Fields item
Gets the status of a single envelope — response body — envelope Custom Metadata
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
envelopeCustomMetadataDetails | array | Optional | |
envelopeCustomMetadataDetails[] | Model | Each item | Expand Updates an existing brand — response body — colors item |
Referenced models: Updates an existing brand — response body — colors item
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: docusign.esignature_documents_puttemplatedocuments. Catalog operation: esignature:Documents_PutTemplateDocuments. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.