Skip to main content
PUT
/
email-templates
/
{id}
Update Specific Template
curl --request PUT \
  --url https://api-{dc}.moengage.com/v2/email-templates/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'MOE-APPKEY: <moe-appkey>' \
  --data '
{
  "name": "End_Of_Season_Sale_Template",
  "html": "<!DOCTYPE html><html><body><p>Content</p></body></html>",
  "source": "Partner",
  "subject": "End of Season Sale!",
  "attachments": [
    "https://app-cdn.moengage.com/assets/LogoThumbnail.jpg"
  ],
  "sender_name": "Your Brand Name",
  "updated_by": "[email protected]"
}
'
{
  "status": "success",
  "data": {
    "id": "63f4962d4d31f4c68d980a01",
    "msg": "Custom email template updated"
  }
}

Rate Limit

The rate limits are at the workspace level, and a maximum of 1000 (sum of all the API requests per workspace) requests are allowed for a workspace per minute.

Authorizations

Authorization
string
header
required

Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.

  • Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
  • Password: Use your API Key, which you can find within the Data tile.

For more information on authentication and getting your credentials, refer here.

Headers

MOE-APPKEY
string
required

This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).

Path Parameters

id
string
required

This is the Template id of the template being updated. It is mandatory to add this field when updating a template.

Example:

"63f30792c66ddcaac2ef9109"

Body

application/json
name
string
required

This field contains the name of the template and would be used for identifying the template. You can look for the template created using this API in the second step of campaign creation in the 'My Saved Templates' tab using this name.

Note:

  • The name field can contain only alphanumeric and underscore characters.
  • The length of this field can be between 5-50 characters.
Required string length: 5 - 50
Example:

"End_Of_Season_Sale_Template"

html
string
required

This field contains the message body of the email. This is where you define the email template being created. The HTML tag and BODY tag (with text/tags) are mandatory. The SCRIPT tag is not allowed.

Example:

"<!DOCTYPE html><html><body><p>Content</p></body></html>"

source
string
required

This field contains information about the source of template creation. This can be the name of the email partner.

Note: Only alphanumerics, spaces, and underscores are allowed in this field.

Example:

"Partner"

subject
string

This field contains the subject of the email campaign.

Example:

"End of Season Sale!"

attachments
string<uri>[]

This field contains the attachments to be included in the email.

Note:

  • Only URLs can be added as part of Email attachments.
  • A maximum of ten attachments are allowed.
  • The URL should start with https and end with a valid extension. The following extensions are not allowed: .dmg, .exe, .xls, .ddl, .class, .obj, .int, .gnt, .o, .so, .lbr, and .net
  • Individual attachments should be less than 6 MB, and the total size of the attachments should be less than 20 MB.
Maximum array length: 10
sender_name
string

This field contains the name displayed that is displayed in the inboxes of your recipients. Sender names are one of the first things people see when you send them an email.

Example:

"Your Brand Name"

updated_by
string

This field contains information about who created the template.

Note: Only alphanumerics, spaces, and hyphens are allowed in this field. This field can contain the email ID of the creator as well. The email id should be in the right format and a valid one.

Response

This response is returned when the request is processed successfully.

status
string

This field contains the status of the request and denotes whether it was successful or not.

Example:

"success"

data
object

This field contains the id of the created template when the request is successful and the error details in case of an unsuccessful request.