---
title: "Update a Template"
method: PUT
path: "/templates/{templateIdOrAlias}"
tags: ["Templates API"]
---

# Update a Template

`PUT /templates/{templateIdOrAlias}`

## Path parameters

- `templateIdOrAlias` string, required

## Headers

- `X-Postmark-Server-Token` string, required

## Request body

- EditTemplateRequest — The contents required for creating a new template.
  - `Alias` string — The optional string identifier for referring to this Template (numbers, letters, and '.', '-', '_' characters, starts with a letter).
  - `Name` string — The friendly display name for the template.
  - `Subject` string — The Subject template definition for this Template.
  - `HtmlBody` string — The HTML template definition for this Template.
  - `TextBody` string — The Text template definition for this Template.

## Response `200`

OK

- TemplateRecordResponse
  - `Name` string — The display name for this template.
  - `Alias` string — The user-supplied alias for this template.
  - `TemplateId` number — The associated ID for this template.
  - `Active` boolean — True if this template is currently available for use.

## Other responses

- `422` — An error was generated due to incorrect use of the API. See the Message associated with this response for more information.
- `500` — Indicates an internal server error occurred.

---

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