Skip to navigation

Envelope and Template Documents

View as Markdown

Envelope and Template Documents

A document is an object that contains a digital document file and a set of metadata describing that document file. A document file contains content to be reviewed or signed by one or more recipients. Documents are always defined as part of the documents property in an envelope or a template, and are always securely encrypted while stored in the system.

For examples of how to work with documents using the API, see How to add a document to an envelope and request a signature by email.

Document files can be supplied through client devices, cloud storage systems, or additional document sources. Docusign accepts almost all document types, including PDF, DOCX, RTF, TXT, and PNG, and you can store multiple documents in a single envelope.

When you add a document file to an envelope, the Docusign platform converts it to PDF and stores it as base64-encoded ASCII.

Supported document file types

You can use the following types of files as documents in an envelope. File types are ordered by category below for organizational purposes, but are accepted and output by the API in the same way, regardless of category.

Document categoryFile type
Document.doc, .docm, .docx, .dot, .dotm, .dotx, .htm, .html, .msg, .pdf, .rtf, .txt, .wpd, .xps
Image.bmp, .gif, .jpg, .jpeg, .png, .tif, .tiff
Presentation.pot, .potx, .pps, .ppt, .pptm, .pptx
Spreadsheet.csv, .xls, .xlsm, .xlsx

If HTML document files contain <img> elements with the src attribute set to a path or URL, those images will not be displayed. Images in HTML files must be encoded in Base64 format, as shown in the example below:

<img src="data:image/gif;base64,R0lGODlhDwAPAKECAAAAzMzM/////
wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4ML
wWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw=="
alt="Base64 encoded image" width="150" height="150"/>

Attaching documents to an envelope

There are two ways to attach documents to envelopes:

  • Converting the documents to base64 and attaching them to a single object
  • Using multipart form data to send the documents directly, without converting them into base64

The second technique, also known as binary transfer, is 33% more efficient than base64 encoding and is recommended for all documents that are larger than 15MB. See How to attach documents via binary transfer for a walkthrough of using binary transfer to add documents to an envelope before sending it for signing via email (remote signing).

Note: Binary transfer is not yet supported by any of the Docusign SDKs. It can only be performed via direct API calls.

Downloading completed documents and tag data

For client applications that are not using Connect to receive events from Docusign, Docusign recommends using and getDocuments calls. When using getEnvelope, if you need additional data such as recipient or tab data, you can combine it into a single call using the URL parameter "Include=". See the documentation for a full list of items that can be fetched in a single call. When fetching documents, we recommend that you get documents as a ZIP file (using the Archive endpoint /envelopes/{envelopeId}/documents/archive), as this is the quickest and most efficient call. Clients should not get document and recipient data one at a time in a recursive loop.

Next steps

Read about important document features:

Working with documents? Learn: