Skip to main content
POST
/
custom-templates
/
email
curl --request POST \ --url https://api-0{dc}.moengage.com/v1.0/custom-templates/email \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: <content-type>' \ --data ' { "basic_details": { "subject": "Email_Subject", "email_content": "<!DOCTYPE html><html><head><title>My Short HTML</title></head><body><h1>Hello, World!</h1><p>This is a simple HTML example.</p></body></html>", "thumbnail_url": "{{template_thumbnail_thumbnail_url}}", "sender_name": "Sender_Name", "preview_text": "Preview_text", "attachments": [] }, "meta_info": { "created_by": "john.doe@example.com", "template_id": "{{template_id_1}}", "template_name": "{{template_name}}", "template_version": "{{template_version}}", "locale": "{{Locale_name}}", "variation": 1 } } '
{ "external_template_id": "d05a44f0-a7cf-471a-bcb6-63054800a367" }

Rate Limit

The rate limit is 100 RPM. You can upload a maximum of 10000 templates per channel.

FAQs

You can access templates created using the Create Email Template API in the Imported API Templates tab in the second step of campaign creation in the MoEngage Dashboard.
Yes, you can create multiple templates with the same name, provided they have different versions.

Authorizations

Authorization
string
header
required

The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username:password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:

{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}

The username and password details can be obtained from the MoEngage Dashboard. If you're using the API for the first time, follow these steps:

  1. Navigate to Settings -> Account -> APIs.
  2. Copy the following details:
    • Username: Under Workspace ID (earlier app id), click the copy icon to copy the username.
    • Password: In the API keys section, click the copy icon in the Data tile to copy the API key.
  3. Use these details to authenticate the API requests.

Headers

Content-Type
string
default:application/json
required

Set the Content-Type header to application/json.

Authorization
string
required

This authentication parameter, used for access control, must be passed along with the request. To generate the authentication header, refer to Authentication.

Body

application/json
basic_details
object
required
meta_info
object
required

Response

This response is returned when the request is processed successfully.

external_template_id
string

This field contains the unique template id corresponding to a successful template creation request and needs to be stored by you. This template id would be used for searching a specific template and updating it. For a parent (default) template, the generated "external_template_id" acts as its group ID.