---
title: "Create Template"
method: POST
path: "/v1/templates/"
tags: ["templates"]
---

# Create Template

`POST /v1/templates/`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v1/templates/`
- Auth: HTTP bearer

Create a new template.

Subject (EMAIL only) and body can include variables using the {{variable_name}}
syntax. Variables will be automatically extracted and stored.

Template titles must be unique within a workspace.

Example:
```
{
    "title": "Welcome Email",
    "subject": "Welcome to {{company}}",
    "body": "Hello {{name}},\n\nWelcome to {{company}}!\n\nBest regards,\n{{sender}}",
    "template_type": "EMAIL"
}
```

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- TemplateCreate
  - `title` string, required
  - `subject` string, nullable
  - `body` string, required
  - `template_type` 'EMAIL' | 'SMS'
  - `is_active` boolean
  - `is_default` boolean
  - `use_signature` boolean
  - `twilio_language` string
  - `twilio_approval_category` string

## Response `201`

Successful Response

- TemplateSchema
  - `id` string, uuid, required
  - `organization_id` string, uuid, required
  - `workspace_id` string, uuid, required
  - `title` string, required
  - `subject` string, nullable
  - `body` string, required
  - `template_type` 'EMAIL' | 'SMS', required
  - `is_active` boolean, required
  - `is_default` boolean
  - `use_signature` boolean
  - `twilio_content_sid` string, nullable
  - `twilio_approval_name` string, nullable
  - `twilio_approval_status` string, nullable
  - `twilio_approval_category` string, nullable
  - `twilio_approval_error` string, nullable
  - `twilio_language` string, nullable
  - `twilio_variable_order` string[], nullable
  - `whatsapp_review_warnings` string[]
  - `variables` string[]
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable

## Other responses

- `404`: Not found
- `422`: Validation Error

---

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