---
title: "Update a template draft"
method: PUT
path: "/templates/{templateKey}/draft"
tags: ["templates"]
---

# Update a template draft

`PUT /templates/{templateKey}/draft`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/templates/{templateKey}/draft`
- Auth: HTTP bearer

## Path parameters

- `templateKey` string, required: template stable key

## Request body

- object
  - `name` string
  - `definition` unknown

## Response `200`

Updated

- object
  - `success` boolean, required
  - `template` object, required

## Other responses

- `400`: Invalid parameters
- `401`: Missing or invalid API key
- `404`: Template not found
- `409`: Archived templates cannot be edited

---

[API](https://skmtc.dev/mailly/apis/mailly-api.md) · [All operations](https://skmtc.dev/mailly/apis/mailly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailly/apis/mailly-api/revisions/1ceb29637301?raw)
