DocuSign: Updates a template document
DocuSign esignature.esignatureDocumentsPutTemplateDocument: arguments, response, policy and SDK examples.
← Esignature operations · Get started
Operation docusign.esignature_documents_puttemplatedocument
Provider route: PUT /restapi/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}. 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"]["esignatureDocumentsPutTemplateDocument"]>[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.esignatureDocumentsPutTemplateDocument(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_document(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.documentId | string | Required within parent | |
path.templateId | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.is_envelope_definition | string | Optional | |
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 Updates a template document — response body |
Referenced models: Updates a template document — response body
Schemas
Section titled “Schemas”160 more schemas are linked from the tables above, on the schema pages.
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
Updates a template document — response body — doc Gen Errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Describes document generation errors. |
errorCode | string | Optional | A code associated with the error condition. |
message | string | Optional | The error message. |
tagIdentifier | string | Optional | The tag that caused the syntax error. See [Document Generation Syntax](https://support.docusign.com/s/document-item?bundleId=als1679428547895&topicId=ftc1679700030026.html) to learn more about document generation syntax rules. |
Locks a template — response body — error Details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | 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. |
Updates an existing brand — response body — colors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A name-value pair that describes an item and provides a value for the item. |
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. |
name | string | Optional | The name of the item. |
originalValue | string | Optional | The initial value of the item. |
value | string | Optional | The current value of the item. |
Referenced models: Locks a template — response body — error Details
Updates a template document — response body — name Metadata
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Metadata about a property. |
options | array | Optional | An array of option strings supported by this setting. |
options[] | string | Each item | |
rights | string | Optional | Indicates whether the property is editable. Valid values are: - `editable` - `read_only` |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: docusign.esignature_documents_puttemplatedocument. Catalog operation: esignature:Documents_PutTemplateDocument. 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.