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

# Preview template

> Preview template with variable substitution



## OpenAPI

````yaml POST /templates/{id}/preview
openapi: 3.0.3
info:
  title: NativeMessage API
  version: 1.0.0
  description: Complete API documentation for NativeMessage platform
  contact:
    name: NativeMessage Support
    email: support@nativemessage.com
servers:
  - url: https://api-message.nativehub.live/api/v1
    description: Production server
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /templates/{id}/preview:
    post:
      tags:
        - Templates
      summary: Preview template
      description: Preview template with variable substitution
      operationId: previewTemplate
      parameters:
        - name: id
          in: path
          required: true
          description: Template ID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - variables
              properties:
                variables:
                  type: object
              example:
                variables:
                  name: Alice
                  otp: '123456'
                  validity: '5'
      responses:
        '200':
          description: Template preview generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  preview:
                    type: string
                example:
                  preview: Dear Alice, your OTP is 123456. Valid for 5 minutes.
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````