---
title: "Publish a new template version"
method: POST
path: "/templates/{templateKey}/publish"
tags: ["templates"]
---

# Publish a new template version

`POST /templates/{templateKey}/publish`

## 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}/publish`
- Auth: HTTP bearer

Checks the from-domain verification status and the marketing footer configuration before publishing.

## Path parameters

- `templateKey` string, required: template stable key

## Response `200`

Published

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

## Other responses

- `400`: Publish validation failed
- `401`: Missing or invalid API key
- `404`: Template not found
- `409`: Archived templates cannot be published

---

[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)
