Create a template
POST/templates
Creates a template with its first version, a draft unless publish is true. Requires the
template:write scope, which new keys do not have by default. The slug must be new in the
workspace (409 conflict otherwise). html is required for pdf and image templates; it
takes up to 2 MB, css 1 MB and head 256 kB.
A Word or PowerPoint template (kind docx or pptx) is created from its file: send
multipart/form-data with the file as file (up to 20 MB) and the other fields as form
fields, objects (settings, sample_data, data_schema, i18n, data_sets, tags) as
JSON text. The file is checked by its content and stored privately; html, css, head
and partials do not apply. Fields the body does not name here are ignored.
Where the plan limits the number of templates (five on Free), a template beyond it is
refused with 403 forbidden, feature: "templates" and the plan's limit. Archived
templates do not count.
Request
Responses
- 201
- 403
- 409
- 413
- 415
- 422
- default
Created.
The key lacks template:write, or the plan holds no further template.
Slug already exists.
File too large.
Not a Word or PowerPoint file of the template's kind.
The request was understood but cannot be rendered: data that does not fit the schema (data_validation_error), a template error (template_syntax_error, template_runtime_error, with location), a page that does not load (navigation_failed), a page or size limit of the plan (page_limit_exceeded, output_too_large), a source a PDF step cannot use (source_not_found, source_invalid, source_encrypted), or an e-invoice or PDF/UA failure.
Error (RFC 9457 problem details).