Skip to main content
POST
Create a template from an uploaded document

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

Turn a document you already uploaded into a template.

Takes a documentId rather than a file. Bytes reach this API exactly one way, through uploads.initiate and the presigned part PUTs, so there is one media allowlist, one size ceiling and one answer to encryption at rest. The cost is stated: importing a template is four calls rather than one, and the source file stays as a document you own, can list, can download and can delete, which is how "which contract did this come from" is answerable months later.

A DOCX-sourced template keeps its Word structure; a later templates.update does not. Replacing the body through this API replaces it with what markdown can express, so duplicate first if the original formatting matters.

documentId
string
required

doc_ identifier of a document in this organization to build the template from.

Example:

"doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"

title
string | null

Display name. Defaults to the document's filename.

Required string length: 1 - 300
Example:

"Master Services Agreement"

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.

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