> ## 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 Specific Template

> This API fetches an email template using its template ID.


#### 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/{id}
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/{id}:
    get:
      tags:
        - Email Templates
      summary: Get Specific Template
      description: |
        This API fetches an email template using its template ID.
      operationId: getTemplateById
      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: <!DOCTYPE html><html>...</html>
                    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
components:
  schemas:
    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
    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).

````