Create a draft version
POST/templates/:id/versions
Saves a new version with the next number, as a draft. With publish: true it is published
at once, after the same schema check as POST …/publish (409 schema_breaking_change unless
allow_breaking). base_checksum makes the write conditional: when the latest version's
checksum differs, the answer is 409 conflict and nothing is saved, which is how
formfeed templates push avoids overwriting changes made in the editor. html is required
for pdf and image templates (up to 2 MB; css 1 MB, head 256 kB, at most 100 partials
and 50 data sets). Needs template:write.
For a Word or PowerPoint template, send multipart/form-data with a new file and the other
fields as form fields (objects as JSON text), or JSON without a file to keep the latest
version's file and change data, schema or settings only.
Request
Responses
- 201
- 400
- 404
- 409
- 413
- 415
- 422
- default
Draft created.
Error (RFC 9457 problem details).
Not found for the key: not_found, or template_not_found for a template or version. Templates, renders, files and webhooks are looked up in the workspace of the key, shared partials and workspaces in its organisation.
conflict: base_checksum is not the latest version's. schema_breaking_change: publish with a schema that breaks callers, without allow_breaking.
Error (RFC 9457 problem details).
Error (RFC 9457 problem details).
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).