Skip to main content

Template builder tools

These tools operate on customer templates through the customer template builder controller, not the developer controller. They use the authenticated user and customer company; a template owner can access their own template, while access to another user's template requires the corresponding template-builder permission. Inaccessible templates are reported as not found. The Template Builder API reference describes the related HTTP actions and template access rules.

Each tool advertises a structured response with success and statusCode, and optionally status, error, errorDetails, and operation-specific data. Manager status values are numeric: 0 success, 1 invalid request, 2 not found, 3 conflict, and 4 failure. Not every response has a manager status. Failure data may contain an underlying file or removal result; inspect it before retrying. Creation returns the template ID and version in data, and may include exception details as data.errorObject text.

In the table, R means read-only and D means marked destructive; a dash means neither annotation is true. None is marked open-world. Parameters are required unless noted otherwise.

ToolArgumentsBehaviorAnnotations
template_builder_create_templatename, optional descriptionCreate a customer template.-
template_builder_delete_template_headheadIdDelete a template head and remaining templates; snapshots or active use prevent deletion.D
template_builder_create_public_versionheadId, optional versionTagPublish a public version; tag is major, minor, or revision, defaulting to minor.-
template_builder_get_versionsheadId, optional pageNumber, pageSizeGet data.head and data.page; page size is capped at 20.R
template_builder_delete_template_versionversionIdDelete a non-root version if it is not in use.D
template_builder_get_itemsheadId, optional folderPathList editable template items; folder defaults to /.R
template_builder_view_itemsversionId, optional folderPathList version items; folder defaults to /.R
template_builder_get_item_contentheadId, filePathRead editable item text.R
template_builder_view_item_contentversionId, filePathRead version item text.R
template_builder_save_itemheadId, filePath, dataReplace item text, processing virtual items through the resolver.D
template_builder_create_directoryheadId, name, optional pathCreate a directory; blank path selects root, and virtual folders do not support directories.-
template_builder_delete_itemheadId, pathDelete an editable item. A dot in the final segment makes the file server treat it as a file; otherwise it treats it as a directory.D
template_builder_upload_fileheadId, path, fileName, fileDataUpload a nonempty file, potentially replacing an existing file.D

Item listing returns an array in data; content reads return text in data. A missing stored file is returned as empty content. save_item, create_directory, delete_item, and upload_file return the underlying file-operation result in data, including any available details on failure. Paths are relative to the template. Virtual files may trigger template-specific processing rather than a simple file write.

template_builder_save_item arguments contain a nested data object:

{
"headId": 9,
"filePath": "/styles/site.css",
"data": { "data": "body { margin: 0; }" }
}

template_builder_upload_file accepts file contents as a base64 string, not an HTTP multipart upload. fileName must be nonblank and fileData must decode to a nonempty file:

{
"headId": 9,
"path": "/images",
"fileName": "example.bin",
"fileData": "AQID"
}

Template creation, publication, and removal may involve multiple storage operations. Publishing a public version has external consequences even though the tool is not marked destructive. Confirm intended changes and inspect failures before repeating an operation.