---
title: "Create a template"
method: POST
path: "/v1/templates"
tags: ["Templates"]
---

# Create a template

`POST /v1/templates`

## Request

- Base URL: `https://api.volanea.com`
- URL: `https://api.volanea.com/v1/templates`
- Auth: HTTP bearer

Stores reusable content addressed by `templateId`, so a send can name the template instead of carrying the markup.

`subject`, `body`, and the preheader support `{{variable}}` placeholders, resolved at send time against the per-call `variables` first and the contact's own fields second. `fromEmail` must sit on a verified domain or every send from this template fails.

Version 1 is written immediately. Every later content change bumps the version and keeps the previous one, which is what `POST /v1/templates/{id}/rollback` restores.

## Request body

- object
  - `name` string, required
  - `type` 'transactional' | 'marketing': Marketing templates get the unsubscribe footer and respect the subscribed flag.
  - `subject` string, required
  - `body` string, required: HTML with `{{variable}}` placeholders.
  - `fromName` string
  - `fromEmail` string, email, required

## Response `201`

Created (version 1 is snapshotted).

- Template
  - `templateId` string, required
  - `projectId` string
  - `name` string, required
  - `type` 'transactional' | 'marketing', required
  - `subject` string, required
  - `body` string, required
  - `fromName` string, nullable
  - `fromEmail` string, email, required
  - `version` integer, required: Bumped on every content change; old versions are kept for rollback.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `401`: Missing or invalid API key.
- `422`: Request validation failed (code `validation_error`, 422).

---

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