> ## 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.

# Get All Templates

> This API fetches the list of all the email templates available in your MoEngage account.


#### 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.


## OpenAPI

````yaml /api/email-templates-1/email-templates-1.yaml get /email-templates
openapi: 3.1.0
info:
  title: Email Templates API V1
  description: >
    The Create Email Template API can be used to create an email template in
    MoEngage. This API helps you upload templates created outside the MoEngage
    ecosystem to MoEngage and use them for campaign creation on the MoEngage
    Dashboard.


    <Note>

    **Note**


    Templates created using this API cannot be used in the Drag and Drop Editor
    in the MoEngage Dashboard. They are supported only for the Custom HTML
    Editor (Froala Editor).

    </Note>
  version: v2
  contact:
    name: MoEngage Support
    url: https://help.moengage.com
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.
security:
  - basicAuth: []
    appKey: []
tags:
  - name: Email Templates
    description: Manage email templates in MoEngage.
paths:
  /email-templates:
    get:
      tags:
        - Email Templates
      summary: Get All Templates
      description: >
        This API fetches the list of all the email templates available in your
        MoEngage account.
      operationId: getAllTemplates
      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
components:
  schemas:
    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
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        data:
          $ref: '#/components/schemas/ErrorData'
    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
  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).

````