> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Search In-app Templates

> This API searches the In-app templates created in your MoEngage account.

<Note>
  **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.
</Note>


## OpenAPI

````yaml /api/in-app-templates/in-app-templates.yaml post /custom-templates/inapp/search
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.
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: []
tags:
  - name: In-app Templates
    description: Operations to manage In-app templates.
paths:
  /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.
      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:
  schemas:
    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
    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'
    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.
    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.
  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).

````