When defining a document resource within an envelope, you have two options: using documents or templates.

For both documents and templates you need to define signature places.

Documents

If you have a PDF document ready, complete with signature places, you can simply specify the url field in a Document resource to point to that file (or a temporal file)

Templates

SignatureAPI can generate documents programmatically from a static template combined with dynamic data.

We accept templates in the , which is widely supported by software such as Microsoft Word, Google Docs, and open-source productivity suites like LibreOffice.

Within the template, you can add placeholders, conditionals, and loops. These will be populated with the data provided in the data field in a Document resource. Also, make sure to incorporate the required signature places into the template.

Example

Consider a template like this:

This Dummy Agreement is entered into by {{person.name}}, currently residing at {{person.address}}. The terms and conditions outlined in this agreement shall be governed by the laws of {{jurisdiction}}.

{{if mediation}}
Any dispute shall be resolved by mediation, with each party bearing its own costs.
{{else}}
Any dispute shall be settled by arbitration, and the arbitrator’s decision is final.
{{endif}}

When data is inserted:

{
  "url": "https://...",
  "data": {
   "person": {
    "name": "Sherlock Holmes",
    "address": "221b Baker Street, London"
   },
   "jurisdiction": "The United Kingdom",
   "mediation": false
  }
}

You get this document:

This Dummy Agreement is entered into by Sherlock Holmes, currently residing at 221b Baker Street, London. The terms and conditions outlined in this agreement shall be governed by the laws of The United Kingdom.

Any dispute shall be settled by arbitration, and the arbitrator’s decision is final.

Was this page helpful?