openapi: 3.2.0 info: title: Moengage Email Templates API version: '1.0' description: 'Operations tagged Email Templates across 2 of this provider''s published API definitions: moengage-email-templates-1-openapi.yml, moengage-email-templates-2-openapi.yml. Each path carries the servers of the definition it was published in.' servers: - url: https://api-{dc}.moengage.com/v2 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. - url: https://api-{dc}.moengage.com/v1.0 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. tags: - name: Email Templates description: Manage email templates in MoEngage. paths: /email-templates: post: summary: Create Email Template (V1) description: 'This API creates an email template in MoEngage. You can use this API to upload templates created outside the MoEngage ecosystem to MoEngage and use them for campaign creation on the MoEngage dashboard. ' operationId: createEmailTemplate tags: - Email Templates x-mint: content: '#### 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. ' parameters: - name: MOE-APPKEY in: header required: true schema: type: string description: '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)**. ' example: APP ID requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TemplateCreateRequest' responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: status: type: string example: success description: 'This field contains the status of the request and denotes whether it was successful or not. ' data: type: object properties: id: type: string description: 'This field contains the template id and needs to be stored by you. This template id would be used for searching a specific template and updating it. The template id is a String. ' example: 63f4962d4d31f4c68d980a01 msg: type: string description: 'This field contains information about the successful creation of the template. ' example: Custom email template saved examples: Success: value: status: success data: id: 63f4962d4d31f4c68d980a01 msg: Custom email template saved '400': description: This response is returned when the required parameters are missing from the request or when the provided parameters are invalid, or when a template already exists with the same version, name, or id. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: InvalidRequestBody: value: status: error data: code: 400 title: Invalid request body description: MOE-APPKEY header is invalid or empty EmptyName: value: status: error data: code: 400 title: Invalid email name description: Name field is empty '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: AuthFailure: value: status: error data: code: 401 title: Authentication required description: Invalid APP_ID used in Authentication Header '429': description: This response is returned when the number of requests per minute has exceeded the rate limit. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: RateLimit: value: status: error data: code: 429 title: rate limiter exception description: Exceeded rate limit for this app '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: ServerError: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] appKey: [] get: summary: Get All Templates description: 'This API fetches the list of all the email templates available in your MoEngage account. ' operationId: getAllTemplates tags: - Email Templates x-mint: content: '#### 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. ' parameters: - name: MOE-APPKEY in: header required: true schema: type: string description: '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)**. ' example: WORKSPACE ID - name: page in: query description: 'This parameter represents the page number. If this value is not specified, it will be considered as one by default. Each page will have a batch size of 20( 20 templates will be returned in a page). ' schema: type: integer default: 1 example: 1 responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: status: type: string example: success description: This field contains the status of the request and denotes whether it was successful or not. data: type: object description: 'This field contains the id of the created template when the request is successful and the error details in case of an unsuccessful request. ' properties: templates: type: array items: $ref: '#/components/schemas/TemplateDetails' no_of_templates: type: integer description: The number of templates returned is also available in the response. example: 13 examples: Success: value: status: success data: templates: - template_id: 645a2bd910e0307e6d7f7717 template_name: Coupon_code_template is_archived: false builder_supported: false editor: Froala Editor created_date: '2023-05-09 11:17:43.112000' updated_at: '2023-05-09 11:18:37.692000' updated_by: jane.doe@example.com no_of_templates: 13 '400': description: This response is returned when the required parameters are missing from the request or when the provided parameters are invalid, or when a template already exists with the same version, name, or id. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: InvalidTemplateId: value: status: error data: code: 400 title: Invalid template id description: Please provide a valid template id '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: AuthFailure: value: status: error data: code: 401 title: Authentication required description: Invalid APP_ID used in Authentication Header '429': description: This response is returned when the number of requests per minute has exceeded the rate limit or the number of templates has exceeded the allowed quota per channel. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: RateLimit: value: status: error data: code: 429 title: rate limiter exception description: Exceeded rate limit for this app '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: ServerError: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] appKey: [] servers: - url: https://api-{dc}.moengage.com/v2 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. /email-templates/{id}: get: summary: Get Specific Template description: 'This API fetches an email template using its template ID. ' operationId: getTemplateById tags: - Email Templates x-mint: content: '#### 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. ' parameters: - name: MOE-APPKEY in: header required: true schema: type: string description: '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)**. ' example: Workspace ID - name: id in: path required: true description: 'This is the Template id of the template being searched. The template id is a unique identifier that is generated at the time of template creation. ' schema: type: string example: 63f30792c66ddcaac2ef9109 responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: $ref: '#/components/schemas/TemplateDetailsFlat' examples: Success: value: status: success template_id: 645a0cec10e0307e6d7f7716 template_name: End_of_season_sale_template subject: '' template_content: ... attachments: [] source: Partner sender_name: Your Brand Name editor: Froala Editor created_date: '2023-05-09 09:05:46.350000' updated_at: '2023-05-09 10:00:57.149000' updated_by: john.doe@example.com '400': description: This response is returned when the required parameters are missing from the request or when the provided parameters are invalid, or when a template already exists with the same version, name, or id. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: InvalidTemplateId: value: status: error data: code: 400 title: Invalid template id description: Please provide a valid template id '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: AuthFailure: value: status: error data: code: 401 title: Authentication required description: Invalid APP_ID used in Authentication Header '429': description: This response is returned when the number of requests per minute has exceeded the rate limit, or the number of templates has exceeded the allowed quota per channel. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: RateLimit: value: status: error data: code: 429 title: rate limiter exception description: Exceeded rate limit for this app '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: ServerError: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] appKey: [] put: summary: Update Specific Template description: Updates an existing email template by specifying its template ID in the path. operationId: updateTemplateById tags: - Email Templates x-mint: content: '#### 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. ' parameters: - name: MOE-APPKEY in: header required: true schema: type: string description: '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)**. ' example: Workspace ID - name: id in: path required: true description: 'This is the Template id of the template being updated. It is mandatory to add this field when updating a template. ' schema: type: string example: 63f30792c66ddcaac2ef9109 requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TemplateUpdateRequest' responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: status: type: string example: success description: This field contains the status of the request and denotes whether it was successful or not. data: type: object description: This field contains the id of the created template when the request is successful and the error details in case of an unsuccessful request. properties: id: type: string example: 63f4962d4d31f4c68d980a01 msg: type: string example: Custom email template updated '400': description: This response is returned when the required parameters are missing from the request or when the provided parameters are invalid, or when a template already exists with the same version, name, or id. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: This response is returned when the number of requests per minute has exceeded the rate limit or the number of templates has exceeded the allowed quota per channel. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' security: - basicAuth: [] appKey: [] servers: - url: https://api-{dc}.moengage.com/v2 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. /bulk/email-templates: put: summary: Bulk Create/Update Templates description: 'This API creates or updates email templates in bulk. You can create or update up to 50 templates in a single request. ' operationId: bulkCreateUpdateTemplates tags: - Email Templates x-mint: content: '#### 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. ' parameters: - name: MOE-APPKEY in: header required: true schema: type: string description: '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)**. ' example: APP ID requestBody: required: true content: application/json: schema: type: array description: You can pass the templates to be created and/or updated as an array of JSON Objects. maxItems: 50 items: $ref: '#/components/schemas/TemplateBulkUpdateRequest' responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: status: type: string example: success description: This field contains the status of the request and denotes whether it was successful or not. data: type: object description: This field contains the id of the created template when the request is successful and the error details in case of an unsuccessful request. properties: new_templates: type: array items: type: string description: 'This field contains the list of template ids for the newly created templates, and these need to be stored by you. The template id would be used for searching a specific template and updating it. ' example: - 63f497844d31f4c68d980a02 - 63f499344d31f4c68d720b04 updated_templates: type: array items: type: string description: 'This field contains the list of template ids for the updated templates. ' example: - 645a2bd910e0307e6d7f7717 examples: Success: value: status: success data: new_templates: - 645a2c0d10e0307e6d7f7719 updated_templates: - 645a2bd910e0307e6d7f7717 '400': description: This response is returned when the required parameters are missing from the request or when the provided parameters are invalid, or when a template already exists with the same version, name, or id. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: ValidationFailure: value: status: success data: new_templates: - Email attachment should be valid one with size less than 6mb & total attachments size less than 20mb updated_templates: - Given id is invalid email template id '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: AuthFailure: value: status: error data: code: 401 title: Authentication required description: Invalid APP_ID used in Authentication Header '429': description: This response is returned when the number of requests per minute has exceeded the rate limit or the number of templates has exceeded the allowed quota per channel. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: RateLimit: value: status: error data: code: 429 title: rate limiter exception description: Exceeded rate limit for this app '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: ServerError: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] appKey: [] servers: - url: https://api-{dc}.moengage.com/v2 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. /custom-templates/email: post: summary: Create Email Template (V2) description: 'This API creates an email template in MoEngage. You can use this API to upload templates created outside the MoEngage ecosystem to MoEngage and use them for campaign creation. The uploaded templates can be edited in the Froala editor (custom HTML editor) on the MoEngage dashboard. ' operationId: createEmailTemplate tags: - Email Templates x-mint: content: '#### Rate Limit The rate limit is 100 RPM. You can upload a maximum of 10000 templates per channel. ' requestBody: required: true content: application/json: schema: type: object required: - basic_details - meta_info properties: basic_details: $ref: '#/components/schemas/BasicDetails' meta_info: $ref: '#/components/schemas/MetaInfo' examples: Parent Template in a Template Group: summary: Parent Template in a Template Group value: basic_details: subject: Email_Subject email_content: My Short HTML

Hello, World!

This is a simple HTML example.

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 Associated Templates in the Same Template Group: summary: Associated Templates in the Same Template Group value: basic_details: subject: Email_Subject email_content: My Short HTML

Hello, World!

This is a simple HTML example.

thumbnail_url: '{{template_thumbnail_image_url}}' sender_name: Sender_Name preview_text: Preview_text attachments: [] meta_info: created_by: john.doe@example.com template_id: '{{template_id_2}}' template_name: '{{template_name}}' template_version: '{{template_version}}' locale: '{{Locale_name}}' variation: 2 group_id: '{{external_template_id_of_parent_template}}' responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: external_template_id: type: string description: '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. ' examples: success: value: external_template_id: d05a44f0-a7cf-471a-bcb6-63054800a367 '400': description: This response is returned when the required parameters are missing from the request, or when the provided parameters are invalid, or when a template already exists with the same version, name, or id. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: validation_failure: value: error: code: 400 Bad Request message: Validation failed because of invalid request data details: - code: MissingValue target: template_id message: template_id value is too short request_id: LMwPhRMB duplicate_request: value: error: code: 400 Bad Request message: Duplicate - template_id and template_version details: - code: InvalidValue target: Duplicate - template_id and template_version message: template_id:EndOfSeasonSale template_version:10 is already present. request_id: cLCcgLQj limit_breach: value: error: code: 400 Bad Request message: Maximum Template limit exceeded details: - code: NotSupported target: Maximum Template limit exceeded message: You have already created maximum allowed template allowed for client request_id: eLeZXIlW '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: auth_fail: value: title: Authentication required description: MOE-APPKEY missing in Authentication Header '415': description: This response is returned when the header Content-Type is not provided/is not supported. content: application/json: schema: type: object properties: title: type: string description: type: string examples: unsupported: value: title: Unsupported media type description: Content type is not supported '429': description: This response is returned when the number of requests per minute has exceeded the rate limit, or the number of templates has exceeded the allowed quota per channel. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: rate_limit: value: response_id: OUUkHvcn type: custom_template error: code: Too Many Requests message: 'API rate limit breached. Current limit: n/m mins' '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: server_error: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] put: summary: Update Email Template description: 'This API updates an email template by specifying its external template ID. You can specify whether the updated version of the template can be used in active campaigns in the request. ' operationId: updateEmailTemplate tags: - Email Templates x-mint: content: '#### Rate Limit The rate limit is 100 Requests Per Minute. ' requestBody: required: true content: application/json: schema: type: object required: - external_template_id - basic_details - meta_info properties: external_template_id: type: string description: This field contains the unique identifier that is generated during the creation of the template. update_campaigns: type: boolean description: '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: type: boolean description: If the value is "true," this API does not create a new version of the template but only updates its contents. basic_details: $ref: '#/components/schemas/BasicDetails' meta_info: $ref: '#/components/schemas/MetaInfo' responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: external_template_id: type: string description: This field contains the unique template id corresponding to a successful template updation request. examples: success: value: external_template_id: d05a44f0-a7cf-471a-bcb6-63054800a367 '400': description: This response is returned when the required parameters are missing from the request or when the provided parameters are invalid. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: invalid_id: value: error: code: 400 Bad Request message: Invalid template id details: - code: MissingValue target: 9925c8 message: 9925c8 is invalid template id. request_id: 12345requestid limit_breach: value: error: code: 400 Bad Request message: Maximum Template limit exceeded details: - code: NotSupported target: Maximum Template limit exceeded message: You have already created maximum allowed template allowed for client request_id: eLeZXIlW '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: type: object properties: title: type: string description: type: string examples: auth_fail: value: title: Authentication required description: MOE-APPKEY missing in Authentication Header '415': description: This response is returned when the header Content-Type is not provided/is not supported. content: application/json: schema: type: object properties: title: type: string description: type: string examples: unsupported: value: title: Unsupported media type description: Content type is not supported '429': description: This response is returned when the number of requests per minute has exceeded the rate limit, or the number of templates has exceeded the allowed quota per channel. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: rate_limit: value: response_id: response_id_example type: custom_template error: code: Too Many Requests message: 'API rate limit breached. Current limit: n/m mins' '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: server_error: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] servers: - url: https://api-{dc}.moengage.com/v1.0 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. /custom-templates/email/search: post: summary: Search Email Template description: 'This API searches the email templates created in your MoEngage account. ' operationId: searchEmailTemplate tags: - Email Templates x-mint: content: ' **Note** We 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. ' requestBody: required: true content: application/json: schema: type: object description: '**Note:** - `page` and `entries` are mandatory effective November 15, 2025. All other fields are optional. - 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.' required: - page - entries properties: page: type: integer description: This field contains the index of the pages to be returned in the search result. entries: type: integer description: This field contains the number of entries per page in the search result. Maximum value is 15. maximum: 15 template_name: type: string description: 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: type: array items: type: string description: 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: type: string description: This field indicates the template version. When specified, the template whose template version matches that specified in this field will be returned. template_id: type: string description: This field indicates the template id. When specified, the template whose template id matches that specified in this field will be returned. template_type: type: array items: type: string description: '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: type: array items: type: string description: '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: ["user1@moengage.com", "user2@moengage.com"] ' updated_by: type: array items: type: string description: '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: ["user1@moengage.com", "user2@moengage.com"] ' sort_params: type: array items: type: object description: '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: type: array items: type: object properties: external_template_id: type: string version: type: integer description: '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: type: string description: '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: type: boolean description: '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: type: boolean description: If the value is "true", this API fetches total templates of the same request to support pagination on the UI. responses: '200': description: This response is returned when the request is processed successfully. content: application/json: schema: type: object properties: data: type: array description: '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. ' items: type: object properties: external_template_id: type: string version: type: integer meta_info: $ref: '#/components/schemas/MetaInfo' basic_details: $ref: '#/components/schemas/BasicDetails' created_by: type: string created_at: type: string updated_by: type: string updated_at: type: string error: type: object description: This field contains the reason for the request's failure. properties: code: type: string description: This field contains the error code that provides a brief explanation of the error and is a String. message: type: string description: This field describes why the request has failed and is a String. details: type: array description: This is a List of the error details objects. items: type: object request_id: type: string description: This field contains the unique id pertaining to the request. examples: success: value: data: - external_template_id: '{{external_template_id}}' version: 2 basic_details: email_content: Sample Webpage

Welcome to My Sample Webpage 1

This is a small example of an HTML webpage.

Below is an unordered list:

Here's an image:

Sample Image

Visit our website for more information.

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: user1@moengage.com '400': description: This response is returned when the required parameters are missing from the request, when the provided parameters are invalid, or when a template already exists with the same version, name, or ID. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: invalid_field: value: error: code: 400 Bad Request message: Invalid Field Value details: - code: InvalidValue target: - template_name - created_by message: Some of the field values are invalid request_id: '{{request_id}}' '401': description: This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse_2' examples: auth_fail: value: error: code: 401 Unauthorized message: Authentication required details: - code: InvalidValue target: APP_ID message: Invalid APP_ID is provided. request_id: '{{request_id}}' '429': description: This response is returned when the number of requests per minute has exceeded the rate limit. content: application/json: schema: type: object properties: response_id: type: string type: type: string error: type: object properties: code: type: string message: type: string examples: rate_limit: value: response_id: '{{response_id}}' type: custom_template error: code: Too Many Requests message: 'API rate limit breached. Current limit: n/m mins' '500': description: This response is returned when the system runs into an unexpected error. content: application/json: schema: type: object properties: title: type: string message: type: string examples: server_error: value: title: Internal Server Error message: An unexpected error was encountered while processing this request. Please contact MoEngage Team security: - basicAuth: [] servers: - url: https://api-{dc}.moengage.com/v1.0 description: MoEngage API Server variables: dc: default: '01' description: The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101. components: schemas: ErrorResponse: type: object properties: status: type: string example: error data: $ref: '#/components/schemas/ErrorData' TemplateCreateRequest: allOf: - $ref: '#/components/schemas/TemplateBase' TemplateDetailsFlat: type: object properties: status: type: string example: success description: 'This field contains the status of the request and denotes whether it was successful or not. ' template_id: type: string example: 645a0cec10e0307e6d7f7716 description: 'This field contains the id of the created template when the request is successful and the error details in case of an unsuccessful request. ' template_name: type: string example: End_of_season_sale_template subject: type: string description: subject of the template being fetched template_content: type: string description: html content of the template attachments: type: array description: 'The attachments field is a list of JSON Objects that contain the details about an attachment, such as its type, url, name, id, and so on. ' items: type: object properties: id: type: string name: type: string type: type: string fileType: type: string url: type: string source: type: string description: source of the template being fetched sender_name: type: string editor: type: string created_date: type: string description: timestamp of template creation updated_at: type: string description: timestamp of when the template was last updated updated_by: type: string description: details about who created or updated the template TemplateUpdateRequest: allOf: - $ref: '#/components/schemas/TemplateBase' TemplateBulkUpdateRequest: allOf: - $ref: '#/components/schemas/TemplateBase' - type: object properties: id: type: string description: 'This is the Template id of the template being updated. It is mandatory to add this field when updating a template. The template id is a unique identifier that is generated at the time of template creation using the Create Email Template API. ' example: 63f30792c66ddcaac2ef9109 TemplateBase: type: object required: - name - html - source properties: name: type: string minLength: 5 maxLength: 50 pattern: ^[a-zA-Z0-9_]+$ description: '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. ' example: End_Of_Season_Sale_Template html: type: string description: '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:

Content

subject: type: string description: This field contains the subject of the email campaign. example: End of Season Sale! attachments: type: array description: '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. ' maxItems: 10 items: type: string format: uri example: https://app-cdn.moengage.com/assets/LogoThumbnail.jpg sender_name: type: string description: '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 source: type: string description: '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 updated_by: type: string description: '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. ' example: john.doe@example.com ErrorData: type: object properties: code: type: integer description: 'This field contains the error code and is a String. Example: 400 (for a Bad Request), 401( for Authentication failures), and so on. This field is present in the response only in the case of errors. ' example: 400 title: type: string description: 'This field contains the type of error encountered. Example: Bad Request, Authentication Required, and so on. This field is present in the response only in the case of errors. ' example: Invalid request body description: type: string description: 'This field describes why the request has failed and is a String. ' example: MOE-APPKEY header is invalid or empty TemplateDetails: type: object properties: template_id: type: string description: Template id - the unique identifier that is created at the time of template creation example: 645a2bd910e0307e6d7f7717 template_name: type: string description: name of the template being fetched example: Coupon_code_template is_archived: type: boolean example: false builder_supported: type: boolean description: 'For the Froala editor, the builder_supported value is false. Thus, for all the templates created using APIs, this would be false. ' example: false editor: type: string example: Froala Editor created_date: type: string description: timestamp of template creation example: '2023-05-09 11:17:43.112000' updated_at: type: string description: timestamp of when the template was last updated example: '2023-05-09 11:18:37.692000' updated_by: type: string description: details about who created or updated the template example: jane.doe@example.com BasicDetails: type: object description: 'This field contains the email content. This is where you define the email template being created. ' required: - email_content - subject - thumbnail_url - sender_name properties: email_content: type: string description: This field contains the title of the message. subject: type: string description: 'This field contains the subject of the email campaign. **Example**: "End of Season Sale!" ' attachments: type: array description: '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. ' items: type: string format: uri example: https://app-cdn.moengage.com/assets/LogoThumbnail.jpg thumbnail_url: type: string description: This field contains the image URL used to generate a preview in the Imported API Templates section on the MoEngage dashboard. sender_name: type: string description: 'This field contains the name 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**: "sender_name": "Your Brand Name" ' preview_text: type: string description: 'This field contains the preview text, the text that appears below the subject line in the inbox. Example: "preview_text": "Let Your Summer Look Shine" ' ErrorResponse_2: type: object properties: error: type: object properties: code: type: string description: This field contains the error code that provides a brief explanation of the error and is a String. For example, 400 - Bad Request, 401- Authentication required, and so on. message: type: string description: This field describes why the request has failed and is a String. details: type: array description: This is a List of the error details objects. items: type: object properties: code: type: string description: Descriptive Error Code target: type: string description: Denotes the field causing the issue or a brief description of the error message in some cases message: type: string description: Descriptive Error Message request_id: type: string description: This field contains the unique id pertaining to the request. MetaInfo: type: object description: 'This field contains information about the template being created, such as the name, version, and ID of the template and the creator''s details. ' required: - template_id - template_name - template_version - created_by properties: template_id: type: string description: This field contains the ID for the template and is unique. This ID should be generated by you and will be used for updating or retrieving the template using the template APIs. template_name: type: string description: This field contains the name of the template. This value should be generated by you and would be used for identifying the template. template_version: type: string description: This field contains the version of the template and is unique. This value should be generated by you and would be used for tracking the template's version. created_by: type: string description: This field contains details about who created the template. This value should be generated by you. For example, you can pass the email id of the user creating the template here. locale: type: string description: 'This field contains the locale to be associated with the template. These are the locales available in the MoEngage Dashboard at **Settings > Advanced settings > Locales**. ' variation: type: integer description: This field contains the variation of the template. You can add a maximum of five variations to each template. group_id: type: string description: 'This field contains the group ID of the template. * Parent template: A parent template is the "default" template with which you can associate child templates. You need not pass a Group ID for a parent template. The "external_template_id" generated for the parent template acts as its group ID. * Child template: Pass the Group ID of the parent (default) template with which you want to associate the child template. ' securitySchemes: basicAuth: type: http scheme: basic description: '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](https://www.moengage.com/docs/api/introduction#getting-your-credentials). ' x-refined-from: - moengage-email-templates-1-openapi.yml - moengage-email-templates-2-openapi.yml