***

description: Here, we'll walk you through the process of creating templates in the Dropbox Sign web interface to use with the API.
og:description: Here, we'll walk you through the process of creating templates in the Dropbox Sign web interface to use with the API.
---------------------

For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://developers.hellosign.com/docs/walkthroughs/llms.txt. For full documentation content, see https://developers.hellosign.com/docs/walkthroughs/llms-full.txt.

# Using Templates with the API

Templates created on [HelloSign.com](https://app.hellosign.com/home/createReusableDocs) and [Embedded Templates](/docs/walkthroughs/embedded-templates) can be used for sending Signature Requests with the Dropbox Sign API. The API will allow you to interact with the template almost every way except editing.

<Note icon="fa-light fa-triangle-exclamation">
  <strong>Note:</strong> At the time of writing, templates created on HelloSign.com cannot be edited from the API. Similarly, templates created through Embedded Templates cannot be edited on HelloSign.com
</Note>

## Template Setup

The following steps walk you through the process of creating a template using the Dropbox Sign web interface.

On HelloSign.com, [create a template](https://app.hellosign.com/home/createTemplate). Upload a document and specify the roles for each signer, for example 'Client' and 'Me'.

<img src="https://files.buildwithfern.com/https://dropbox123432.docs.buildwithfern.com/1f3248d9213ed5ab0d6d34b0f698b8d5b9e70a10d1c3c7f350ca04ec9360ecfc/docs/templates/create_template_cropped.png" alt="Screenshot of 'Roles setup' section in template editor" />

Click **"Next"** and add fields to be filled out by each role by dragging them from the left sidebar down to the document.

<img src="https://files.buildwithfern.com/https://dropbox123432.docs.buildwithfern.com/63940eb607ed1d5bdbb8a63f0665cc5e04a6564da687c5e4a042725f0f01eaa0/docs/templates/edit_template_cropped.png" alt="Screenshot of template editor" />

Add fields for any text or checkmark annotations you'll want to make at the time of sending.

Selecting **"Sender"** from the **"Signers"** menu will allow you to add Merge Fields (aka Custom Fields). Custom field data can be populated via API when the template is used in a signature request.

You must also specify a case-sensitive **"Merge field"** label that you will use to reference the custom field in your API request.

<img src="https://files.buildwithfern.com/https://dropbox123432.docs.buildwithfern.com/4becfd3c22920a3fdc58049af182a2c5d6be12616ac63fc80079c13546275b5b/docs/templates/custom_fields_cropped.png" alt="Screenshot of template editor" />

<Warning title="Warning" icon="fa-light fa-triangle-exclamation">
  The <strong>"Merge field"</strong> label is case-sensitive but does <strong>not</strong> need to be unique, however, uniqueness is recommended to ensure accuracy when specifying the data that will be used to populate the signature request.
</Warning>

Click **"Next"** and add CC recepients, if applicable. Give your new Template a tittle and add an optional message.

<img src="https://files.buildwithfern.com/https://dropbox123432.docs.buildwithfern.com/0ec8ac95a8f30fb77abbfaf359c69bfd15b7f94ad94ca7a60b7526b847b2943e/docs/templates/cc_roles_cropped.png" alt="Screenshot of CC recepients, title and message in template editor" />

## Finding a Template ID

You will need to find a template's ID in order to be able to use it with the API.

### Finding a Template ID via HelloSign.com

Find the template on the account's [Templates](https://app.hellosign.com/home/createReusableDocs) page and select it. Click on **"More Information"** and select the **"Template ID"**.

### Finding a Template ID via the API

You can retrieve a paged list of your templates by making a GET call to [/template/list](/api/template/list). Iterate through this list -- requesting additional pages if necessary -- to find the template that has a matching title and/or `signer_roles`.

You can then retrieve the ID from this template object's `template_id` field.

<EndpointRequestSnippet endpoint="GET /template/list" />

## Using a Template to Send a Request

You can send a signature request based on a template in your account by making a POST request to [/signature\_request/send\_with\_template](/api/signature-request/send-with-template) and including the `template_id` parameter. You will also be required to provide a unique signer name and email address for each signer role defined in the template.

<Warning title="Important" icon="fa-light fa-circle-exclamation">
  Locked templates can be used in test mode using the boolean parameter <code>test\_mode</code>.
</Warning>

<Tabs>
  <Tab title="Payload">
    <CodeBlock>
      ```json title="Default Example"
      {
        "template_ids": [
          "5eb54aaaa71ce8dcaec5d06e93a2754af1712606",
          "35e3787bd2e61e496099afe44e2767f076378c12",
          "24084dc86475a088b39a49e6fb0fc33006882695"
        ],
        "subject": "Purchase Order",
        "message": "Glad we could come to an agreement.",
        "signers": [
          {
            "role": "Client",
            "name": "George",
            "email_address": "george@example.com"
          }
        ],
        "ccs": [
          {
            "role": "Accounting",
            "email_address": "accounting@example.com"
          }
        ],
        "custom_fields": [
          {
            "name": "Cost",
            "value": "$20,000",
            "editor": "Client",
            "required": true
          }
        ],
        "signing_options": {
          "draw": true,
          "type": true,
          "upload": true,
          "phone": false,
          "default_type": "draw"
        },
        "test_mode": true
      }
      ```
    </CodeBlock>
  </Tab>

  <Tab title="Code">
    <EndpointRequestSnippet endpoint="POST /signature_request/send_with_template" />
  </Tab>
</Tabs>

## Using Multiple Templates in a Request

You can send a signature request based on multiple templates in your account by making a POST request to [/signature\_request/send\_with\_template](/api/signature-request/send-with-template) and including the necessary `template_ids[%i%]` parameters. You will be required to provide a unique signer name and email address for each signer role in each template.

**Note:** When sending a request with multipe templates, no more than one template with ordered signers can be used.

## Using Long Text in Custom Fields

The text for a custom field should fit into the space available. If it does not fit it will overrun the box and a warning will be thrown. Additionally, if the signer is assigned [editor privileges to the custom field](https://faq.hellosign.com/hc/en-us/articles/216599897?_ga=2.201339985.1130402992.1658331385-1952918733.1658331385) and the text overruns the border, an error will be thrown.

The exact length of text that will fit in any given field depends on the nature of that text. If the text uses wide fonts, or uses words that are long and do not wrap efficiently, less text will fit. If the font is small and narrow, more text will fit.

To help you choose an appropriate text length, some guidance is provided in the response object when calling [/template/list](/api/template/list) or [/template/\{template\_id}](/api/template/get). The response object contains an `avg_text_length` object, per custom field. This object contains two properties (`num_lines` and `num_chars_per_line`) whose values are the expected number of lines and expected number of characters per line, respectively.

If the expected number of characters is exceeded a warning message will be thrown, this warning will contain the `avg_text_length` object once again.

There may be some instances where a warning message will still be thrown even when the text length is less than the expected value. Typically, this is due to the usage of unusually wide fonts, or words that wrap inefficiently into the available space on the field.