Skip to main content
POST
Create a template from markdown

Authorizations

Authorization
string
header
required

Workspace credential issued from the automation console at /automation. Send it as Authorization: Bearer vq_ws_.... This is NOT a Data API key: a vq_key_ credential is refused here and names the other product in the error.

Body

application/json

Author a template from markdown you supply.

Variables are detected for you, on this call, and the response carries what was found. A placeholder written as [COUNTERPARTY NAME], {{party_a}} or a run of underscores survives the markdown round trip as literal characters, and the detector re-derives the mark from it, so a template authored here cannot land in the state where it runs and interpolates nothing.

Detection is regex over the flattened text: deterministic, free and sub-millisecond. The product also has an LLM refinement pass and this API does not run it, so a template imported here may detect fewer variables than the same file imported in the browser. It refines display NAMES and adds spans the regex missed; the identifiers slotOverrides is keyed by are deliberately left alone by it either way.

title
string
required

Display name for the template.

Required string length: 1 - 300
Example:

"Mutual NDA"

contentMarkdown
string
required

The template body as markdown, placeholders included. Whitespace alone is refused: the converter answers it with a valid EMPTY document, which would be a template that renders a blank page.

Required string length: 1 - 500000
Example:

"# Mutual Non-Disclosure Agreement\n\n## 1. Confidential Information\n\nEach party may disclose information that is confidential and proprietary to the other party.\n"

description
string | null

What this template is for, in your own words.

Maximum string length: 2000
Example:

"Master services agreement with Acme for the 2026 platform rollout."

category
string | null

How you classify this template. Defaults to custom; free-form, not a drafting category.

Required string length: 1 - 100
Example:

"commercial"

Response

Successful Response

One template with everything needed to run it without guessing.

variables is the reason this model exists at all, and sections is here for the same reason a draft publishes them: a caller deciding WHICH template to run needs to read what it says, and the editor's own document model does not cross this boundary in either direction.

id
string
required

Public identifier, tpl_ followed by 32 hex characters. Name it when starting a run.

Example:

"tpl_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"

title
string
required

The template's display name.

Example:

"Master Services Agreement"

category
string
required

The template's category, as the customer classified it on upload.

Example:

"commercial"

createdAt
string<date-time>
required

When the template was created (RFC 3339).

Example:

"2026-08-19T14:32:10Z"

updatedAt
string<date-time>
required

When the template was last modified (RFC 3339).

Example:

"2026-08-19T14:32:10Z"

variables
TemplateVariable · object[]
required

Every fillable span, in document order. The id of each is what slotOverrides on a run is keyed by.

sections
DraftSection · object[]
required

The template body, section by section, with the placeholder text left in place. Send a replacement as contentMarkdown.

description
string | null

Free-text description of what the template is for.

Example:

"Master services agreement with Acme for the 2026 platform rollout."

sourceFilename
string | null

Filename of the document this template was created from. Published because it is how a person recognizes which template a run used, months later.

Example:

"msa-acme-v3.docx"

Last modified on August 23, 2026