PATCH
/
v1
/
templates
/
{id}
Update a Template
curl --request PATCH \
  --url https://smart-templates.sandbox.midaz.io/v1/templates/{id} \
  --header 'Content-Type: multipart/form-data' \
  --form outputFormat=HTML \
  --form 'description=Financial Report' \
  --form template=@example-file
{
"id": "0196b1d2-399c-7aff-8941-3ea99d1525d4",
"outputFormat": "html",
"description": "Financial Report",
"filename": "0196b1d2-399c-7aff-8941-3ea99d1525d4.tpl",
"createdAt": "2025-05-08T21:34:26.716Z",
"updatedAt": "2025-05-08T21:50:24.844Z",
"deletedAt": null
}

Headers

Authorization
string

The authorization token. Important: This header is required if your environment has the Acces Manager plugin enabled.

Content-Type
string

The request content type. Important: For this endpoint, it must be multipart/form-data.

X-Organization-id
string

The unique identifier of the Organization associated with the request.

Path Parameters

id
string
required

Unique identifier of the template that you want to retrieve (UUID).

Body

multipart/form-data
template
file
required

The new template file.

outputFormat
enum<string>
required

The output format that will be generated by the new template.

Available options:
HTML,
CSV,
XML,
PDF,
TXT
Example:

"HTML"

description
string

A brief description about the new template.

Example:

"Financial Report"

Response

Indicates that the resource was successfully created and the operation was completed as expected.

id
string

Unique ID that identifies the template. Follows the UUID format.

outputFormat
string

The format of the generated output (e.g., HTML, CSV, PDF, TXT, XML).

description
string

Briefly describes what the template is for or what it contains.

fileName
string

The name of the template file as stored in the system. Follows the <template_id>.tpl format.

createdAt
string

Date and time when the template was created.

updatedAt
string

Timestamp indicating the last time the template was updated.

deletedAt
string

Timestamp indicating when the template was soft deleted.