Templates

How-to guide4 min read

A templateis a document you set up once: the PDF, where each field sits, who fills it, and what it's called. After that, sending it takes only the signers and your data. Templates work in both test and live mode.

Note
Notriv can set up templates for you. Send us your PDFand we'll have it ready as an API template.

Create a template in the dashboard

  1. Open Developers, then Templates
  2. Choose how to start

    Upload a PDF that has tags or fillable fields, or From an e-sign draft to reuse a document whose fields you placed in the e-sign editor.

  3. Name the fields

    The editor shows the pages with a numbered box on every field. For each one, choose who fills it (Your data or Signer), the signer's role, and its name. Names are what developers send, so make them clear: purchase_price, not field_7.

  4. Save and copy the template ID

    The page shows the exact code to send this template, with every role and data name filled in.

Create a template with the API

const template = await notriv.templates.create({
  name: 'Purchase agreement',
  file: fs.readFileSync('purchase-agreement.pdf'),
})
console.log(template.id, template.roles, template.data_keys)

Send a template

await notriv.envelopes.create({
  template: 'tmpl_purchase_agreement',
  signers: {
    buyer: { name: 'Jane Doe', email: 'jane@acme.com' },
    seller: { name: 'Sam Lee', email: 'sam@acme.com' },
  },
  data: { purchase_price: '$250,000', closing_date: '10/15/2026' },
})

Find out what a template needs

GET /v1/templates/{id} returns roles (who must sign) and data_keys (what data to send, and which is required). Integration tools use this to build a mapping screen automatically.

"roles": ["buyer", "seller"],
"data_keys": [
  { "key": "purchase_price", "type": "text", "required": true },
  { "key": "closing_date", "type": "date", "required": false }
]

Next steps

Was this page helpful?