---
title: "Add Email Template"
method: POST
path: "/mailagents/{mailagent-alias}/templates"
tags: ["email templates"]
---

# Add Email Template

`POST /mailagents/{mailagent-alias}/templates`

## Request

- Base URL: `https://cpaas.zoho.com/v1.1`
- URL: `https://cpaas.zoho.com/v1.1/mailagents/{mailagent-alias}/templates`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://accounts.zoho.com/oauth/v2/auth`
    - Token URL: `https://accounts.zoho.com/oauth/v2/token` scopes: `Zeptomail.MailTemplates.CREATE`
  - OAuth 2
    - Authorization code: `https://accounts.zoho.com/oauth/v2/auth`
    - Token URL: `https://accounts.zoho.com/oauth/v2/token` scopes: `Zeptomail.MailTemplates.ALL`

Create a new email template in your CPaaS account.

## Path parameters

- `mailagent-alias` string, required

## Request body

- object
  - `htmlbody` string, required: HTML content of the email template.
  - `template_name` string, required: Display name of the email template.
  - `subject` string, required: Subject line of the email template.
  - `template_alias` string: Custom alias for the template. Used as an alternative to template_key.

## Response `200`

Template created successfully.

- object
  - `data` object
    - `template_key` string
    - `template_name` string
    - `subject` string
    - `template_alias` string
  - `status` string

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/zoho/apis/zoho-cpaas.md) - [All operations](https://skmtc.dev/zoho/apis/zoho-cpaas/llms.txt) - [OpenAPI document](https://skmtc.dev/zoho/apis/zoho-cpaas/revisions/f0858a38e8b0?raw)
