---
title: "Update Template"
method: PUT
path: "/v1/templates/{template_id}"
tags: ["templates"]
---

# Update Template

`PUT /v1/templates/{template_id}`

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

Update a template.

All fields are optional. Only provided fields will be updated.

**Default Template Handling:**
- When setting `is_default` to `true`, any existing default template for that channel
  will be automatically unset
- Only one template can be default per channel type (EMAIL, SMS, etc.) per workspace
- The database constraint ensures this rule is enforced

If content is updated, variables will be automatically re-extracted.

## Path parameters

- `template_id` string, uuid, required

## Headers

- `mentium-workspace-id` string, nullable

## Request body

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

## Response `200`

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)
