Document Generation

Upload a Word file as a template

Changed on

The Word file travels as base64 in a JSON body, not as multipart. The request body limit is 5 MB, so the Word file can be about 3.7 MB at most. The file's content controls become the template's field sheet; every field starts unconfirmed with a suggested source. The kind is a letter unless kind or the file name says agreement. Requires a person at or above member behind the key.

post/v1/doc-gen/templates

Request

  • Base URL
    https://api.talonic.com
  • Auth
    HTTP bearer

Request body

DocGenUploadTemplateRequest required
filename, string required
content_base64, string required

The .docx or .dotx bytes as base64; line breaks are allowed. Bounded by the 5 MB request body limit.

name, string

Defaults to the file name without its extension.

group, string
kind, 'letter' | 'agreement'
version, string

Defaults to a (MM-YYYY) date found in the file name.

Response

The created template with its field sheet.

DocGenTemplate required
id, string uuid
index, integer

Position in creation order, starting at 1.

name, string
file, string

The uploaded file name.

group, string

Empty when the template has no group.

kind, 'letter' | 'agreement'
pairId, string uuid nullable

The companion template generated with this one.

version, string

Empty when the template has no version.

fields, DocGenTemplateField[]
dataProductId, string uuid nullable

The data product the field sheet was last proposed for; null until a proposal ran.

updatedAt, string date-time
uploadedBy, string
generated, integer

How many batches used the template.

lastUsedAt, string date-time nullable

Changes