Skip to main content
POST
/
custom-templates
/
email
/
search
Search Email Template
curl --request POST \
  --url https://api-0{dc}.moengage.com/v1.0/custom-templates/email/search \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "page": 123,
  "entries": 123,
  "template_name": "<string>",
  "template_source": [
    "<string>"
  ],
  "template_version": "<string>",
  "template_id": "<string>",
  "template_type": [
    "<string>"
  ],
  "created_by": [
    "<string>"
  ],
  "updated_by": [
    "<string>"
  ],
  "sort_params": [
    {}
  ],
  "external_template_ids": [
    {
      "external_template_id": "<string>",
      "version": 123
    }
  ],
  "group_id": "<string>",
  "is_grouped_response": true,
  "is_count_required": true
}
'
{
  "data": [
    {
      "external_template_id": "{{external_template_id}}",
      "version": 2,
      "basic_details": {
        "email_content": "<!DOCTYPE html><html><head><title>Sample Webpage</title></head><body><h1>Welcome to My Sample Webpage 1</h1><p>This is a small example of an HTML webpage.</p><p>Below is an unordered list:</p><ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul><p>Here's an image:</p><img src=\"https://example.com/sample-image.jpg\" alt=\"Sample Image\"><p>Visit our <a href=\"https://www.example.com\">website</a> for more information.</p></body></html>",
        "subject": "Hi, Test subject 1",
        "attachments": [],
        "thumbnail_url": "https://img.freepik.com/free-vector/bright-yellow-sunflower-design-decorations_1308-130330.jpg",
        "sender_name": "test sender 1"
      },
      "meta_info": {
        "template_id": "{{template_id}}",
        "template_name": "test_template_1",
        "template_version": "0",
        "created_by": "[email protected]"
      }
    }
  ]
}
NoteWe are introducing mandatory pagination, effective November 15, 2025, all calls to this API must include the following two parameters:
  • page: The page number of the results you wish to fetch.
  • entries: The number of templates to return per page, with a maximum value of 15.
Please update all integrations to include these parameters. API requests submitted without them after the effective date will result in an error and fail to execute.

Rate Limit

The rate limit is 100 Requests 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.

Body

application/json

Note:

  • You can send empty filters to fetch all the email templates.
  • You can send only template_ids if you want specific older versions of the email template. In other cases, you will receive the latest version of the template.
  • By default, the is_default_template_of_group flag is set to "true" for the default (parent) template and "false" for child templates.
page
integer

This field contains the index of the pages to be returned in the search result.

entries
integer

This field contains the number of entries per page in the search result.

template_name
string

This field indicates the name of the template. When this value is specified, the template that matches the name specified in this field will be returned.

template_source
string[]

This field indicates the template source that created the template. For example ["API", "MOENGAGE"]. When specified, the templates whose source matches that specified in this list will be returned.

template_version
string

This field indicates the template version. When specified, the template whose template version matches that specified in this field will be returned.

template_id
string

This field indicates the template id. When specified, the template whose template id matches that specified in this field will be returned.

template_type
string[]

This field indicates whether the template is a custom one or a pre-built one. Allowed values: CUSTOM, PRE_BUILT. When specified, the templates whose template type matches that specified in this list will be returned.

created_by
string[]

This field indicates the user who created the template. When specified, the templates for which the created_by user information matches that specified in this list will be returned. Example: ["[email protected]", "[email protected]"]

updated_by
string[]

This field indicates the user who updated the template. When specified, the templates for which the updated_by user information matches that specified in this list will be returned. Example: ["[email protected]", "[email protected]"]

sort_params
object[]

This field indicates the sorting parameters for the search result and the sort order. Example: "sort_params":[{"template_name": "ASCENDING","last_modified_date": "ASCENDING","last_modified_by": "ASCENDING"}]

external_template_ids
object[]

This field indicates the list of the template ids and their versions that must be fetched. When this value is specified, the template that matches the id and version specified in this field will be returned.

group_id
string

This field indicates the group ID of the parent template. Pass the Group ID of the parent (default) template of the group to fetch all templates associated with that group. The "external_template_id" generated for the parent template acts as its group ID.

is_grouped_response
boolean

If the value is "true", this API fetches only the default template data, including additional fields such as unique locale count, unique variations, total templates in the group, and all individual templates that are not part of any group. If the value is "false", this API will fetch all individual templates and their template data.

is_count_required
boolean

If the value is "true", this API fetches total templates of the same request to support pagination on the UI.

Response

This response is returned when the request is processed successfully.

data
object[]

This field contains the list of email templates that satisfy the search criteria. For information about the template, refer to Basic Details and Meta Info.

error
object

This field contains the reason for the request's failure.