Skip to content

DocuSign: Deletes documents from a template

DocuSign esignature.esignatureDocumentsDeleteTemplateDocuments: arguments, response, policy and SDK examples.

← Esignature operations · Get started

Operation docusign.esignature_documents_deletetemplatedocuments

Provider route: DELETE /restapi/v2.1/accounts/{accountId}/templates/{templateId}/documents. Alter supplies the connection’s credentials and routing.

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"]["esignatureDocumentsDeleteTemplateDocuments"]>[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.esignatureDocumentsDeleteTemplateDocuments(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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_delete_template_documents(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.accountIdstringRequired within parent
path.templateIdstringRequired within parent
bodyModelOptionalExpand Creates an envelope — request body — body

Referenced models: Creates an envelope — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Deletes documents from a template — response body

Referenced models: Deletes documents from a template — response body

162 more schemas are linked from the tables above, on the schema pages.

Deletes documents from a template — response body
FieldTypePresenceDescription and constraints
$objectRootThe results of this method.
templateDocumentsarrayOptionalAn array of document objects that contain information about the documents associated with the template.
templateDocuments[]ModelEach itemExpand Updates a template document — response body
templateIdstringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootThis object contains details about the envelope document.
addedRecipientIdsarrayOptionalIf recipients were added by converting form fields into tabs, their IDs appear here. This property is read-only.
addedRecipientIds[]stringEach item
agreementTypestringOptional
agreementTypeSourcestringOptional
attachmentTabIdstringOptionalIf 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.
authoritativeCopystringOptionalWhen **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.**
authoritativeCopyMetadataModelOptionalExpand Updates a template document — response body — name Metadata
Metadata that indicates if the sender can edit the `authoritativeCopy` property. Not applicable for template documents.
availableDocumentTypesarrayOptional
availableDocumentTypes[]ModelEach itemExpand Updates a template document — response body — available Document Types item
containsPdfFormFieldsstringOptionalWhen **true,** the document has editable form fields that are made available through a PDF format.
displaystringOptionalThis 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.
displayMetadataModelOptionalExpand Updates a template document — response body — name Metadata
Metadata that indicates if the sender can edit the `display` property. Not applicable for template documents.
docGenDocumentStatusstringOptional
docGenErrorsarrayOptional
docGenErrors[]ModelEach itemExpand Updates a template document — response body — doc Gen Errors item
docGenFormFieldsarrayOptional
docGenFormFields[]ModelEach itemExpand Updates a template document — response body — doc Gen Form Fields item
documentBase64stringOptionalThe 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.
documentFieldsarrayOptionalAn object containing information about the custom fields on the document.
documentFields[]ModelEach itemExpand Updates an existing brand — response body — colors item
documentIdstringOptionalThe ID of the document that the tab is placed on. This value must refer to the ID of an existing document.
documentIdGuidstringOptionalThe GUID of the document.
documentTemplateIdstringOptional
errorDetailsModelOptionalExpand Locks a template — response body — error Details
This object describes errors that occur. It is only valid for responses and ignored in requests.
hasDigitalSignaturestringOptional
includeInDownloadstringOptionalWhen **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.**
includeInDownloadMetadataModelOptionalExpand Updates a template document — response body — name Metadata
Metadata that indicates if the sender can edit the `includeInDownload` property. Not applicable for template documents.
isAceGenDocumentstringOptional
isDocGenDocumentstringOptional
isEditedstringOptional
isExternallyAvailablestringOptional
isFlattenedstringOptional
namestringOptionalThe document's file name.

Example: `Q1-Report.docx`
nameMetadataModelOptionalExpand Updates a template document — response body — name Metadata
Metadata that indicates if the sender can edit the `name` property. Not applicable for template documents.
orderstringOptionalThe order in which to sort the results.

Valid values are:


* `asc`: Ascending order.
* `desc`: Descending order.
pagesarrayOptionalAn array of page objects that contain information about the pages in the document.
pages[]ModelEach itemExpand Creates a workspace file — response body — thumbnail
signerMustAcknowledgestringOptionalSets 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.

signerMustAcknowledgeMetadataModelOptionalExpand Updates a template document — response body — name Metadata
Metadata that indicates if the sender can edit the `signerMustAcknowledge` property. Not applicable for template documents.
sizeBytesstringOptional
templateLockedstringOptionalWhen **true,** the sender cannot change any attributes of the recipient. Used only when working with template recipients.
templateRequiredstringOptionalWhen **true,** the sender may not remove the recipient. Used only when working with template recipients.
typestringOptionalThe 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`
uristringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootAn `accountCustomField` is an envelope custom field that you set at the account level.
Applying custom fields enables account administrators to group and manage envelopes.
listCustomFieldsarrayOptionalAn array of list custom fields.
listCustomFields[]ModelEach itemExpand Gets a list of custom fields — response body — list Custom Fields item
textCustomFieldsarrayOptionalAn array of text custom fields.
textCustomFields[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRoot
envelopeCustomMetadataDetailsarrayOptional
envelopeCustomMetadataDetails[]ModelEach itemExpand Updates an existing brand — response body — colors item

Referenced models: Updates an existing brand — response body — colors item

SDK function policy ID: docusign.esignature_documents_deletetemplatedocuments. Catalog operation: esignature:Documents_DeleteTemplateDocuments. 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.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.