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

> Retrieve a single personalization template by its ID. The response returns the
template's full field schema — every field, its type, whether it's required, and
the valid options for dropdown fields — along with the template's preview HTML.

Use this before building template-type offering content: fetch the template to see
exactly which fields it needs and what values are valid, then supply those values in
[Create Offering](/api/public-offerings/create-offering). To find template IDs, use
[List Offer Templates](/api/public-offerings/list-offer-templates).


#### Rate Limit

The rate limit is 150 requests per minute, 500 requests per hour, and 1000 requests per day per consumer.


## OpenAPI

````yaml /api/offerings/offerings.yaml get /v5/offers/templates/{template_id}
openapi: 3.0.0
info:
  title: Offer Decisioning Public API - v5
  version: 5.0.0
  description: >
    The Offerings API lets you create, update, and list offerings for Offer
    Decisioning, and

    list the personalization templates available for offering content. For
    lifecycle, rate limits,

    idempotency, and error details, see the [Offerings
    Overview](/api/offerings/offerings-overview).
servers:
  - url: https://api-{dc}.moengage.com
    variables:
      dc:
        default: '01'
        description: >
          MoEngage data center identifier. Replace with your assigned DC number.
          Full example: https://api-01.moengage.com
security: []
paths:
  /v5/offers/templates/{template_id}:
    get:
      tags:
        - Public Offerings
      summary: Get Offer Template
      description: >
        Retrieve a single personalization template by its ID. The response
        returns the

        template's full field schema — every field, its type, whether it's
        required, and

        the valid options for dropdown fields — along with the template's
        preview HTML.


        Use this before building template-type offering content: fetch the
        template to see

        exactly which fields it needs and what values are valid, then supply
        those values in

        [Create Offering](/api/public-offerings/create-offering). To find
        template IDs, use

        [List Offer Templates](/api/public-offerings/list-offer-templates).
      operationId: getPublicOfferTemplate
      parameters:
        - $ref: '#/components/parameters/TemplateId'
      responses:
        '200':
          description: Template retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfferTemplateGetResponse'
              example:
                response_id: resp_<trace-id>
                type: template
                data:
                  id: app_small
                  value: app_small
                  label: App small
                  template_config:
                    title:
                      label: Title
                      outputKeyName: title
                      value: Life happens. Stay covered.
                      dataType: md
                      validations:
                        REQUIRED: true
                    lightMode:
                      label: Light Mode
                      outputKeyName: lightMode
                      value: https://image.moengage.com/.../light-mode.jpg
                      dataType: string
                      validations:
                        REQUIRED: true
                    aspectRatio:
                      label: Aspect Ratio
                      outputKeyName: aspectRatio
                      value: 4x3
                      dataType: dropdown
                      validations:
                        REQUIRED: true
                      options:
                        - id: 4x3
                          value: 4x3
                          label: 4x3
                        - id: 16x9
                          value: 16x9
                          label: 16x9
                  template_html: <!DOCTYPE html> ... ${config.lightMode.value} ... </html>
                  template_meta: {}
        '401':
          $ref: '#/components/responses/GatewayAuthError'
        '404':
          description: >
            Template not found (`TEMPLATE_NOT_FOUND`). The `template_id` does
            not exist or does

            not belong to the authenticated workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: TEMPLATE_NOT_FOUND
                  message: Template not found.
                  target: offering
                  details:
                    - code: TEMPLATE_NOT_FOUND
                      target: template_id
                      message: Template not found.
                  doc_url: >-
                    https://www.moengage.com/docs/api/offerings/offerings-overview
                response_id: resp_<trace-id>
        '429':
          description: >
            The rate limit for this endpoint has been exceeded. Retry after the
            window

            indicated in the `Retry-After` response header (in seconds).
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Internal server error. An unexpected condition prevented the request
            from being completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - basicAuth: []
components:
  parameters:
    TemplateId:
      name: template_id
      in: path
      required: true
      schema:
        type: string
      description: >
        The ID of the personalization template to retrieve (for example,
        `app_small`). This is the template's natural key, not a prefixed
        ObjectId. You can fetch template IDs using the [List Offer Templates
        API](/api/public-offerings/list-offer-templates).
  schemas:
    OfferTemplateGetResponse:
      description: Full detail for a single personalization template.
      type: object
      required:
        - response_id
        - type
        - data
      properties:
        response_id:
          type: string
          description: Trace identifier for the response.
          example: resp_<trace-id>
        type:
          type: string
          enum:
            - template
          description: Object type of the response. Always `template` for this endpoint.
        data:
          $ref: '#/components/schemas/OfferTemplateDetail'
    ErrorResponse:
      type: object
      required:
        - response_id
      properties:
        error:
          type: object
          required:
            - code
            - message
            - doc_url
          properties:
            code:
              type: string
              description: Machine-readable ALL_CAPS_SNAKE_CASE error code.
              example: VALIDATION_FAILED
            message:
              type: string
              description: >-
                Human-readable explanation. Specific enough for AI agents to act
                on.
            target:
              type: string
              description: >-
                The field or resource that caused the error (e.g.
                "scheduling.expiry_datetime").
            details:
              type: array
              description: >
                Per-field error entries for VALIDATION_FAILED responses. All
                field violations are collected and returned in a single response
                — never truncated.
              items:
                type: object
                properties:
                  code:
                    type: string
                    description: Field-level error code.
                  target:
                    type: string
                    description: Dot-notation path to the failing field.
                  message:
                    type: string
                    description: Human-readable description of the field-level violation.
            doc_url:
              type: string
              description: Link to documentation for this error code.
              example: https://www.moengage.com/docs/api/offerings/offerings-overview
        response_id:
          type: string
          description: >
            Trace identifier — same format as success responses ("resp_" +
            X-MOE-Request-Id). Always present even on error responses for log
            correlation.
    OfferTemplateDetail:
      description: >
        A personalization template's identity, its field-level configuration,
        and its preview HTML.
      type: object
      required:
        - id
        - value
        - label
        - template_config
        - template_html
        - template_meta
      properties:
        id:
          type: string
          description: >
            The template's ID (natural key). Use this value as `meta.templateId`
            in template-type offering content when calling Create Offering.
          example: app_small
        value:
          type: string
          description: Returned alongside `id`; identical to `id` in observed responses.
          example: app_small
        label:
          type: string
          description: Human-readable display name of the template.
          example: App small
        template_config:
          type: object
          description: >
            The template's fields, keyed by field name. Each entry describes one
            field — its label, type, current value, whether it's required, and
            (for dropdowns) the valid options. A template with no configured
            fields returns an empty object `{}`.
          additionalProperties:
            $ref: '#/components/schemas/TemplateConfigField'
        template_html:
          type: string
          description: >
            The template's HTML, used to render the preview on the dashboard.
            Field values are interpolated with `${config.<fieldName>.value}`.
            Empty string if the template has no HTML.
        template_meta:
          type: object
    TemplateConfigField:
      description: >
        A single field within a template's `template_config`. Describes the
        field's type, current value, requirement, and — for dropdowns — its
        valid options.
      type: object
      properties:
        label:
          type: string
          description: Human-readable label for the field.
          example: Aspect Ratio
        outputKeyName:
          type: string
          description: The field's key name.
          example: aspectRatio
        value:
          type: string
          description: The field's current value. Empty string if no value is set.
          example: 4x3
        dataType:
          type: string
          description: >
            The field's type. Values seen in responses: `string`, `md`, and
            `dropdown`. A `dropdown` field lists its allowed choices in
            `options`. Other values may appear.
          example: dropdown
        validations:
          type: object
          description: >
            Validation rules for the field. `REQUIRED: true` means you must
            provide this field when creating an offering.
          additionalProperties:
            type: boolean
          example:
            REQUIRED: true
        options:
          type: array
          description: >
            The selectable options for a `dropdown` field. When submitting a
            value in Create Offering, use the option's `value` — not its `label`
            or `id`.
          items:
            type: object
            properties:
              id:
                type: string
                description: Option identifier. Identical to `value` for these templates.
              value:
                type: string
                description: The value to submit when this option is selected.
              label:
                type: string
                description: >-
                  Display text for the option. Not for submission — may contain
                  spaces.
          example:
            - id: 4x3
              value: 4x3
              label: 4x3
            - id: 16x9
              value: 16x9
              label: 16x9
  responses:
    GatewayAuthError:
      description: >
        Authentication or authorisation failure from the API gateway layer.

        This response is generated by the gateway before the request reaches the
        service.

        The body is JSON-formatted but API gateway sends it with `Content-Type:
        text/plain`.

        Two gateway error codes are possible:

        - `ER001` — credentials missing or invalid (401).

        - `ER007` — credentials valid but insufficient scope for this route
        (403).
      content:
        text/plain:
          schema:
            type: string
            example: >-
              {"code":"ER001","target":"Authentication Invalid","message":"Auth
              validation failed."}
    ServiceUnavailable:
      description: >
        Gateway temporarily unable to route the request. Returned when the

        upstream service is unreachable or the HTTP request cannot be proxied
        (e.g. malformed

        headers with control characters). Treat as a transient error and retry
        with exponential back-off.
      content:
        text/html:
          schema:
            type: string
            example: >-
              <html><body><h1>503 Service Temporarily
              Unavailable</h1></body></html>
  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). Find it in the MoEngage dashboard at **Settings** > **Account** >
        **API keys**.

        - **Password**: Use an API key from **Settings** > **Account** > **API
        keys**.


        Refer to [API Key
        Dashboard](/user-guide/settings/account/api-and-api-keys/api-key-dashboard)
        for details on creating and managing API keys.

````