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

# Fetch a template and its schema

> Return a stored template's content and its inferred input schema.

A missing stored template is a ``404`` (never a leaked storage ``500``); a
stored template with broken Jinja is author error — the schema inference parses
it — surfaced as a ``400``. Genuine storage failures raise other types (``500``).



## OpenAPI

````yaml /openapi.json post /api/template
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 0.1.1
servers: []
security: []
paths:
  /api/template:
    post:
      tags:
        - templates
      summary: Fetch a template and its schema
      description: >-
        Return a stored template's content and its inferred input schema.


        A missing stored template is a ``404`` (never a leaked storage ``500``);
        a

        stored template with broken Jinja is author error — the schema inference
        parses

        it — surfaced as a ``400``. Genuine storage failures raise other types
        (``500``).
      operationId: post_api_template
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateFetch'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                required:
                  - data
                type: object
          description: Success.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Malformed request.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TemplateFetch:
      description: Fetch a template's content and its input schema by id.
      properties:
        template_id:
          title: Template Id
          type: string
      required:
        - template_id
      title: TemplateFetch
      type: object
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````