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

# Get template preview (public)

> Get the preview HTML for a template. This is a public route that does not require authentication, designed for AI agents to view template previews.



## OpenAPI

````yaml /openapi.json get /preview/{template_id}
openapi: 3.0.3
info:
  title: Emailr API
  version: 1.0.0
servers:
  - url: https://api.emailr.dev
    description: Production
security: []
tags:
  - name: emails
    description: Email sending and management
  - name: contacts
    description: Contact management
  - name: templates
    description: Email template management
  - name: domains
    description: Domain verification and management
  - name: webhooks
    description: Webhook configuration
  - name: broadcasts
    description: Broadcast campaign management
  - name: segments
    description: Contact segmentation
paths:
  /preview/{template_id}:
    get:
      tags:
        - templates
      summary: Get template preview (public)
      description: >-
        Get the preview HTML for a template. This is a public route that does
        not require authentication, designed for AI agents to view template
        previews.
      operationId: getTemplatePreview
      parameters:
        - schema:
            type: string
            format: uuid
            description: The template ID to fetch the preview for
            example: 123e4567-e89b-12d3-a456-426614174000
          required: true
          name: template_id
          in: path
      responses:
        '200':
          description: Preview HTML content
          content:
            text/html:
              schema:
                type: string
                example: <html><body><h1>Welcome</h1></body></html>
        '404':
          description: Template not found or no preview exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Template not found
                  code:
                    type: string
                    example: template_not_found
                required:
                  - error
                  - code

````