Skip to main content
PUT
/
custom-templates
/
email
/
search
Update Email Template
curl --request PUT \
  --url https://api-0{dc}.moengage.com/v1.0/custom-templates/email/search \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "external_template_id": "<string>",
  "basic_details": {
    "email_content": "<string>",
    "subject": "<string>",
    "thumbnail_url": "<string>",
    "sender_name": "<string>",
    "attachments": [
      "https://app-cdn.moengage.com/assets/LogoThumbnail.jpg"
    ],
    "preview_text": "<string>"
  },
  "meta_info": {
    "template_id": "<string>",
    "template_name": "<string>",
    "template_version": "<string>",
    "created_by": "<string>",
    "locale": "<string>",
    "variation": 123,
    "group_id": "<string>"
  },
  "update_campaigns": true,
  "update_latest_version": true
}
'
{ "external_template_id": "d05a44f0-a7cf-471a-bcb6-63054800a367" }

Rate Limit

The rate limit is 100 RPM.

Version Limit

You can have a maximum of 15 versions for a template.

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
external_template_id
string
required

This field contains the unique identifier that is generated during the creation of the template.

basic_details
object
required
meta_info
object
required
update_campaigns
boolean

This field contains a flag that is used to update all the campaigns that are currently using the template being updated to the newer version(that is being updated in this request). The default value for this flag is false.

When the update_campaigns flag is true, all the campaigns running with this template will get updated to the latest version of the template, and when it is false, the new version of the template will be created, but there will be no change made to the template used in the existing campaigns.

update_latest_version
boolean

If the value is "true," this API does not create a new version of the template but only updates its contents.

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 updation request.