TemplateCode, instead of
sending the documents, fields, and process again on every call.
Templates are worth setting up when you send the same kind of package repeatedly: a standard NDA,
an employment contract, an onboarding pack. If the documents and field layout are stable and only
the signer changes from one send to the next, a template removes almost all of the per-call
construction work and keeps every package consistent.
Prerequisites
- A valid access token or Basic Auth credentials - see Platform Access
- Your tenant’s base URL set as
BASE_URL - A package you have already built and want to reuse (for creating a template), or an existing
TemplateCode(for creating packages from one)
Bearer authentication. Replace the token and variable values with your own.
Create a template from a package
Build a package the way you normally would - add its documents, stakeholders, actors, and fields - but leave it inDraft status. Then save it as a template with POST /packages/{packageId}/template.
The only field in the body is TemplateName, which must be unique within the package’s document
group.
The source package must be in
Draft status. Saving a package that has already been activated as a
template returns 409 Conflict. Build and configure the package, then save it as a template before
you activate any signing flow.List available templates
Retrieve the templates available in your tenant, with their codes, usingGET /templates:
Name and the TemplateCode you pass when creating a package:
pageNumber and
pageSize for pagination, documentGroupCode to return only templates in a given document group,
sort (asc or desc), and createdAfter / createdBefore to filter by creation date.
Create a package from a template
To create a package from a template, callPOST /packages with a TemplateCode. The package is
pre-populated with everything defined in the template.
In other words,
Initiator is the only thing you must supply beyond the TemplateCode. You can
override Name, ExternalReference, and ProofCorrelationId, but everything else - documents,
stakeholders, fields, callbacks, theme, and other package settings - comes from the template and
cannot be overridden in this call.
The response is the created package, in the same shape as
Get package. As with any package, you
can continue to add or change information with additional API calls after it is created.
Templates and super calls
A template cannot be combined with a super call.Placing template fields by marker
If the template defines unplaced elements that are matched to documents by text markers, theSingleMarkerMatchPerElement parameter controls how those element definitions are consumed as
documents are confirmed:
false(the default, ornull): an element definition can be matched by markers in multiple documents, and cleanup of any remaining unplaced elements is deferred.true: each element definition can be matched by only one marker during document confirmation, and the definition is removed once it has been placed.
UnplacedElements will be disregarded and removed.
For more on markers and the other ways to position fields, see
Field positioning.
When to use a template
Templates pay off when the structure of a package is stable and repeated:- Recurring documents - the same contract, form, or agreement sent many times.
- Stable field layouts - signing fields, checkboxes, and text fields always in the same place.
- Consistency - every package built the same way, with the same settings, reducing the chance of a per-call mistake.
Next steps
- Build a package step by step before saving it as a template in Send a document for signing
- Create everything in a single call (without a template) with an Instant package
- Position template fields with coordinates, markers, or existing form fields in Field positioning
- Understand how documents, stakeholders, actors, and elements relate in The package model