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.
| Tool | Arguments | Behavior | Annotations |
|---|---|---|---|
template_builder_create_template | name, optional description | Create a customer template. | - |
template_builder_delete_template_head | headId | Delete a template head and remaining templates; snapshots or active use prevent deletion. | D |
template_builder_create_public_version | headId, optional versionTag | Publish a public version; tag is major, minor, or revision, defaulting to minor. | - |
template_builder_get_versions | headId, optional pageNumber, pageSize | Get data.head and data.page; page size is capped at 20. | R |
template_builder_delete_template_version | versionId | Delete a non-root version if it is not in use. | D |
template_builder_get_items | headId, optional folderPath | List editable template items; folder defaults to /. | R |
template_builder_view_items | versionId, optional folderPath | List version items; folder defaults to /. | R |
template_builder_get_item_content | headId, filePath | Read editable item text. | R |
template_builder_view_item_content | versionId, filePath | Read version item text. | R |
template_builder_save_item | headId, filePath, data | Replace item text, processing virtual items through the resolver. | D |
template_builder_create_directory | headId, name, optional path | Create a directory; blank path selects root, and virtual folders do not support directories. | - |
template_builder_delete_item | headId, path | Delete 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_file | headId, path, fileName, fileData | Upload 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.