Create template from scratch
create-template-from-scratchCreate a new empty template with editable ProseMirror content.
Use this tool when:
The user wants to start building a new template from scratch (not from an existing PDF or template)
The new template is created empty and its content is authored in a later step. The body references parties, dynamic fields and signature blocks by ref_uuid, so those have to exist before the content can point at them. Build the template in this order:
create-template-party for each contracting party.
create-template-signature-block for each party that signs.
create-template-dynamic-field for every value that varies per document - dates, amounts, notice periods, payment terms. A party's name or address is never one of them: both live on the party record and the content renders them from there.
replace-template-content once, with a body that references all of them by their ref_uuids and wraps each clause in an ordered list node so fynk numbers it.
Authoring the content first and adding the parties, fields and signature blocks afterwards forces a second, destructive rewrite of the whole body to weave the references in, so plan them up front. This applies just as much when the content is derived from a source document such as a PDF: every filled-in blank in the source is a dynamic field unless it holds party identity, and its signature lines are signature blocks.
The locale defines the template's content language and default number formats. Never ask the user for it - a
BCP 47 tag is not something they can be expected to know. Infer it from the conversation, e.g. the language the
content is to be written in or a country or jurisdiction the user names, and otherwise omit it, which falls back to
the account's locale.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the new template | |
| locale | No | BCP 47 locale tag defining the template content language and default number formats (e.g. "de-AT"). Never ask the user for this tag: infer it from the conversation, or omit it to use the account locale. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to open the template in fynk. Only present when your user has template editing permission | |
| name | No | Name of the template | |
| tags | No | The tags on the template. Tags are the account's own classification labels (e.g. relationship type, commercial significance, region), so they show which categories this account uses and can be filtered on with filter_tags. Only present when the 'tags' section is requested via the include parameter. | |
| uuid | No | Unique identifier for the template. Do not show to the user unless they ask for it | |
| teams | No | The teams the template is assigned to. Only present when the 'teams' section is requested via the include parameter. | |
| locale | No | Locale code, e.g. en-GB, de-AT. Prefer describing the locale in natural language (e.g. 'British English') rather than showing the raw code. | |
| parties | No | The contracting entities the template defines. Only present when the 'parties' section is requested via the include parameter. | |
| published | No | Indicates if the template is published (true) or a draft (false). Only published templates can be used by users without template management permission | |
| conditions | No | The template's conditions: rules over its dynamic fields deciding whether a passage of the template applies, and whether each currently holds. Use them to explain why a clause is or is not part of the template, and what would have to change to flip it. Only present when the 'conditions' section is requested via the include parameter. | |
| created_at | No | When the template was created. Only present when the 'timestamps' section is requested via the include parameter. | |
| updated_at | No | When the template was last updated. Only present when the 'timestamps' section is requested via the include parameter. | |
| archived_at | No | When the template was archived. Absent when the template is not archived. Only present when the 'timestamps' section is requested via the include parameter. | |
| description | No | Description of the template. Absent when the template has none. Only present when the 'details' section is requested via the include parameter. | |
| signatories | No | The individual people who sign documents created from this template. Distinct from parties: a signatory often signs on behalf of a party (e.g. a business), so a person may be a signatory without appearing as a party. Only present when the 'signatories' section is requested via the include parameter. | |
| _entity_type | No | Only relevant for tooling. Do not show to the user | |
| document_type | No | If present, indicates what kind of document this template creates. Absent when the template has no type assigned | |
| dynamic_fields | No | The template's dynamic fields and their values. Only present when the 'dynamic_fields' section is requested via the include parameter. | |
| signature_type | No | The eIDAS assurance level that will be used when signing documents created from this template. Absent when none has been chosen. Only present when the 'signing_settings' section is requested via the include parameter. | |
| metadata_values | No | The template's metadata fields and their values. Only present when the 'metadata_values' section is requested via the include parameter. | |
| signature_blocks | No | The places in the template that are signed. A block is bound either to a single signatory or to a party, in which case every signatory of that party signs it. Only present when the 'signature_blocks' section is requested via the include parameter. | |
| sequential_signing | No | Whether signatories must sign in a specific order. Only present when the 'signing_settings' section is requested via the include parameter. |