POST
Update imported template files
Company space For: Administrator, Manager · Permission: company_templates.update_imported_files Conditions
  • Only templates the company imported itself can have their files updated; a template obtained from the catalogue is refused.
  • At least one of template_file and config_file must be sent.
  • The template file must be named template.hbs (at most 256 KB) and the configuration file config.json (at most 64 KB).
  • The resulting template must pass validation: size limit, valid configuration schema, compilation and a test render against sample data. A file that is not sent is taken from the currently pinned version.
What else happens
  • Publishes a new immutable version (v2.0, v3.0 and so on) and pins the company template to it.
  • Settings already saved on the company template are kept as they are; they are not checked against the new configuration.
  • A publication refused by the size, schema, compilation or test-render checks is recorded in the template publication log; a configuration file that cannot be read as a JSON object is refused before that and is not recorded.
Part of Invoice and document templates.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

companyTemplate
string
required

Identifier of the company template, the company's own copy of a template (27-character KSUID string).

Body

multipart/form-data
template_file
file | null

New template source, uploaded as a file named template.hbs, at most 256 KB. When omitted, the pinned version's template is kept. At least one of the two files is required.

Maximum string length: 256
config_file
file | null

New configuration schema, uploaded as a JSON file named config.json, at most 64 KB. When omitted, the pinned version's configuration is kept. At least one of the two files is required.

Maximum string length: 64

Response

JsonResource

data
string
required

Items of this page.