---
title: "Create or edit a template message"
method: POST
path: "/chats/templates"
---

# Create or edit a template message

`POST /chats/templates`

Creates a template message in one of the creator's folders, or edits an existing one. Provide a `folderUuid` from GET /chats/templates/folders. Omit `messageUuid` to create the template (201); provide it to edit that template in place (200). A template must have text or at least one media attachment. An edit replaces the fields you send, so send the full template body rather than only the fields you are changing.

## Headers

- `X-Fanvue-API-Version` string, required

## Request body

- object
  - `messageUuid` string, uuid — UUID of an existing template to edit. Omit to create a new template; provide it to edit that template in place.
  - `folderUuid` string, uuid, required — UUID of the folder to hold the template (see GET /chats/templates/folders)
  - `text` string — Message text content
  - `price` union — Message price in cents (0 or null for free messages)
    - 0
    - number
  - `mediaUuids` string[] — Media UUIDs to attach to the template, in display order
  - `mediaPreviewUuid` string, uuid — Media UUID to use as the paywall preview
  - `name` string — Optional template name

## Response `200`

Template message updated

- object
  - `uuid` string, uuid, required — Template message UUID
  - `name` string, nullable, required — Template name as given on create, or null when the template is unnamed
  - `text` string, nullable, required — Message text content
  - `price` number, nullable, required — Message price in cents (null for free messages)
  - `mediaUuids` string[], required — Array of media UUIDs attached to the message
  - `mediaPreviewUuid` string, uuid, nullable, required — Media UUID used as the paywall preview (null when the template has none)
  - `folderUuid` string, uuid, nullable, required — UUID of the folder containing this template
  - `folderName` string, nullable, required — Name of the folder containing this template

## Other responses

- `201` — Template message created
- `400` — Bad Request - API version not supported OR validation failed
- `401` — Unauthorized Response
- `403` — Unauthorized Response
- `404` — Folder or template message not found
- `410` — API version no longer supported (sunset)
- `429` — Too many requests - rate limit exceeded

## Changes

- **2026-08-30** `dce5621fe589` — 3 info
  - api operation id `createTemplateMessage` removed and replaced with `upsertTemplateMessage`
  - added the new optional request property `messageUuid`
  - added the success response with the status `200`

[Change history](https://skmtc.dev/fanvue/apis/fanvue-api/changes/chats/templates/post.md)

---

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