Templates
What's a template?
In DocLift, each final document will be generated from a template. You'll be able to edit the template at any time from an online editor in your account. The template will contain the static elements such as text, images, and titles. It might also include dynamic elements, in other words placeholders that can be put anywhere, allowing you to define content that may vary from one generated document to another.
There are two types of templates:
- Custom templates (
category: "custom"): templates designed using DocLift's online HTML editor. You have full control over the layout and content, and you define every variable yourself. - Fillable form templates (
category: "fillable_form"): templates created by uploading a PDF that already contains form fields. DocLift parses the PDF on upload, extracts each form field, and creates the corresponding variables for you — including the field type (text, checkbox, radio, select) and the allowed values for any drop-down or radio group. You do not author the variables yourself: re-uploading a new version of the PDF resynchronizes them.
Both types share the same Document Request API: once published, either can be used to generate documents with the exact same payload (see Document Requests API).
Create a template
To create a custom template, simply navigate to "Nouveau modèle de document" from your DocLift dashboard.
To create a fillable form template, navigate to "Nouveau formulaire remplissable" and upload your PDF file containing form fields.
Design your template
To design your custom template, you can navigate to your template page and click on the "Modifier" button. You'll end up on the DocLift template's online editor. It is very similar to other text editors, such as Microsoft Word. There are, however, some gotchas that you need to take into account:
- Page breaks You can control where each of your final PDF pages will break by inserting "Page breaks". To do this, place your cursor where you want the page to break, then navigate to "Insérer" at the top toolbar and click on "Saut de page".
- Columns If you need to divide a part of the template into columns, you'll have to use a table for this. To do this, place your cursor where you want to have columns and go to "Tableau" in the top menu. You'll then be able to choose the layout of the table (number of cols / rows). Once this is done, you can place your content inside the table. Note that you can hide the table borders by selecting the table and clicking in the top menu "Tableau" > "Propriétés du tableau". Then in the "Général" tab, set the border width to 0. From there you can also set a background color or define border width, shape, and color.
Template variables
A template can hold dynamic content such as text, numbers, dates, checkboxes, radio buttons, or select lists. This is done through variables.
Note: On custom templates, you define each variable yourself (in the editor or via the API). On fillable form templates, variables are derived from the uploaded PDF — the attributes below are populated automatically from the PDF form fields and cannot be edited individually. To change them, re-upload an updated PDF from the dashboard.
A template variable is defined by the following attributes:
- Title: The name of the variable. This must consist of alphanumeric characters ([A-Z] and digits [0-9]) and underscores. Be very precise when naming variables; otherwise, you might have trouble distinguishing them. For instance, if your variable is the first name of an investor, you should name it investor_first_name instead of just first_name. Otherwise, if you add a second person who has a first name, you won't be able to tell to whose first name a poorly worded variable like first_name refers.
- Description: This helps explain the exact content you expect to get with your variables. Descriptions are also useful to give details about formatting. For instance, if it's an amount, the following description is a good choice:
The amount of the investor's investment in the following format XXX,XXX.XX.
This way, we know that we should expect an amount with thousands delimiters and 2 decimals.
- Seed value: A sample value used for previewing the final rendering of your template. It can have any content.
- Field type: The type of the variable. Can be one of the following:
- text: a simple text variable (default)
- checkbox: a boolean variable rendered as a checked/unchecked checkbox
- radio: a variable with a predefined set of allowed values, rendered as radio buttons
- select: a variable with a predefined set of allowed values, rendered as a dropdown
- Allowed values (radio and select only): A list of accepted values for the variable. When generating a document, if the provided value is not in the allowed list, the API will return a 422 error with details about the invalid variable.
Create template variables
You can create a template variable directly from the online editor. If you need to create multiple variables at once, you can go to the template's page and click on "Modifier" in the variables' section.
Insert a text variable
You can insert text variables in your template. To do this, just place your cursor where you want to place the text variable and in the top toolbar select "Insérer une variable" > "Sous forme de texte" and choose the variable you need. When making your template dynamic, this variable will hold the value given to it, or no value if you didn't send any.
Insert a checkbox variable
You can insert a checkbox variable in your template. To do this, just place your cursor where you want to place the checkbox variable and in the top toolbar, select "Insérer une variable" > "Sous forme de checkbox" and choose the variable you need. When making your template dynamic, this type of variable will be replaced with a checked checkbox if you send any value for this variable or an unchecked checkbox if you didn't send any value.
Insert a radio or select variable
Radio and select variables work similarly to text variables, but they restrict the accepted values to a predefined list. Define the allowed values when creating the variable. When generating a document, the API will validate the provided value against the allowed list.
Previewing your template
DocLift online editor provides a live preview of your template's final result. To access it, just click on the "Desktop" icon in the top right corner of the editor. There's no need to refresh the page; each time you make changes to the template or its variables, the preview will automatically be kept up to date!
Fillable form templates
Fillable form templates let you reuse an existing PDF that already contains interactive form fields (text inputs, checkboxes, radio groups, drop-downs). Instead of recreating the layout in DocLift, you upload the PDF as-is and DocLift fills the existing form fields at generation time.
Upload a fillable form
From your DocLift dashboard, navigate to "Nouveau formulaire remplissable" and upload your PDF file. DocLift will parse the PDF, extract every form field, and create the corresponding template variables for you.
How fields are mapped to variables
For each form field in the PDF, DocLift creates a template variable with:
- title: the technical name of the field as defined in the PDF
- description: the field label as displayed in the PDF (falls back to the title if absent)
- field_type: inferred from the PDF widget:
- text inputs (single-line or multi-line) become
text - check boxes become
checkbox - radio button groups become
radio - combo boxes and list boxes become
select
- text inputs (single-line or multi-line) become
- allowed_values: for
radioandselectfields, the accepted values are read directly from the PDF (option list of the widget) - seed_value: the default value of the field if the PDF defines one
Variables are kept in sync with the PDF: re-uploading a new version of the PDF adds new fields, updates existing ones, and removes fields that no longer exist. You cannot create, edit or delete a fillable form's variables individually.
Generating documents from a fillable form
Once published, a fillable form template is used exactly like a custom template: send a document request with the template's id and the variables key/value pairs in the payload. DocLift opens the PDF and fills the form fields directly — no HTML rendering takes place, so the content is null and the orientation / margin fields are ignored at generation time.
When generating from a fillable form, DocLift also validates each provided value against the variable's allowed_values (for radio and select fields). If a value is not in the allowed list, the API responds with 422 Unprocessable Entity — see Variable validation errors.
API access
Fillable form templates are read-only through the API: they appear in GET /api/v1/templates and GET /api/v1/templates/:id (which embeds the auto-detected variables), and they can be used to generate documents through the Document Requests API. All write endpoints — including the dedicated Variables API endpoints — return 404 Not Found for fillable forms. Creating, updating, deleting, publishing and unpublishing a fillable form must be done from the DocLift dashboard.