---
title: "Replace a template"
method: PUT
path: "/templates/{id}"
tags: ["Templates"]
---

# Replace a template

`PUT /templates/{id}`

Modify the representation of a template so that it becomes completely as specified.
Unspecified attributes will be reset to their default empty values.

## Path parameters

- `id` integer, required

## Request body

- TemplateInput
  - `title` string, required
  - `bodyHtml` string — HTML body. At least one of bodyHtml or bodyText is required.
  - `bodyText` string — Plain text body. At least one of bodyHtml or bodyText is required.

## Response `200`

The template attributes

- TemplateDetail
  - `id` integer
  - `title` string
  - `bodyHtml` string
  - `bodyText` string
  - `createdOn` string
  - `updatedOn` string

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Template not found

---

[API](https://skmtc.net/cyberimpact/apis/cyberimpact-api.md) · [All operations](https://skmtc.net/cyberimpact/apis/cyberimpact-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cyberimpact/cyberimpact-api/revisions/bf0b51ee8e8a/schema)
