Skip to Content
API Reference
Upload TemplatePOST

Upload Template

Upload a DOCX file to create a new template in Docubloom. This template can be used to generate documents with dynamic content by replacing variables in the template with actual data.

Endpoint

PUT https://docubloom.com/api/template/upload

Headers

All requests must include your API key in the Authorization header. If you don’t have an API key yet, you can create one in your organization settings. You should also set the Content-Type header to multipart/form-data to send your data.

Authorization: Bearer YOUR_API_KEY Content-Type: multipart/form-data

Request Body

Definition of fields

FieldTypeRequiredDescription
templateKeystringKey of the template you are creating
templatefileYour DOCX template file
templateNamestring

Name of the template. If not provided, the key will be used as the name.

delimiterstring

Optional. The delimiter used in the template for variable replacement. This can be: BRACES (default), DOUBLE_BRACES, DOUBLE_SQUARE_BRACKETS, or TRIPLE_PLUS. (more details in the Delimiters section).

Example Request

curl -X PUT https://docubloom.com/api/template/upload \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F "templateKey=your-template-key" \ -F "templateName=My Template" \ -F "template=@/path/to/your/template.docx" \ -F "delimiter=BRACES"

Response

If the request is successful, you will receive a 200 OK status code along with a response body as a JSON object. The Content-Type header will be application/json.

Example Response:

{ "success": true }

Status Codes

The API will return different HTTP status codes based on the outcome of your request.

StatusDescription
200Template successfully created
400Invalid request body
401Unauthorized – missing or invalid API key
404Template not found
500Internal server error
Last updated on