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

# Get Specific Template

> The Get a Specific Email Template API fetches an email template using its template id.


### Rate Limit

The rate limits are at the app level, and a maximum of thousand (sum of all the API requests per app)requests are allowed for an app per minute.

### FAQ

**What happens when you search for a deleted template?**

The error description contains the following message in such a case: "Template for given template id is archived".


## 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: >
          Each customer is hosted on a different data center; you can find your
          data center number (value of X) by checking the [data center and API
          endpoint mapping
          page](https://help.moengage.com/hc/en-us/articles/360057030512-Data-Centers-in-MoEngage#01G5DQVXGT2KZMXTJPF77QPJ25).
        enum:
          - '01'
          - '02'
          - '03'
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: >
        The Get a Specific Email Template 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 your MoEngage account's Workspace ID, which must be passed
            along with the request. You can find your MoEngage Workspace ID at
            **Settings** -> **Account** -> **APIs** -> **Workspace ID**.
          example: Workspace ID
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            enum:
              - application/json
          description: Set the Content-Type header to application/json.
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
          description: >
            This authentication parameter, used for access control, must be
            passed along with the request. To generate the authentication
            header, refer to Authentication.
        - 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: >
        The API request will be authenticated through Basic Authentication.
        Basic Authentication sends a Base64-encoded string containing your
        username and password with every API request.


        The username and password details can be obtained from the MoEngage
        Dashboard. If you're using the API for the first time, follow these
        steps:

        1. Navigate to **Settings -> Account -> APIs**.

        2. Copy the following details:
           * Username: Under **Workspace ID (earlier app id)**, click the copy icon to copy the username.
           * Password: In the **API keys** section, click the copy icon in the **Data** tile to copy the API key.
        3. Use these details to authenticate the API requests.

````