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

# Get Template Variable Schema

> Retrieve the variable schema for a template, including required and optional fields with their types.



## OpenAPI

````yaml api-reference/openapi.json get /templates/{id}/schema
openapi: 3.0.3
info:
  title: Senderr Email Template API
  description: >-
    API for accessing and managing email templates in your library. Supports
    both session-based authentication and API key authentication with rate
    limiting based on subscription plans.
  version: 1.0.0
  contact:
    name: Senderr Support
    url: https://senderr.dev/contact
    email: support@senderr.dev
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://senderr.dev/terms
servers:
  - url: https://senderr.dev/api/v1
    description: Production server
  - url: http://localhost:3000/api/v1
    description: Development server
security:
  - BearerAuth: []
  - SessionAuth: []
tags:
  - name: Library
    description: Operations related to user's template library
  - name: Templates
    description: Operations for template rendering and source code access
  - name: Email
    description: Operations for sending emails using templates
  - name: Usage
    description: Operations for checking API usage and limits
paths:
  /templates/{id}/schema:
    get:
      tags:
        - Templates
      summary: Get Template Variable Schema
      description: >-
        Retrieve the variable schema for a template, including required and
        optional fields with their types.
      operationId: getTemplateSchema
      parameters:
        - name: id
          in: path
          required: true
          description: Template ID
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Template schema retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  schema:
                    type: object
                    properties:
                      required:
                        type: array
                        items:
                          type: string
                        description: List of required variable names
                      optional:
                        type: array
                        items:
                          type: string
                        description: List of optional variable names
                      properties:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            type:
                              type: string
                              description: Variable type (string, number, boolean, etc.)
                            description:
                              type: string
                              description: Variable description
                            default:
                              description: Default value for the variable
                        description: Variable definitions with types and descriptions
              example:
                success: true
                schema:
                  required:
                    - name
                    - email
                  optional:
                    - company
                  properties:
                    name:
                      type: string
                      description: User's full name
                    email:
                      type: string
                      description: User's email address
                    company:
                      type: string
                      description: User's company name
                      default: there
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Authentication required
            success: false
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Template not found
            success: false
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
            code: INTERNAL_ERROR
            success: false
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
        success:
          type: boolean
          example: false
        details:
          type: object
          description: Additional error details
      required:
        - error
        - success
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use your API key from the dashboard. Format: `Bearer your-api-key-here`'
    SessionAuth:
      type: apiKey
      in: cookie
      name: supabase-auth-token
      description: Session-based authentication using browser cookies

````