Template object
Every template returned by the API includes these fields:Submitter roles
Every template defines one or more submitter roles. Each role represents a party who will sign or fill fields in the document. When creating a submission, you map real people to these roles.Field schema
Theschema array defines every fillable field in the template. Each field specifies its type, position on the document, which submitter role it belongs to, and optional defaults or constraints.
Field properties
Field areas
Each field has one or more areas defining its visual position on the document pages.Field types
DocuTrust supports 19 field types:Field validation
Add validation rules to text fields to enforce specific input formats. Validation is checked when the signer submits their form — invalid values display an error message and prevent completion until corrected. There are two ways to add validation to a field:- Preset validation — Use the
validationproperty with a preset name for common patterns (SSN, email, phone, etc.). - Custom regex — Use the
patternproperty with any regular expression string for custom formats.
Example: field with preset validation
Example: field with custom regex pattern
Validation presets
DocuTrust includes 11 built-in validation presets. Use thevalidation property on a text field to apply one:
When both
validation and pattern are set on a field, the pattern regex takes precedence. The validation preset is ignored in that case.Creating templates
From PDF
Upload one or more PDF files to create a template. DocuTrust extracts pages and creates a blank field schema that you can populate later.From DOCX
Upload a Word document. DocuTrust converts it to PDF internally while preserving layout and formatting.From HTML
Send raw HTML to create a template. This is useful for programmatically generating documents with dynamic layouts.Retrieving templates
Get a single template
List all templates
Filter by folder
Filter by external ID
Updating templates
Update a template’s name, schema, submitters, folder, or sharing settings with a PUT request.Fixing auto-mapping safely (API)
If AI smart setup assigned fields to the wrong submitter, use these endpoints instead of replacing the full schema:POST /api/templates/{id}/validate_assignments— dry-run validatorPOST /api/templates/{id}/remap_submitters— apply targeted remaps
1) Validate proposed remap
2) Preview remap (dry_run)
3) Apply remap
Validation checks returned by API
The validator returns structured issues such as:unknown_field_uuidunknown_submitter_uuidduplicate_field_assignmentsubmitter_without_fieldsrequired_submitter_missing_signature
Cloning templates
Create an independent copy of an existing template. The clone gets a new ID and slug but inherits the schema, submitters, and documents.The cloned template gets new submitter UUIDs. If you have code that references the original UUIDs, update it to use the new ones.
Merging templates
Combine two or more templates into a single document. This is useful for assembling contracts from modular sections (e.g., terms + addendum + signature page).AI field detection
DocuTrust can automatically analyze a template’s document and detect where fields should be placed. This is especially useful for complex PDFs with many signature lines, date fields, and text blanks.Managing documents
Replace or add documents
Upload new documents to an existing template:Download a document PDF
Retrieve the original uploaded document:Thumbnails
Get a thumbnail image of the first page:Archiving templates
Archive a template to remove it from active use. Archived templates are not deleted — existing submissions remain intact — but no new submissions can be created from them.This uses the HTTP DELETE method but performs a soft archive, not a permanent deletion. The template can still be retrieved via the API using its ID.
Formula fields
Formula fields compute their value dynamically from other fields using arithmetic expressions. Use them for calculated totals, taxes, discounts, and other derived values.Formula syntax
Add aformula property to any number field in the template schema. The formula can reference other fields by name using {Field Name} syntax and supports standard arithmetic operators.
Supported operators
Full example: invoice with tax
Formula evaluation uses safe arithmetic parsing — no arbitrary code execution. Only numeric values, field references, arithmetic operators, and parentheses are allowed. Division by zero returns
0.Dynamic payment pricing
Combine formula fields with thepayment field type to compute dynamic payment amounts based on signer input:
Conditional document display
Control which documents in a multi-document template are shown to the signer based on field values. Use thedocument_conditions property in the template preferences to define conditions.
Configuration
Setdocument_conditions in the template preferences via PUT /api/templates/:id:
Condition properties
Full example
A template with three documents — a base agreement, a premium addendum, and an enterprise addendum — where the addenda are shown conditionally based on the plan selection:Payment Method field (or any select/radio field referenced by field_uuid), document 43 (the premium addendum) is displayed. When they select “Enterprise”, document 44 is shown instead. The base agreement document (without a condition) is always shown.
Conditions are evaluated in real time as the signer fills in fields. Documents appear or disappear dynamically without page reload.
Document upload limits
Each decoded PDF, DOCX, or HTML source is limited to 25 MB by default, and each generated PDF is limited to 100 pages. Multipart uploads are checked before reading, while Base64 uploads use strict decoding and are checked both before and after decoding. DOCX and HTML sources are checked before conversion; the resulting PDF is page-checked before any template or document is stored. An over-limit request returns422 naming the file and applicable limit. Self-hosted operators
may adjust MAX_DOCUMENT_SIZE_MB and MAX_DOCUMENT_PAGES; invalid or non-positive values fall
back to the defaults above.