Replace Template
Update an existing template by replacing its content with a new file. This is useful when you want to modify the structure or design of a template without changing its key or other metadata.
Endpoint
PUT https://docubloom.com/api/template/replaceHeaders
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-dataRequest Body
Definition of fields
| Field | Type | Required | Description |
|---|---|---|---|
templateKey | string | ✅ | Key of the template to replace |
template | file | ✅ | Your DOCX template file |
delimiter | string | ❌ | Optional. The delimiter used in the template for variable replacement. This can be:
|
Example Request
curl -X PUT https://docubloom.com/api/template/replace \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "templateKey=your-template-key" \
-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.
| Status | Description |
|---|---|
200 | Template successfully replaced |
400 | Invalid request body |
401 | Unauthorized – missing or invalid API key |
404 | Template not found |
500 | Internal server error |