---
title: "Create a Template"
description: "Create a template. This method is mainly useful for duplicating existing templates. To edit your template in our web app, the template json needs to be correct because our editor needs this json.\\"
canonical: "https://docs.cm.com/mobile-marketing-cloud/email-campaigns/templates/create-template"
---

# Create a Template

> Create a template. This method is mainly useful for duplicating existing templates. To edit your template in our web app, the template json needs to be correct because our editor needs this json.\

Source: https://docs.cm.com/mobile-marketing-cloud/email-campaigns/templates/create-template

# Create a template

Create a template. This method is mainly useful for duplicating existing templates. To edit your template in our web app, the template json needs to be correct because our editor needs this json.\
So creating new templates without json is possible but not very useful.

```http
POST https://api.cm.com/bulkemail/v1.0/accounts/{accountID}/templates
```

## POST Parameters

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>In</th>
      <th>Description</th>
      <th>Required</th>
      <th>Type</th>
      <th>Example</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>AccountID</td>
      <td>Path</td>
      <td>The account guid</td>
      <td>True</td>
      <td>Guid</td>
      <td>A8C062E4-ECFD-48D0-89B1-A37D2622B7A9</td>
    </tr>

    <tr>
      <td>Body</td>
      <td>Body</td>
      <td>The template to create</td>
      <td>True</td>
      <td>Json object</td>
      <td>See example request</td>
    </tr>

    <tr>
      <td>X-CM-PRODUCTTOKEN</td>
      <td>Header</td>
      <td>Your product token</td>
      <td>True</td>
      <td>Guid</td>
      <td>C24A5029-37DD-4161-9728-F80D8639588E</td>
    </tr>
  </tbody>
</table>

```json title="Example request"
{
    "Name": "Demo",
    "Description": "",
    "HtmlBody": "Omitted for clarity",
    "TextBody": "Follow [[ SpecialLink.ViewInBrowser ]] to view the message in your browser",
    "Json": "Omitted for clarity",
    "MergeFields": {
        "MergeTags": [
            {
                "Name": "Sender.EmailAddress",
                "Value": "{{ Sender.EmailAddress }}",
                "Mapping": "Sender.EmailAddress"
            },
            {
                "Name": "Recipient.EmailAddress",
                "Value": "{{ Recipient.EmailAddress }}",
                "Mapping": "Recipient.EmailAddress"
            }
        ],
        "SpecialLinks": [
            {
                "Type": "system",
                "Label": "Unsubscribe",
                "Link": "[[ SpecialLink.Unsubscribe ]]",
                "Mapping": "SpecialLink.Unsubscribe",
                "Tag" : null
            },
            {
                "Type": "system",
                "Label": "View in browser",
                "Link": "[[ SpecialLink.ViewInBrowser ]]",
                "Mapping": "SpecialLink.ViewInBrowser",
                "Tag" : null
            }
        ]
    },
    "TemplateEditorType": 2
}
```

## Responses

<table>
  <thead>
    <tr>
      <th>Http status</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>201</td>
      <td>Template created</td>
    </tr>

    <tr>
      <td>400</td>
      <td>Bad request</td>
    </tr>
  </tbody>
</table>

```json title="Example response"
{
    "ID": "6c176f77-a2cd-45bf-b318-ec6150fee028",
    "AccountID": "a65b6ba1-7b13-4cff-aaf6-c736c977c1d4",
    "Name": "Demo",
    "Description": "",
    "HtmlBody": "Omitted for clarity",
    "TextBody": "Follow [[ SpecialLink.ViewInBrowser ]] to view the message in your browser",
    "Json": "Omitted for clarity",
    "MergeFields": {
        "MergeTags": [
            {
                "Name": "Sender.EmailAddress",
                "Value": "{{ Sender.EmailAddress }}",
                "Mapping": "Sender.EmailAddress"
            },
            {
                "Name": "Recipient.EmailAddress",
                "Value": "{{ Recipient.EmailAddress }}",
                "Mapping": "Recipient.EmailAddress"
            }
        ],
        "SpecialLinks": [
            {
                "Type": "system",
                "Label": "Unsubscribe",
                "Link": "[[ SpecialLink.Unsubscribe ]]",
                "Mapping": "SpecialLink.Unsubscribe",
                "Tag" : null
            },
            {
                "Type": "system",
                "Label": "View in browser",
                "Link": "[[ SpecialLink.ViewInBrowser ]]",
                "Mapping": "SpecialLink.ViewInBrowser",
                "Tag" : null
            }
        ]
    },
    "CreatedOn": "2017-08-04T14:16:26.283",
    "CreatedOnUtc": "2017-08-04T13:16:26.283Z",
    "ModifiedOn": "2017-08-04T14:16:26.283",
    "ModifiedOnUtc": "2017-08-04T13:16:26.283Z",
    "DeletedOn": null,
    "DeletedOnUtc": null
}
```
