Skip to main content

Add or replace a template document

PUT 

/restapi/v2.1/accounts/:accountId/templates/:templateId/documents/:documentId

Adds a document to a template created with POST /templates, or replaces its document. Send the document as base64 in documents[].documentBase64 with its name and fileExtension (pdf, doc or docx). A Word document is treated as a document-generation document: the {{ }} merge fields in its body become the fields listed by GET /envelopes/{envelopeId}/docGenFormFields on envelopes created from the template. Tabs already added to the template are kept. A template built this way holds one document.

Requires the Docusign compatibility API to be enabled for your organization; otherwise the route returns 404.

Request​

Responses​

Document attached.

Response Headers
    X-Request-Id

    Correlation id for this request, returned on every response (success and error). Quote it when contacting support to pinpoint the exact request, and use it to correlate your own logs. It is the same 128-bit id as the trace-id segment of the traceparent header.

    traceparent

    W3C Trace Context identifier for this request, returned on every response. Send your own traceparent on a request to have it adopted, so a multi-call workflow shares one trace. Format: 00-<32-hex trace-id>-<16-hex span-id>-<2-hex flags>.