Templates
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.
Create a template in the dashboard
- Open Developers, then Templates
- 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.
- 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, notfield_7. - 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 }
]