Skip to content

Templates

These endpoints let your own systems do what the File templates page does in the app: manage templates from code, read what data a template needs, and work with templates that follow a file in a drive. To turn a template into a document, go to Generated files.

If you are new to templates, read Templates overview first. To make your first call, start with the API overview.

The overview explains sending requests and lists, and the errors page the errors every endpoint can answer. Each list below names the fields it accepts. Authentication explains how keys work.

GET /v1/templates/{id} and every endpoint that changes a template answer with this object. Rows of GET /v1/templates have the same fields.

Field Type Meaning
id string The template’s identifier. In the app, Copy ID gives you the same value.
name string Its name.
type string word, svg or pdf.
version integer Starts at 1. It goes up when the file is replaced or a PDF template’s areas change, and stays put for a change of name or metadata. Each generation records the version it used.
templateFile object The file, see below.
metadata object or null The template’s metadata. null when it was never set. Emptied metadata, and an empty group inside it, come back as {}.
variables array of strings The variable paths a generation has to give, such as client.name. A PDF template’s list leaves out the values of areas with a condition. For the full list, what each value is and whether it is required, call data_structure.
pdfFields array A PDF template’s areas. Empty for other types.
contactBindings array The values packages made from it fill from their parties’ contacts. Empty when none.
dataSources array A PDF template’s data sources. Empty when none, and for other types.
createdAt, updatedAt string When it was created and last changed, in ISO 8601 with an offset.
lastUsedAt string or null The last attempt to generate from it, successful or not. null when it has not been used.
successGenerations integer How many documents were generated from it.
failedGenerations integer How many generations from it failed.
source object or null The cloud file it follows. null for an uploaded template.

templateFile has these fields:

Field Type Meaning
fileId string The stored file’s identifier.
filename string Its name.
size integer Its size in bytes.
content string or null For an SVG template, the file as a data:image/svg+xml;base64,... address. null for Word and PDF, and in every row of GET /v1/templates. Use download for those.
{
"id": "01a1aaf4-d812-7f81-87f3-a2a24628d795",
"name": "Service agreement",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1aaf4-d80f-7db8-b600-ec0c0f96c081",
"filename": "service-agreement.docx",
"content": null,
"size": 2674
},
"metadata": { "company": {"name": "Northbridge Advisory sp. z o.o."} },
"variables": [
"agreement.date",
"agreement.end_date",
"agreement.number",
"agreement.payment_days",
"agreement.start_date",
"agreement.total",
"client.address",
"client.name",
"client.representative",
"client.vat_id",
"services.delivery",
"services.fee",
"services.name"
],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-07-27T10:00:00+02:00",
"updatedAt": "2026-11-05T13:57:15+01:00",
"lastUsedAt": "2026-11-05T13:57:15+01:00",
"successGenerations": 34,
"failedGenerations": 1,
"source": null
}

A template that follows a cloud file carries this in source. Documents always come from the copy Doxtly holds, and these fields say where that copy stands against the file in the drive.

Field Type Meaning
integrationId string or null The storage integration. null if it no longer exists.
integrationName string or null The integration’s name.
provider string or null google_drive, one_drive, sharepoint, dropbox or box.
fileId string The file’s identifier at the provider.
path string Where the file is, for display.
webUrl string or null A link that opens the file at the provider.
nativeType string or null document for a Google Doc, which is read as the Word file Drive exports it to. null for a file with bytes of its own.
status string See the table below.
statusReason string or null Why the latest version was not taken, in words a person can read. Set with update_failed.
checkedAt string or null When the file was last looked at.
pendingRevision object or null The new PDF waiting for review. null when nothing waits.
status What it means What to do
synced The copy is the file as it is now. Nothing.
review_required A new PDF waits for someone to look at it. Approve or dismiss it.
update_failed A new version could not be used. See statusReason. Fix the file in the drive.
update_dismissed Someone turned the new version down. Nothing, unless you change your mind in the drive. A later version is looked at again.
source_missing The file is gone or no longer visible to the integration. Restore it, point the template at another file, or stop following.
reconnect_required The integration lost its connection. Connect it again.

pendingRevision has these fields:

Field Type Meaning
contentHash string Names this version. You send it back when you decide about it.
filename string The new file’s name.
size integer Its size in bytes.
detectedAt string or null When Doxtly found it.
comparison object or null The pages of both files.
comparison.previousPages, comparison.currentPages array One entry per page, each with width, height (in points) and rotation.
comparison.sameGeometry boolean true when every area lands in the same place on the new file.
{
"integrationId": "01a1ab0c-4436-705d-84fa-23b997395c43",
"integrationName": "Company Google Drive",
"provider": "google_drive",
"fileId": "gd15E",
"path": "Contracts/Templates/course-certificate.pdf",
"webUrl": "https://drive.google.com/file/d/gd15E/view",
"nativeType": null,
"status": "review_required",
"statusReason": null,
"checkedAt": "2026-11-05T14:26:53+01:00",
"pendingRevision": {
"contentHash": "b49b006e913ab5daf081064a59021ed62ac55bb4ce36dcd0d1a6e5ffa3f4136b",
"filename": "course-certificate.pdf",
"size": 75505,
"detectedAt": "2026-11-05T14:26:26+01:00",
"comparison": {
"previousPages": [{"width": 841.92, "height": 595.92, "rotation": 0}],
"currentPages": [{"width": 595.92, "height": 842.88, "rotation": 0}],
"sameGeometry": false
}
}
}

A PDF template is a file plus a list of areas, sent and returned in pdfFields. Each area is a rectangle on a page, bound to a value. PDF template fields explains what each setting does on the page; this section gives the exact form. A template can have up to 500 areas.

Field Type Required Meaning
id string No Unique within the template. Left out, Doxtly assigns one.
type string Yes text, date, select, checkbox, image, drawing, signature, initials, computed, qrcode or barcode.
variable string For data areas The path of the value, up to 255 characters: letters, digits and underscores, in parts joined by dots, such as client.name. It cannot start with a digit. A manual area may leave it empty. A manual text, checkbox or image area cannot use a path starting with _.
page integer No The page, from 1. Default 1.
rect object Yes x, y, width and height in points (72 per inch), measured from the bottom-left corner of the page. x and y cannot be negative. width and height are at least 1.
source string No data (default) fills the area from the request. manual leaves it for a recipient. QR codes and barcodes are always data.
party string No The party that fills or signs it, such as CLIENT. It starts with a letter and uses letters, digits and underscores. Doxtly stores it in capitals.
required boolean No Default false.
label string No Up to 128 characters.
placeholder string No Up to 128 characters.
pattern string No For a manual text area: a regular expression, up to 255 characters, that the whole typed value must match.
patternMessage string No For a manual text area: the message shown when the value doesn’t match, up to 200 characters.
minLength, maxLength integer No For a manual text area: from 1 to 10000.
text, date, select, checkbox, image, drawing, signature, computed, qrcode, barcode object No The options of the area’s type, see below. initials uses signature. Only the object that matches type is kept.
code object No For qrcode and barcode: {"mode": "fixed" or "formula", "value": "..."}, up to 400 characters. Without it the code encodes the value at variable.
condition object No Renders the area only when the condition holds, see below.

In a response, pdfFields comes back sorted by page, then from the top of the page down. A setting of the area that has no value is left out. The options object is always complete, with gridCells and gridCellWidth as null when they are not set.

text

Field Values Default
fontFamily sans_unicode, helvetica, times, courier sans_unicode
fontSize 4 to 96 points 11
minFontSize The smallest size shrinking may reach: from 4 to fontSize 6, or fontSize if smaller
color #rrggbb #111827
bold, italic boolean false
align left, center, right left
verticalAlign top, middle, bottom middle
multiline boolean false
lineHeight 0.8 to 3 1.25
shrinkToFit boolean true
letterSpacing -5 to 60 points 0
layout flow, or grid for one character per box flow
gridCells 1 to 100 none
gridCellWidth Above 0, in points none

checkbox

Field Values Default
style check, cross, square, dot check
color #rrggbb #111827
scale 0.2 to 1 0.8

signature

Field Values Default
preserveAspectRatio boolean true

image

Field Values Default
fit contain, cover, fill contain
align left, center, right center
verticalAlign top, middle, bottom middle

qrcode

Field Values Default
errorCorrection L, M, Q, H M
color #rrggbb #000000

barcode

Field Values Default
format code128, code39, code93, ean13, ean8, upca, itf, codabar, code11, msi code128
color #rrggbb #000000
showText boolean true

date

Field Values Default
mode date, time, datetime date
format A date format such as d MMMM yyyy The language’s own
constraints The allowed dates of a form field None

select

Field Values
options 1 to 200 of {"value": "...", "label": "..."}, each value once and up to 255 characters. The label is printed, the value is what workflows get.

computed

Field Values
expression A formula, required. A circular reference is refused.
format The value’s format: kind (auto, number, text, date, datetime), precision, minIntegerDigits, separators, prefix, suffix, pattern, fallback.

drawing

Field Values Default
color #rrggbb #000000
recipientPicksColor boolean true
strokeWidth thin, medium, thick medium
showPage boolean true
allowText boolean true
allowShapes boolean true

condition

Field Values
match all (default) or any
rules From 1 to 20 rules, each with path, operator and value
rules[].path The value to read, such as client.type or _metadata.region
rules[].operator equals, not_equals, contains, not_contains, greater_than, greater_or_equal, less_than, less_or_equal, is_empty, is_not_empty, is_true, is_false
rules[].value Up to 255 characters. Not used by is_empty, is_not_empty, is_true and is_false.

A condition with no rules counts as no condition. Print conditions explains how values compare.

[
{
"id": "53495347-6e04-46ca-a1bc-b1b8caec5c83",
"type": "text",
"variable": "participant.name",
"page": 1,
"rect": {
"x": 172.3125,
"y": 333.82296875,
"width": 497.26171875,
"height": 48.1875
},
"source": "data",
"required": false,
"label": "Participant",
"text": {
"fontFamily": "sans_unicode",
"fontSize": 24,
"minFontSize": 6,
"color": "#1f3a5f",
"bold": true,
"italic": false,
"align": "center",
"verticalAlign": "middle",
"multiline": false,
"lineHeight": 1.25,
"shrinkToFit": true,
"letterSpacing": 0,
"layout": "flow",
"gridCells": null,
"gridCellWidth": null
}
},
{
"id": "0f611374-46d5-4336-989e-49968a7832a9",
"type": "qrcode",
"variable": "_metadata.verify_url",
"page": 1,
"rect": {
"x": 680.90625,
"y": 75.95187499999997,
"width": 73.69921875,
"height": 73.69921875
},
"source": "data",
"required": false,
"label": "Verification code",
"qrcode": { "errorCorrection": "M", "color": "#1f3a5f" }
}
]

An area that breaks one of the rules above answers 422, and the violations entry points at the value and says what is wrong. Its field looks like pdfFields[3].variable, pdfFields[0].text.fontSize or pdfFields[2].rect. A wrong color is reported on the area, as pdfFields[1]. More than 500 areas, or a pdfFields that is not a list, is reported as pdfFields. Expect one problem at a time: fix it, send the request again, and the next one shows up.

The fixed choices work differently. A fontFamily, align, style, format or any other option outside its list of values is not refused: the area takes the default, so read the saved area back if you are not sure. The same goes for source and match. An unknown type or rules[].operator is refused.

GET/v1/templates

Reads your organization’s templates a page at a time, with how many documents each one produced. Use it to fill a picker in your own system, or to find the templates that need attention.

Key permission: get_templates

Headers: X-Api-Key, X-Api-Secret

This list takes the common list parameters.

You can use Fields
filter id, name, type, version, createdAt, updatedAt, lastUsedAt
filter[sourceAttention][eq]=true Only the templates whose cloud file is in any status but synced. It takes eq and the value true or 1.
filter[source][isNull] Only uploaded templates. Use isNotNull for the ones following a cloud file.
search name
sort id, name, type, version, createdAt, updatedAt, lastUsedAt

Response: 200 with items and meta. Each row is a template object, with templateFile.content always null.

Errors: only the common ones, and 400 for a list parameter it cannot use.

Terminal window
curl -G 'https://api.doxtly.com/v1/templates' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
--data-urlencode 'search[name]=agreement' \
--data-urlencode 'filter[type][eq]=word' \
--data-urlencode 'sort=-lastUsedAt' \
--data-urlencode 'perPage=2'

Response 200:

{
"items": [
{
"id": "01a1aaf4-d812-7f81-87f3-a2a24628d795",
"name": "Service agreement",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1aaf4-d80f-7db8-b600-ec0c0f96c081",
"filename": "service-agreement.docx",
"content": null,
"size": 2674
},
"metadata": { "company": {"name": "Northbridge Advisory sp. z o.o."} },
"variables": [
"agreement.date",
"agreement.end_date",
"agreement.number",
"agreement.payment_days",
"agreement.start_date",
"agreement.total",
"client.address",
"client.name",
"client.representative",
"client.vat_id",
"services.delivery",
"services.fee",
"services.name"
],
"pdfFields": [],
"createdAt": "2026-07-27T10:00:00+02:00",
"updatedAt": "2026-11-05T13:57:15+01:00",
"lastUsedAt": "2026-11-05T13:57:15+01:00",
"successGenerations": 34,
"failedGenerations": 1,
"source": null
},
{
"id": "01a1ab61-325b-707a-bcb9-e470aa997c09",
"name": "Service agreement",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1ab61-3258-7a88-816f-2d7a17f1823d",
"filename": "service-agreement.docx",
"content": null,
"size": 2519
},
"metadata": null,
"variables": [
"client_name",
"company",
"company_address",
"includes_training",
"service_package",
"tax_id"
],
"pdfFields": [],
"createdAt": "2026-11-05T12:03:56+01:00",
"updatedAt": "2026-11-05T13:45:55+01:00",
"lastUsedAt": "2026-11-05T13:45:55+01:00",
"successGenerations": 6,
"failedGenerations": 0,
"source": null
}
],
"meta": {
"total": 3,
"page": 1,
"perPage": 2,
"totalPages": 2,
"hasMore": true,
"hasPrevious": false
}
}

POST/v1/templates

Available when: your plan includes the template's type (SVG templates take a paid plan), and you are below its limit of templates

Adds a template made of a file you upload or a file in a connected drive. Use it when another system owns your document designs and publishes them to Doxtly.

Key permission: create_template. To use a file in a drive, the key also needs Browse cloud files (get_cloud_files) or Download cloud files (download_cloud_file).

Headers: X-Api-Key, X-Api-Secret. Content-Type: multipart/form-data to upload a file. For a file in a drive, you can also send application/json.

Field Type Required Rules
name string Yes Up to 128 characters. Names do not have to be unique.
type string No word (default), svg or pdf.
templateFile[file] file One of the two Up to 10 MB. Its content has to match type: a .docx for word, an SVG for svg, a PDF for pdf. The file’s name alone does not count, and a damaged Word file is refused.
cloudFile object One of the two The file in a drive, see below. You cannot send both.
metadata object No Values and nested objects the template can read as _metadata.*. Text and numbers are kept as they are, true becomes "1", false becomes an empty text, and null is dropped. In a multipart request, send it as a JSON string.
pdfFields array No For a pdf template only: its areas. In a multipart request, send it as a JSON string.
dataSources array No For a pdf template only: its data sources. In a multipart request, send it as a JSON string.

cloudFile has these fields. In a multipart request, send them as cloudFile[integrationId] and so on.

Field Type Required Rules
integrationId string Yes The UUID of the storage integration.
fileId string Yes The file’s identifier at the provider, up to 255 characters.
revision string No The revision you looked at, up to 255 characters. If you send it and the file has changed since, the request is refused. An empty value counts as none.

Response: 201 with the template object. The Location header gives its path, such as /v1/templates/01a1aaf4-d812-7f81-87f3-a2a24628d795.

Doxtly reads the variables from the file while it saves, so variables is filled in the answer. For a PDF template, they come from the areas.

Status When
400 The integration does not store files.
403 Your plan does not include templates or this type, or you reached the plan’s limit of templates (delete one to make room). The key cannot look at cloud files. The provider refused access to the file in the drive.
404 The integration or the file in the drive was not found.
409 The file changed after the revision you sent (template_source_changed). The integration is inactive or has to be connected again.
422 Validation failed: no name, name too long, unknown type, no file, both a file and a cloudFile, a file over 10 MB, a file that does not match type, pdfFields on a type other than pdf, an area that breaks a rule, or metadata that is not valid JSON.
422 The file passes as a Word file but cannot be read: The file cannot be read as a Word document: it is damaged, or of another kind. This goes for an upload and for a file in a drive. Nothing is saved, so no template is left behind.
422 The drive’s file cannot be a template: template_source_wrong_type, template_source_not_a_file (a folder), template_source_native_document (Google Sheets, Slides and the like), template_source_too_large, template_source_export_too_large (a Google Doc Drive will not export, over 10 MB). A Google Doc is taken for word templates, as the Word file Drive exports it to; for another type it is template_source_wrong_type.
429 The drive’s provider is limiting requests. Wait and try again.
503 The drive’s provider cannot be reached right now.

Failures that come from the drive carry a code too, so your code can tell them apart: integration_not_found, not_found, not_storage, integration_inactive, reconnect_required, access_denied, rate_limited and unavailable.

The errors every endpoint can answer apply here too.

Upload a Word file:

Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-F 'name=Non-disclosure agreement' \
-F 'type=word' \
-F 'templateFile[file]=@nda.docx' \
-F 'metadata={"company":{"name":"Northbridge Advisory"}}'

Response 201:

{
"id": "01a1abe3-1039-7c33-bf27-ce96b4867b99",
"name": "Non-disclosure agreement",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1abe3-1037-7b9f-9001-21f8098b0bfd",
"filename": "nda.docx",
"content": null,
"size": 2370
},
"metadata": { "company": {"name": "Northbridge Advisory"} },
"variables": [
"nda.date",
"nda.purpose",
"nda.years",
"partner.address",
"partner.name",
"partner.representative"
],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-05T14:25:47+01:00",
"updatedAt": "2026-11-05T14:25:47+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": null
}

Upload a PDF with its areas:

Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-F 'name=Course certificate (partners)' \
-F 'type=pdf' \
-F 'templateFile[file]=@course-certificate.pdf' \
-F 'pdfFields=[{"type":"text","variable":"participant.name","page":1,"rect":{"x":170,"y":300,"width":500,"height":40},"text":{"fontSize":28,"align":"center"}}]'

Follow a file in a drive:

Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{
"name": "Client proposal",
"type": "word",
"cloudFile": {
"integrationId": "01a1ab0c-4436-705d-84fa-23b997395c43",
"fileId": "gdUI"
}
}'

Response 201:

{
"id": "01a1abe3-1198-7e36-9044-158dbf3b3606",
"name": "Client proposal",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1abe3-1198-799a-9044-158dbedfe739",
"filename": "Service agreement.docx",
"content": null,
"size": 2674
},
"metadata": null,
"variables": [
"agreement.date",
"agreement.end_date",
"agreement.number",
"agreement.payment_days",
"agreement.start_date",
"agreement.total",
"client.address",
"client.name",
"client.representative",
"client.vat_id",
"services.delivery",
"services.fee",
"services.name"
],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-05T14:25:47+01:00",
"updatedAt": "2026-11-05T14:25:47+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": {
"integrationId": "01a1ab0c-4436-705d-84fa-23b997395c43",
"integrationName": "Company Google Drive",
"provider": "google_drive",
"fileId": "gdUI",
"path": "Contracts/Templates/Service agreement.docx",
"webUrl": "https://drive.google.com/file/d/gdUI/view",
"nativeType": null,
"status": "synced",
"statusReason": null,
"checkedAt": "2026-11-05T14:25:47+01:00",
"pendingRevision": null
}
}

GET/v1/templates/{id}

Returns one template with everything its page in the app shows. Use it to check a template’s version, or whether its source needs attention.

Key permission: read_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 200 with the template object.

Errors: only the common ones.

Terminal window
curl 'https://api.doxtly.com/v1/templates/01a1aaf4-d812-7f81-87f3-a2a24628d795' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET"

Response 200:

{
"id": "01a1aaf4-d812-7f81-87f3-a2a24628d795",
"name": "Service agreement",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1aaf4-d80f-7db8-b600-ec0c0f96c081",
"filename": "service-agreement.docx",
"content": null,
"size": 2674
},
"metadata": { "company": {"name": "Northbridge Advisory sp. z o.o."} },
"variables": [
"agreement.date",
"agreement.end_date",
"agreement.number",
"agreement.payment_days",
"agreement.start_date",
"agreement.total",
"client.address",
"client.name",
"client.representative",
"client.vat_id",
"services.delivery",
"services.fee",
"services.name"
],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-07-27T10:00:00+02:00",
"updatedAt": "2026-11-05T13:57:15+01:00",
"lastUsedAt": "2026-11-05T13:57:15+01:00",
"successGenerations": 34,
"failedGenerations": 1,
"source": null
}

PUT/v1/templates/{id}

Saves a template’s name, type, file, metadata and areas. Everything but name is optional, and what you leave out stays as it is. To rename a template, send only name.

Key permission: update_template. To point it at another file in a drive, the key also needs Browse cloud files or Download cloud files. Naming the file it already follows does not.

Headers: X-Api-Key, X-Api-Secret. Content-Type: multipart/form-data to upload a file, application/json or multipart otherwise.

Path parameter Meaning
id The template’s identifier.
Field Type Required What it does
name string Yes Up to 128 characters. Send the current name if it does not change.
type string No word, svg or pdf. Left out, the type stays. Changing it needs a file of the new type: upload one, or the file it has must already be of that type.
templateFile[file] file No Replaces the file. Up to 10 MB, of the template’s type, and readable, as on create.
templateFile[fileId] string No The current templateFile.fileId, sent without a file: keeps the file. Leaving templateFile out does the same. Any other id is ignored.
cloudFile object No Follow this file in a drive, as on create. You cannot send it with templateFile[file].
metadata object No Replaces the metadata. Left out, it stays. Send {} to clear it.
pdfFields array No Replaces the areas. Left out, they stay. Send [] to clear them. A template of another type ignores them.
dataSources array No Replaces the data sources of a pdf template. Left out, they stay. Send [] to remove them. A template of another type ignores them.

What a change sets off:

  • A new file clears a PDF template’s areas, whatever pdfFields you send in the same request. Each area is a position on the old file, and the new file may not have it. Send the areas again in a second request.
  • Uploading a file stops the template following its cloud file. The upload is now the template.
  • version goes up when the file changes or the areas differ from before. It does not move for a new name or new metadata.
  • variables are read again when a new file arrives, and for a PDF template on every save.
  • Naming the file the template already follows, at the revision it holds, changes nothing. Neither does a new revision with the same bytes.
  • Naming that file when its content has changed takes the new version straight away. There is no review, even for a PDF: its areas are cleared and a version waiting for review is dropped. To keep the areas, use source/check and review instead.
  • Changing the type away from PDF drops the areas.

Response: 200 with the template object.

Status When
400 The integration does not store files.
403 Your plan does not include the new type. The key cannot look at cloud files. The provider refused access to the file in the drive.
404 The template, the integration or the file in the drive was not found.
409 The file changed after the revision you sent (template_source_changed). The integration is inactive or has to be connected again.
422 Validation failed: name missing or too long, unknown type, a templateFile with neither a file nor a fileId, both an upload and a cloudFile, a file over 10 MB, an upload that does not match the type, a type change the kept file does not fit, pdfFields with a type other than pdf, an area that breaks a rule, or metadata that is not valid JSON.
422 A Word file that cannot be read, or a drive’s file that cannot be a template, as on create. The template, its name and its file stay as they were.
429 The drive’s provider is limiting requests.
503 The drive’s provider cannot be reached right now.

The errors every endpoint can answer apply here too.

Rename a template and update its metadata:

Terminal window
curl -X PUT 'https://api.doxtly.com/v1/templates/01a1abe3-1039-7c33-bf27-ce96b4867b99' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{
"name": "Non-disclosure agreement 2027",
"metadata": { "company": { "name": "Northbridge Advisory", "city": "Gdańsk" } }
}'

Response 200:

{
"id": "01a1abe3-1039-7c33-bf27-ce96b4867b99",
"name": "Non-disclosure agreement 2027",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a1abe3-1037-7b9f-9001-21f8098b0bfd",
"filename": "nda.docx",
"content": null,
"size": 2370
},
"metadata": { "company": {"name": "Northbridge Advisory", "city": "Gdańsk"} },
"variables": [
"nda.date",
"nda.purpose",
"nda.years",
"partner.address",
"partner.name",
"partner.representative"
],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-05T14:25:47+01:00",
"updatedAt": "2026-11-05T14:25:47+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": null
}

Replace the file:

Terminal window
curl -X PUT 'https://api.doxtly.com/v1/templates/01a1abe3-1039-7c33-bf27-ce96b4867b99' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-F 'name=Non-disclosure agreement 2027' \
-F 'templateFile[file]=@service-agreement-2027.docx'

DELETE/v1/templates/{id}

Removes a template for good, and much goes with it: its file, a version waiting for review, every record in the list of generated files, the saved PDFs, and the data they were generated from. Items of interactive documents built on the template are removed too. A generated PDF that a signing document was made of stays with that document.

While a workflow names the template, Doxtly refuses to delete it and lists those workflows, so change them first. If you only want to stop using a template but keep its history, leave it in place.

Key permission: delete_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 204 with no body.

Status When
409 Workflows still use it (code used_by_workflows, with workflows: their id and name). Change them first. Nothing is deleted.
409 A signing document was made of the template’s own file, so the file cannot be deleted. Nothing changes: the template, its history and a version waiting for review all stay.

The errors every endpoint can answer apply here too.

Terminal window
curl -X DELETE 'https://api.doxtly.com/v1/templates/01a1abe3-a946-7333-a14d-9dae63f315f1' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET"

The response is 204 with no body.

POST/v1/templates/{id}/duplicate

Makes a new template from an existing one, for a document that is mostly the old one. The copy has the same type, file, areas, metadata, variables, data sources and values filled from contacts; its file is stored again as its own, so changing or deleting either template leaves the other as it is. It starts at version 1 with no generated files, and follows no cloud file even when the original does (source is null). It takes the name you send in title; without one, the original’s with the word for a copy at the end, in the language of the answers: “ (copy)” for Accept-Language: en, “ (kopia)” when you send none. See Duplicating a template.

Key permission: duplicate_template (Duplicate template)

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Body: optional, JSON.

Field Type Description
title string The copy’s name, up to 255 characters. Spaces around it are removed, and the name keeps its first 128 characters, the most a template’s name holds. Leave it out for the original’s name with the word for a copy after it.

Response: 201, with the copy in the shape of Get a template, and its path in the Location header.

Status When
403 Your plan’s limit of templates is reached, the plan doesn’t include the template’s type, or there is no disk space left for its file. Nothing is created.
404 No template has this id in your organization.
422 title is blank or longer than 255 characters.

The errors every endpoint can answer apply here too.

Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates/01a1aaf4-d812-7f81-87f3-a2a24628d795/duplicate' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{"title": "Service agreement, public sector"}'

Response 201, with variables shortened:

{
"id": "01a205a1-7c3e-7b52-8d14-2f6a9e0c4b18",
"name": "Service agreement, public sector",
"type": "word",
"version": 1,
"templateFile": {
"fileId": "01a205a1-7c3b-7e09-a3f1-5d8c2b7e6a40",
"filename": "service-agreement.docx",
"content": null,
"size": 2674
},
"metadata": { "company": {"name": "Northbridge Advisory sp. z o.o."} },
"variables": ["agreement.date", "agreement.number", "client.name"],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-22T18:44:03+01:00",
"updatedAt": "2026-11-22T18:44:03+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": null
}

Convert a Word document to a PDF template’s file

Section titled “Convert a Word document to a PDF template’s file”

POST/v1/templates/pdf-conversions

Available when: your plan includes PDF templates

Send a doc, docx, odt or rtf of up to 10 MB as the multipart field file. The response is 200 OK with the PDF to upload as the templateFile of a PDF template, named after the document (contract.docx comes back as contract.pdf), with Cache-Control: no-store. X-Print-Concerns lists, separated by commas, what looks wrong in the PDF (interactive_fields, blank_page, missing_text, substituted_fonts), and X-Print-Substituted-Fonts the fonts set in others, each URL-encoded and separated by commas; both are empty when all is well. Nothing is stored: neither the document nor the PDF stays on the server. A PDF larger than 10 MB is refused, with a message saying so.

Key permission: convert_word_to_pdf_template

Status When
400 No file was sent
403 Your plan has no PDF templates, or its limit of templates is reached
413 The document is larger than 10 MB
422 The file isn’t one of those types, or its PDF is larger than 10 MB
500 The conversion failed
Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates/pdf-conversions' \
-H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \
-F 'file=@mutual-nda.docx' \
-o mutual-nda.pdf

GET/v1/templates/{id}/download

Returns the file that documents are generated from. For a template that follows a cloud file, that is the approved copy, which may differ from what is in the drive right now. Use it to back up your templates, or to compare the stored copy with your own.

Key permission: download_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 200 with the file itself. Content-Type is the file’s type, Content-Disposition gives its name, and Content-Length its size.

An SVG you uploaded can differ a little from your original: inside {{ ... }} and {% ... %} tags, Doxtly turns encoded characters and curly quotes into plain ones, so the tags work.

Errors: only the common ones.

Terminal window
curl 'https://api.doxtly.com/v1/templates/01a1aaf4-d812-7f81-87f3-a2a24628d795/download' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-o service-agreement.docx

The response is the file itself. Its headers:

HTTP/2 200
content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
content-disposition: attachment; filename=service-agreement.docx
content-length: 2674

GET/v1/templates/{id}/data_structure

Tells you each variable the template uses, what it does with the value and whether a document can be made without it. Call it while you build an integration, so you know the shape of data to send to generate, or before a generation, to check your data against it.

Key permission: read_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 200.

Field Type Meaning
type string The template’s type.
variables array One entry per variable.
variables[].path string The path, such as client.name.
variables[].kind string What the template does with it, see below.
variables[].required boolean Whether the document needs it. false for a value the template can go without, such as the value of a PDF area with a print condition.
variables[].conditions array The conditions the value is printed under, outermost first. Each has path (the value tested), negated (true when it is printed if the test fails: ${if:!paid}, or after ${else}) and scope: item for a Word condition with a plain name inside a repeated section, which tests the item’s field and the document’s value when the item has none, otherwise document. Empty when nothing conditions it.
variables[].default string or null What a Word template prints when your data has no value, from ${client.vat|none}. null when it gives none.
variables[].position integer Where the template first uses it, counting from 0. The list is sorted by path; sort by position to follow the template.
variables[].children array For a list: the variables read of its items, each with the same fields, a list inside an item with its own children. They are also listed among variables by their whole paths, such as sections.paragraphs.text. Empty for other kinds.
kind The value you send
value Text or a number to print. In a Word template, a plain marker can also print a picture if you send one, and a list of plain values prints joined with a comma: ["GDPR", "Audit"] becomes GDPR, Audit.
list A list. The template repeats a block or a row for each item.
image A picture as a data address: data:image/png;base64,....
code The content of a QR code or barcode.
flag Something the template tests. What counts as true ticks a box or shows a block.

_request.* values do not appear, because Doxtly fills them in itself. _metadata.* values do, since they may come from your data as well as from the template. A PDF template’s manual areas do not appear: recipients fill those.

Status When
422 The stored file of a Word template cannot be read as a Word document.

The errors every endpoint can answer apply here too.

Terminal window
curl 'https://api.doxtly.com/v1/templates/01a1aaf4-da3f-7427-bc4f-b3c2725a9c22/data_structure' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET"

Response 200:

{
"type": "word",
"variables": [
{ "path": "client.name", "kind": "value", "required": false, "conditions": [], "default": "-", "position": 0, "children": [] },
{
"path": "sections", "kind": "list", "required": true, "conditions": [], "default": null, "position": 1,
"children": [
{ "path": "sections.paragraphs", "kind": "list", "required": true, "conditions": [], "default": null, "position": 2, "children": [
{ "path": "sections.paragraphs.paid", "kind": "flag", "required": false, "conditions": [], "default": null, "position": 3, "children": [] },
{ "path": "sections.paragraphs.text", "kind": "value", "required": false, "conditions": [{ "path": "sections.paragraphs.paid", "negated": false, "scope": "item" }], "default": null, "position": 4, "children": [] }
] }
]
},
{ "path": "sections.paragraphs", "kind": "list", "required": true, "conditions": [], "default": null, "position": 2, "children": ["…as above"] },
{ "path": "sections.paragraphs.paid", "kind": "flag", "required": false, "conditions": [], "default": null, "position": 3, "children": [] },
{ "path": "sections.paragraphs.text", "kind": "value", "required": false, "conditions": [{ "path": "sections.paragraphs.paid", "negated": false, "scope": "item" }], "default": null, "position": 4, "children": [] }
]
}

This is a Word template that prints ${client.name|-}, then repeats ${sections}, and in each section repeats ${paragraphs}, printing ${text} only for a paragraph whose paid holds.

GET/v1/templates/{id}/party_indicators

Lists the parties that a template expects to sign its documents. A party indicator is the short name a template gives a signer, such as CLIENT. PDF templates take them from their areas, Word and SVG templates from their [SIGNATURE:CLIENT] markers. Use it when you prepare signing and need to match people to parties.

Key permission: read_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 200.

Field Type Meaning
templateId string The template’s identifier.
partyIndicators array of strings Every party the template can ask for.
conditionalPartyIndicators array of strings Those of them that take part only in some documents: named only by areas with a condition, or only by markers inside a Word template’s conditional blocks.

Errors: only the common ones.

Terminal window
curl 'https://api.doxtly.com/v1/templates/01a1aaf4-d812-7f81-87f3-a2a24628d795/party_indicators' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET"

Response 200:

{
"templateId": "01a1aaf4-d812-7f81-87f3-a2a24628d795",
"partyIndicators": ["PROVIDER", "CLIENT"],
"conditionalPartyIndicators": []
}

PUT/v1/templates/{id}/contact_bindings

The values a package made from the template takes from its parties’ contacts unless they are typed: each a path, the party, subject (contact or company) and field, as a package’s bindings are. A package gets them when the template is added to it; a Create documents step of a workflow fills them as it runs, from the contact whose email address is the party’s, never from a sensitive field.

Key permission: update_template

Body: {"bindings": [...]}, all of them: those left out go. Up to 200. The template’s file and version don’t change.

Response: 200 with the template. 422 for a binding that is not one.

Terminal window
curl -X PUT 'https://api.doxtly.com/v1/templates/01a1aaf4-d812-7f81-87f3-a2a24628d795/contact_bindings' \
-H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{"bindings":[{"path":"client.name","party":"CLIENT","subject":"contact","field":"fullName"},{"path":"client.city","party":"CLIENT","subject":"company","field":"city"}]}'

Available when: the template follows a file in a connected Google Drive, OneDrive, SharePoint, Dropbox or Box

These four endpoints work on the link between a template and its file in a drive. All of them answer 409 with the code template_not_following for a template that follows nothing. Cloud templates explains how the link behaves.

POST/v1/templates/{id}/source/check

Looks at the file in the drive straight away, instead of waiting for the drive to report a change. Call it right after you edit a file, when your next step depends on the new version.

A check works like any other look at the file. A new Word or SVG version that can be read becomes the template at once, and version goes up. A new PDF is held back with the status review_required. Nothing happens if the file has not changed, so repeating the call is safe. Because a check can change the template, a key with only Read template can bring in a new version, though it cannot approve one.

Key permission: read_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

The request has no body.

Response: 200 with the template object. Read source.status to see the result. A file that is gone or a drive that needs connecting again is a result as well, so the call still answers 200, with source_missing or reconnect_required.

Status When
409 The template follows no cloud file (template_not_following).
429 The drive’s provider is limiting requests. Try again later.
503 The provider cannot be reached right now, or another change to this template did not finish within 30 seconds. Try again in a moment.

The errors every endpoint can answer apply here too.

Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates/01a1abe3-a946-7333-a14d-9dae63f315f1/source/check' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET"

Response 200:

{
"id": "01a1abe3-a946-7333-a14d-9dae63f315f1",
"name": "Course certificate (from the drive)",
"type": "pdf",
"version": 1,
"templateFile": {
"fileId": "01a1abe3-a945-7c59-ab6a-99e57883d020",
"filename": "course-certificate.pdf",
"content": null,
"size": 65127
},
"metadata": null,
"variables": [],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-05T14:26:26+01:00",
"updatedAt": "2026-11-05T14:26:26+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": {
"integrationId": "01a1ab0c-4436-705d-84fa-23b997395c43",
"integrationName": "Company Google Drive",
"provider": "google_drive",
"fileId": "gd15E",
"path": "Contracts/Templates/course-certificate.pdf",
"webUrl": "https://drive.google.com/file/d/gd15E/view",
"nativeType": null,
"status": "review_required",
"statusReason": null,
"checkedAt": "2026-11-05T14:26:53+01:00",
"pendingRevision": {
"contentHash": "b49b006e913ab5daf081064a59021ed62ac55bb4ce36dcd0d1a6e5ffa3f4136b",
"filename": "course-certificate.pdf",
"size": 75505,
"detectedAt": "2026-11-05T14:26:26+01:00",
"comparison": {
"previousPages": [{"width": 841.92, "height": 595.92, "rotation": 0}],
"currentPages": [{"width": 595.92, "height": 842.88, "rotation": 0}],
"sameGeometry": false
}
}
}
}

DELETE/v1/templates/{id}/source

Ends the link. The template keeps the file it has, as if it had been uploaded, and a new version waiting for review is discarded. This is what is left to do when a file was deleted from the drive for good and you want to go on generating from the copy.

Key permission: update_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 200 with the template object, its source now null.

Status When
409 The template follows no cloud file (template_not_following).

The errors every endpoint can answer apply here too.

Terminal window
curl -X DELETE 'https://api.doxtly.com/v1/templates/01a1abe3-a946-7333-a14d-9dae63f315f1/source' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET"

Response 200:

{
"id": "01a1abe3-a946-7333-a14d-9dae63f315f1",
"name": "Course certificate (from the drive)",
"type": "pdf",
"version": 2,
"templateFile": {
"fileId": "01a1abe3-a945-7c59-ab6a-99e57883d020",
"filename": "course-certificate.pdf",
"content": null,
"size": 75505
},
"metadata": null,
"variables": [],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-05T14:26:26+01:00",
"updatedAt": "2026-11-05T14:26:54+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": null
}

POST/v1/templates/{id}/source/review

Records your decision on a new PDF waiting for review. A PDF waits because its areas are positions on the old pages, and only someone looking at it can tell whether they still fit. Documents keep coming from the approved file until you decide.

A typical flow: read source.pendingRevision from the template, download the new file to look at it, then send your decision with that contentHash.

Key permission: update_template

Headers: X-Api-Key, X-Api-Secret. Content-Type: application/json

Path parameter Meaning
id The template’s identifier.
Field Type Required Rules
decision string Yes accept takes the new file. dismiss turns it down.
contentHash string Yes source.pendingRevision.contentHash, up to 64 characters. It proves you decided about the version that is waiting now.
pdfFields array No With accept: the areas to keep on the new file. Left out, the current ones stay. Send [] to keep none.

On accept, the new file becomes the template, it keeps the areas you approved, and version goes up. Every area has to lie on a page of the new file. On dismiss, the template keeps its approved file and source.status becomes update_dismissed. Doxtly does not ask again about these same bytes, but a later version is held for review as usual.

Response: 200 with the template object.

Status When
409 template_not_following: the template follows no cloud file. template_source_nothing_pending: nothing waits for review. template_source_revision_outdated: the file changed again, so read the new contentHash and look at that version.
422 decision or contentHash is missing or wrong, or an area in pdfFields breaks a rule. pdf_fields_outside_pages: some areas have nowhere to go on the new file, and detail names them. Move or remove them and send the request again.
503 Another change to this template did not finish within 30 seconds. Try again in a moment.

The errors every endpoint can answer apply here too.

Terminal window
curl -X POST 'https://api.doxtly.com/v1/templates/01a1abe3-a946-7333-a14d-9dae63f315f1/source/review' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{
"decision": "accept",
"contentHash": "b49b006e913ab5daf081064a59021ed62ac55bb4ce36dcd0d1a6e5ffa3f4136b"
}'

Response 200:

{
"id": "01a1abe3-a946-7333-a14d-9dae63f315f1",
"name": "Course certificate (from the drive)",
"type": "pdf",
"version": 2,
"templateFile": {
"fileId": "01a1abe3-a945-7c59-ab6a-99e57883d020",
"filename": "course-certificate.pdf",
"content": null,
"size": 75505
},
"metadata": null,
"variables": [],
"pdfFields": [],
"dataSources": [],
"contactBindings": [],
"createdAt": "2026-11-05T14:26:26+01:00",
"updatedAt": "2026-11-05T14:26:53+01:00",
"lastUsedAt": null,
"successGenerations": 0,
"failedGenerations": 0,
"source": {
"integrationId": "01a1ab0c-4436-705d-84fa-23b997395c43",
"integrationName": "Company Google Drive",
"provider": "google_drive",
"fileId": "gd15E",
"path": "Contracts/Templates/course-certificate.pdf",
"webUrl": "https://drive.google.com/file/d/gd15E/view",
"nativeType": null,
"status": "synced",
"statusReason": null,
"checkedAt": "2026-11-05T14:26:53+01:00",
"pendingRevision": null
}
}

GET/v1/templates/{id}/source/pending/download

Returns the new file waiting for review, so you can look at it before you decide.

Key permission: download_template

Headers: X-Api-Key, X-Api-Secret

Path parameter Meaning
id The template’s identifier.

Response: 200 with the file. Content-Type, Content-Disposition and Content-Length describe it.

Status When
409 template_not_following: the template follows no cloud file. template_source_nothing_pending: nothing waits for review.

The errors every endpoint can answer apply here too.

Terminal window
curl 'https://api.doxtly.com/v1/templates/01a1abe3-a946-7333-a14d-9dae63f315f1/source/pending/download' \
-H "X-Api-Key: $DOXTLY_API_KEY" \
-H "X-Api-Secret: $DOXTLY_API_SECRET" \
-o course-certificate-new.pdf

The response is the file itself. Its headers:

HTTP/2 200
content-type: application/pdf
content-disposition: attachment; filename=course-certificate.pdf
content-length: 75505