> ## 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.

# Load a stored resource by id, optionally rendering it

> Load a stored resource by its id, optionally rendering it as a template.

Args:
    resource_id: The id (path) of the resource to load.
    template_kwargs: When omitted, the resource's loaded content is returned
        as-is. When provided (any dict, incl. ``{}``), text is rendered as a
        Jinja template with these variables; media raises loudly (``400``).

Returns:
    The loaded (and optionally rendered) content — text or a ``MediaBlock``.

A missing resource is a ``404``; a traversal-escaping id, a render of media, or
broken client-supplied Jinja is a ``400``. Genuine storage/transport failures
raise other types and propagate as a ``500``.



## OpenAPI

````yaml /openapi.json post /api/resources/get
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/resources/get:
    post:
      tags:
        - resources
      summary: Load a stored resource by id, optionally rendering it
      description: >-
        Load a stored resource by its id, optionally rendering it as a template.


        Args:
            resource_id: The id (path) of the resource to load.
            template_kwargs: When omitted, the resource's loaded content is returned
                as-is. When provided (any dict, incl. ``{}``), text is rendered as a
                Jinja template with these variables; media raises loudly (``400``).

        Returns:
            The loaded (and optionally rendered) content — text or a ``MediaBlock``.

        A missing resource is a ``404``; a traversal-escaping id, a render of
        media, or

        broken client-supplied Jinja is a ``400``. Genuine storage/transport
        failures

        raise other types and propagate as a ``500``.
      operationId: post_api_resources_get
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceGet'
        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:
    ResourceGet:
      description: >-
        Load a stored resource by ``resource_id``, optionally rendering it.


        When ``template_kwargs`` is omitted the loaded content is returned as-is
        (a

        template/text resource as its text, a document as extracted text, media
        as a

        ``MediaBlock``). When provided (any object, including ``{}``) the caller
        intends

        a render: text is rendered as a Jinja template with these variables;
        media

        cannot be rendered and is refused with a ``400``.
      properties:
        resource_id:
          title: Resource Id
          type: string
        template_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Template Kwargs
      required:
        - resource_id
      title: ResourceGet
      type: object
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````