Update Template

The update template endpoint allows you to modify a specific template's metadata.

Request

PATCH /v1/templates/{template_id}

Path Parameters

ParameterTypeDescription
template_idstringThe unique identifier of the template to update

Request Body

{
  "name"?: string,
  "options"?: {
    "allowGenerationWithWarnings": boolean
  }
}

Request Fields

FieldTypeDescription
namestringOptional. New name for the template. Must end with ".docx". The name must be unique within your templates.
optionsobjectOptional. Template options to update.
options.allowGenerationWithWarningsbooleanWhether to allow document generation even when the template has warnings.

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"
    })
});
TemplateDocs - Documentation