Upload Template
upload_templateUpload a template file to the Carbone platform for reuse in document generation. Supports versioning and multiple formats like DOCX, XLSX, and PDF.
Instructions
Upload and store a reusable Carbone template. Once uploaded, use render_document with the returned Template ID to generate documents from it. Supports versioning: multiple versions can live under a single stable Template ID, with deployedAt controlling which version is active. Accepted formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown, PDF, and more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Existing Template ID (64-bit format) to add this upload to its version history. If omitted, a new Template ID is generated. Providing a Version ID (SHA-256) is not allowed and will cause an error. | |
| name | Yes | Display name for the template (e.g. "Invoice Template", "NDA Contract"). | |
| tags | No | Tags for searchability and filtering (e.g. ["sales", "billing", "v2"]). | |
| sample | No | Sample input data attached to the template for testing in Carbone Studio. Each item must include data, complement, translations, and enum objects. | |
| comment | No | Free-text comment to describe the template version or its purpose. | |
| category | No | Group templates into folders/categories (e.g. "invoices", "legal", "hr"). | |
| expireAt | No | UTC Unix timestamp (seconds) at which this template will be automatically deleted. Use 42000000000 to delete immediately (special "NOW" sentinel value). | |
| template | Yes | The template file. Accepts a local file path (e.g. /home/user/invoice.docx), a URL (https://example.com/template.docx), or a base64-encoded string. Supported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown (MD), PDF, and more. Full list: https://carbone.io/documentation/developer/http-api/generate-reports.md | |
| deployedAt | No | UTC Unix timestamp (seconds) to set as the deployment time for this version. Carbone uses the version with the most recent deployedAt when rendering via Template ID. Use 42000000000 to deploy immediately (special "NOW" sentinel value). | |
| versioning | No | Enable template versioning (default: true). When true, a stable Template ID is generated and multiple versions can be managed under it. When false, behaves as legacy mode and returns only a templateId (SHA-256 hash). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Stable Template ID (when versioning is enabled). | |
| name | Yes | Template display name. | |
| size | No | Template size in bytes. | |
| type | No | Detected template file type. | |
| versionId | No | Version ID (SHA-256) of this uploaded version. | |
| templateId | No | Template ID returned in legacy/non-versioned mode. |