This guide shows how to save an envelope configuration as a reusable template and instantiate new envelopes from it on demand. Envelope Templates are useful for recurring signing workflows where the structure is fixed — NDAs, onboarding agreements, approval chains — but the recipients or documents change between instances.
Not familiar with the envelope structure yet? Read Create and Send Envelope first — the template follows the same structure.
Creating a template uses its own endpoint — POST /signatures/template/create. The top-level settings live under a template object rather than envelope, and since there's no real recipient yet, each recipient carries a templateRole placeholder instead of an email address:
POST https://api.doctavian.com/v1/signatures/template/create
Authorization: Bearer <token>
x-api-key: <api-key>
Content-Type: application/json
{
"template": {
"subject": "Please sign: NDA Agreement",
"message": "Please review and sign the attached NDA.",
"isSignOrder": false,
"expireInDays": "7",
"alertDaysBeforeExpiry": "1",
"firstReminderDays": null,
"repeatingReminderDays": null,
"notifyWhenOpened": true,
"notifyWhenSigned": true,
"templateName": "NDA Template",
"templateDescription": "Reusable NDA signing template",
"locale": "en",
"timezone": "Europe/Zagreb"
},
"documents": [
{
"referenceDocumentId": 0,
"name": "NDA Agreement",
"loadMethod": "Storage",
"urn": "af567f07-cafa-4d5c-830c-0f24af7555df"
}
],
"recipients": [
{
"referenceSignerId": 1,
"role": "signer",
"signOrder": "1",
"mandatory": true,
"isMFAEnabled": false,
"templateRole": "Counterparty"
}
],
"fields": [
{
"positionX": 100,
"positionY": 650,
"height": 60,
"width": 200,
"type": "signature",
"referenceFieldId": "1",
"name": "signature_counterparty",
"referenceDocumentId": 0,
"page": "1",
"isRequired": true,
"properties": null,
"referenceSignerId": "1"
}
]
}
templateRoleis a placeholder label (e.g."Counterparty") rather than a real recipient — there's no email address on a template recipient. You'll provide the actual name and email when creating an envelope from the template.
The response mirrors envelope creation — data.template.id is the template ID, with system-generated IDs for the document, recipient, and field, each mapped back to the local reference IDs you submitted:
{
"result": {
"statusCode": 201,
"message": "Created",
"data": {
"template": {
"id": "17e540aa-d1dd-4714-9cb3-2d28504a048d"
},
"documents": [
{ "id": "71c057f6-433e-4ca6-9367-0be821441294" }
],
"recipients": [
{ "id": "2908514c-b7b6-4080-9ded-2f441cd7c2ef" }
],
"fields": [
{
"id": "cd3084fe-1137-4735-afac-fa33c1749f9a",
"recipientId": "2908514c-b7b6-4080-9ded-2f441cd7c2ef",
"documentId": "71c057f6-433e-4ca6-9367-0be821441294"
}
]
}
}
}Save data.template.id — you'll need it to create an envelope from this template.
Instantiate a new envelope from the template with a single call. Override only what changes between instances — in this case, the recipient's email and the envelope subject:
POST https://api.doctavian.com/v1/signatures/template/{{templateID}}/envelope/create
Authorization: Bearer <token>
x-api-key: <api-key>
Content-Type: application/json
{
"envelope": {
"subject": "Please sign: NDA Agreement — Acme Corp",
"message": ""
},
"recipients": [
{
"templateRole": "Counterparty",
"name": "Jane Smith",
"email": "jane.smith@acmecorp.com"
}
]
}The resulting envelope inherits the full template configuration — documents, field placements, signing rules — with your overrides applied. The response mirrors a regular envelope create call:
{
"result": {
"statusCode": 201,
"message": "Created",
"data": {
"envelope": {
"id": "f8ffb194-8eb1-4bd5-ae4b-4d783a6a5019",
"status": "Draft"
},
"documents": [
{ "id": "a53cb557-a742-422d-919c-2ac5ecf001c4" }
],
"recipients": [
{ "id": "4c3a8ff0-5c2c-4db8-804b-cafc59f6205a" }
],
"fields": [
{
"id": "d4d09bc2-4bbe-4cca-8bd3-6fb28e91f434",
"recipientId": "4c3a8ff0-5c2c-4db8-804b-cafc59f6205a",
"documentId": "a53cb557-a742-422d-919c-2ac5ecf001c4"
}
]
}
}
}Save data.envelope.id — it's a standard envelope from here on, ready to send.
GET https://api.doctavian.com/v1/signatures/envelope/{{envelopeID}}/send
Authorization: Bearer <token>
x-api-key: <api-key>Setting up a template with multiple recipients? See Configure Signing Order to control how they sign.
Templates can be updated, edited, listed, or deleted independently of any envelopes created from them. Updating a template does not affect envelopes already created from it — changes apply only to future instantiations.
See the full set of template endpoints in the API Reference.