openapi: 3.0.3 info: title: MoEngage In-app Template API version: '1.0' description: API for creating, updating, and searching In-app templates (Self-Handled and HTML) within the MoEngage platform. tags: - name: In-app Templates description: Operations to manage In-app templates. servers: - url: https://api-{dc}.moengage.com/v1.0 description: MoEngage Custom Templates 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. security: - basicAuth: [] paths: /custom-templates/inapp: post: tags: - In-app Templates summary: Create In-app Template description: >- This API creates an In-app template in MoEngage. You can use this API to upload templates created outside the MoEngage ecosystem to MoEngage and use them for campaign creation. x-mint: content: | **Information** Only self-handled and HTML template types are supported. requestBody: required: true description: The details of the In-app template to be created. content: application/json: schema: $ref: '#/components/schemas/CreateInAppTemplateRequest' examples: self_handled: summary: Self-Handled Template value: basic_details: payload: "{'jsonKey': 'jsonValue', 'title': 'hello world'}" inapp_template_type: SELF_HANDLED meta_info: created_by: test@example.com template_id: self_handled_123 template_name: My Self-Handled Template template_version: '1' html: summary: HTML Template value: basic_details: payload:

Hello World

inapp_template_type: INAPP_HTML meta_info: created_by: test@example.com template_id: html_promo_456 template_name: My HTML Promo template_version: '1' responses: '200': description: Template created successfully. content: application/json: schema: type: object properties: external_template_id: type: string format: uuid description: >- This field contains the unique ID corresponding to a successful custom template creation. This template ID is used as header input for update, search, or any kind of template modifications in later stage. example: 4a1afbc5-4c31-4f19-8c23-793e27af01aa '400': description: >- Bad Request. 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' example: error: code: 400 Bad Request message: Validation failed because of invalid request data details: - code: MissingValue target: template_id message: template_id value is required but value is passed empty. request_id: NpiintyO '401': description: >- Authorization Failure. This response is returned when the authorization parameters are missing in the HTTP Auth Header. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '415': description: >- Unsupported File Type. This response is returned when the header Content-Type is not provided/is not supported. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: >- Rate Limit Breach. 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' '5XX': description: >- Internal Server Error. This response is returned when the system runs into an unexpected error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - In-app Templates summary: Update In-app Template description: This API updates an In-app template as per your requirements. requestBody: required: true description: The updated details for the In-app template. content: application/json: schema: $ref: '#/components/schemas/UpdateInAppTemplateRequest' example: external_template_id: 4a1afbc5-4c31-4f19-8c23-793e27af01aa update_campaigns: false basic_details: payload:

Hello Updated World!

inapp_template_type: INAPP_HTML meta_info: template_name: My Updated HTML Promo updated_by: jane.doe@example.com responses: '200': description: Template updated successfully. content: application/json: schema: type: object properties: external_template_id: type: string format: uuid description: >- This field contains the unique ID corresponding to a successful custom template update. This template ID is used as header input for updates, searches, or any kind of template modifications in a later stage. example: 4a1afbc5-4c31-4f19-8c23-793e27af01aa '400': description: >- Bad Request. 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' example: error: code: 400 Bad Request message: Validation failed because of invalid request data details: - code: MissingValue target: updated_by message: updated_by attribute is missing in meta_info. request_id: cjUaLVrE '5XX': description: >- Internal Server Error. This response is returned when the system runs into an unexpected error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /custom-templates/inapp/search: post: tags: - In-app Templates summary: Search In-app Templates description: This API searches the In-app templates created in your MoEngage account. x-mint: content: | **Mandatory Pagination** 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. requestBody: required: true description: >- Search filters for finding In-app templates. content: application/json: schema: $ref: '#/components/schemas/SearchInAppTemplateRequest' example: page: 1 entries: 15 template_source: - API sort_params: - template_name: ASCENDING responses: '200': description: The template was searched successfully. content: application/json: schema: $ref: '#/components/schemas/SearchInAppTemplateResponse' '400': description: >- Bad Request. 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' example: error: code: 400 Bad Request message: Validation failed because of invalid request data details: - code: MissingValue target: external_template_ids message: external_template_id or version is missing in external_template_ids. request_id: npmQrbNE '429': description: >- Rate Limit Breach. This response is returned when the number of requests per minute has exceeded the rate limit. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '5XX': description: >- Internal Server Error. This response is returned when the system runs into an unexpected error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: 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 **Campaign report/Business events/Custom templates/Catalog API/Inform Report** tile. For more information on authentication and getting your credentials, refer [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials). schemas: ErrorResponse: type: object description: This field contains the reason for the request's failure. 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. This field is present in the response only in the case of errors. message: type: string description: >- This field describes why the request has failed and is a String. For example, in the case of a duplicate request (400- Bad Request), the following message will be present: 'Duplicate - template_id and template_version'. 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. CreateInAppTemplateRequest: type: object required: - basic_details - meta_info properties: basic_details: type: object description: >- This field contains details about the template to be created, including its payload and template type. required: - payload - inapp_template_type properties: payload: type: string description: A stringified JSON or HTML content for the template. inapp_template_type: type: string enum: - SELF_HANDLED - INAPP_HTML meta_info: type: object description: >- This field contains information about the template being created, such as its name, version, and ID and the creator's details. required: - created_by - template_id - template_name - template_version properties: created_by: type: string description: Identifier for the creator of the template. template_id: type: string description: A unique ID for the template provided by you. template_name: type: string description: The name of the template. template_version: type: string description: The version of the template. UpdateInAppTemplateRequest: type: object required: - external_template_id - basic_details - meta_info properties: external_template_id: type: string format: uuid description: >- The external template ID needs to be updated. This field contains the unique identifier that is generated during the creation of the template. update_campaigns: type: boolean default: false description: >- This field contains a flag used to update all campaigns currently using the template to the newer version. When true, all running campaigns with this template will be updated. When false, no change will be made to the template used in existing campaigns. basic_details: type: object description: >- Details about the template, including its payload and template type. required: - payload - inapp_template_type properties: payload: type: string description: The updated stringified JSON or HTML content. inapp_template_type: type: string enum: - SELF_HANDLED - INAPP_HTML meta_info: type: object description: >- This field will update template information, such as the name of the template and the update's details. required: - template_name - updated_by properties: template_name: type: string description: The name of the template being updated. updated_by: type: string format: email description: The email ID of the person updating the template. SearchInAppTemplateRequest: type: object description: >- **Notes:** - `page` and `entries` are mandatory effective November 15, 2025. All other fields are optional. - If the request body is passed empty, then all templates will be returned. - Here, the preview_image field will be generated by MoEngage for the HTML template payload. required: - page - entries properties: page: type: integer description: >- This field contains the index of the pages to be returned in the search result. Mandatory after Nov 15, 2025. entries: type: integer description: >- This field contains the number of entries per page in the search result. Max 15. Mandatory after Nov 15, 2025. 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 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. items: type: string enum: - API - MOENGAGE template_type: type: array description: >- This field indicates whether the template is a custom one or a pre-built one. Allowed values: CUSTOM, PRE_BUILT. items: type: string enum: - CUSTOM - PRE_BUILT created_by: type: array 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. items: type: string format: email updated_by: type: array 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. items: type: string format: email sort_params: type: array description: >- Sort the templates by multiple fields in ASCENDING or DESCENDING order: template_name, last_modified_date, last_modified_by. items: type: object properties: template_name: type: string enum: - ASCENDING - DESCENDING last_modified_date: type: string enum: - ASCENDING - DESCENDING last_modified_by: type: string enum: - ASCENDING - DESCENDING template_ids: type: array description: >- Search multiple templates using Pair of external_template_id and version. items: type: object properties: external_template_id: type: string format: uuid version: type: integer InAppTemplate: type: object properties: external_template_id: type: string format: uuid description: The unique ID assigned to the template by MoEngage. version: type: integer description: The version of the template. basic_details: type: object properties: payload: type: string description: The content payload of the template (e.g., HTML string or JSON). preview_image: type: string format: uri description: The URL of the preview image generated for the template. inapp_template_type: type: string description: The type of the In-app template. enum: - SELF_HANDLED - INAPP_HTML meta_info: type: object properties: template_id: type: string description: The unique identifier for the template provided by the creator. template_name: type: string description: The name of the template. template_version: type: string description: The version string of the template. created_by: type: string description: The email ID of the creator. channel: type: string description: The marketing channel for the template (e.g., INAPP). example: INAPP template_source: type: string description: The source platform where the template was created. enum: - API - MOENGAGE template_type: type: string description: Categorization of the template (e.g., CUSTOM, PRE_BUILT). enum: - CUSTOM - PRE_BUILT created_by: type: string description: The email ID of the user who created the template. created_at: type: string format: date-time description: The date and time when the template was created. updated_by: type: string description: The email ID of the user who last updated the template. updated_at: type: string format: date-time description: The date and time when the template was last updated. SearchInAppTemplateResponse: type: object properties: data: type: array description: >- This field contains all the details of the template searched, such as the meta info, template ID, template version, payload, date and time the template was created or updated, and the user attribute of the user who created or updated the template. items: $ref: '#/components/schemas/InAppTemplate'