---
title: "Update an existing template"
method: PUT
path: "/templates/{id}"
tags: ["templates"]
---

# Update an existing template

`PUT /templates/{id}`

Update an existing template

## Path parameters

- `id` integer, required

## Request body

- object
  - `name` string, required — The name of the new template, must be unique.
  - `subject_part` string, required — The subject part
  - `html_part` string, required — The HTML content used in the e-mail campaign.
  - `text_part` string, required — The text content used in the e-mail campaign.

## Response `200`

OK

- Template
  - `id` integer — The ID of the resource.
  - `created_at` string, date-time — The date and time when the resource was created.
  - `updated_at` string, date-time — The date and time when the resource was last updated.
  - `name` string — The name of the template.
  - `subject_part` string — The subject part.
  - `html_part` string — The HTML content used in the e-mail campaign.
  - `text_part` string — The text content used in the e-mail campaign.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `422` — Unprocessable entity
- `default` — Unexpected error

---

[API](https://skmtc.dev/mailbadger/apis/mailbadger-api.md) · [All operations](https://skmtc.dev/mailbadger/apis/mailbadger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mailbadger/mailbadger-api/revisions/3a7ef49250a1/schema)
