Skip to main content
GET
Get one DocumentTemplate
A DocumentTemplate is a location-scoped reusable layout for generating customer, booking, contract, and proposal documents. Designer templates (Editor = Designer) are authored as a design (DesignJson) with fields, conditions, repeats and signature blocks for a DataContext and compiled to Liquid HTML; Classic templates use Liquid source or an uploaded mail-merge document.

Authentication

This endpoint requires OAuth2 authentication. Include a valid bearer token in the Authorization header. The authenticated user must be a full unrestricted administrator or have the DocumentTemplate-Read role.

Path Parameters

integer
required
The Id of the DocumentTemplate record to retrieve.

Code Examples

Response

200

integer
ID of the required location that owns this document template; only operators linked to that location can see or use it..
string
Display value for Business.Name..
string
Required name used to identify this document template to operators; also used as the file name of documents generated from it..
string
Liquid HTML source rendered for Classic templates when TemplateOutputFormat is Html or Word. The variables available come from the data context built for the record the document is generated for (Location, Customer, Contract, Proposal and Booking roots), falling back to a small legacy set when no context can be built. For Designer templates this is generated from DesignJson on every save, so any value sent here is overwritten; change DesignJson instead..
string
Current file name of the binary document (read-only; upload via the corresponding URL field).
string
URL of a new file to upload as the binary document.
boolean
Set to true to remove the current binary document file.
integer
Selects the generated format: Html, Word (Liquid source converted to a Word document) or Binary (the uploaded BinaryDocument used for mail merge, so it only makes sense together with an uploaded file). Saving a Designer template forces this back to Html.. See eDocumentTemplateFormat enum values: 1 = Html, 2 = Word, 3 = Binary.
integer
Which editor owns the template: Classic (uploaded Word document merged with TX Text Control, or raw Liquid HTML) or Designer (a design authored in the Document Designer and compiled to Liquid HTML). Designer templates require DataContext and DesignJson, are validated and compiled on every save, and have TemplateOutputFormat forced to Html and any uploaded BinaryDocument cleared..
integer
What the template is about: Customer, Contract, Proposal or Booking. Decides which data roots (Location, Customer, Contract, Proposal, Booking) the design can use. Designer templates must set one of the four; saving a Designer template while this is Unspecified is rejected. Classic templates leave it Unspecified..
string
Document Designer design (JSON, schema version 1) for Designer templates, holding the blocks, fields, conditions, repeats and signature blocks. Validate it with the document_template_designer tool before saving; the platform validates it again and compiles it into Document (Liquid HTML) on save, and a failed validation aborts the save. Ignored for Classic templates..
integer
Read-only schema version of the last compiled design, set by the platform when a Designer template is saved (currently 1); 0 when the template has never been compiled from a design. Change DesignJson to recompile..
string
Read-only UTC timestamp of the last time Document was compiled from DesignJson, set by the platform when a Designer template is saved; empty for Classic templates..
integer
Unique record identifier.
string
UUID of the record.
string
Date and time the record was created (ISO 8601).
string
Date and time the record was last updated (ISO 8601).
string
Email of the user who last updated this record.
boolean
Whether the record was recently created.
string
External system identifier.
Example Response