Update Template
The update template endpoint allows you to modify a specific template's metadata.
Request
PATCH /v1/templates/{template_id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
template_id | string | The unique identifier of the template to update |
Request Body
{
"name"?: string,
"options"?: {
"allowGenerationWithWarnings": boolean
}
}
Request Fields
| Field | Type | Description |
|---|---|---|
name | string | Optional. New name for the template. Must end with ".docx". The name must be unique within your templates. |
options | object | Optional. Template options to update. |
options.allowGenerationWithWarnings | boolean | Whether to allow document generation even when the template has warnings. |
You can update the template name, options, or both in a single request.
Response
A successful request returns an empty response with a 200 status code.
Examples
const apiKey = "Your_API_Key";
const templateId = "template_123";
const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}`, {
method: 'PATCH',
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "new-template-name.docx"
})
});