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

# Upload a storage resource

> Store text OR base64-decoded bytes under ``resource_id`` (overwrite on reuse).

The type/shape validation the tool schema cannot express — a non-empty ``id``,
exactly one content field, and each field's type — is enforced here so the MCP
tool edge carries it too; the HTTP route's extractor passes the raw body through
to the same checks.



## OpenAPI

````yaml /openapi.json post /api/storage/resources
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/storage/resources:
    post:
      tags:
        - storage
      summary: Upload a storage resource
      description: >-
        Store text OR base64-decoded bytes under ``resource_id`` (overwrite on
        reuse).


        The type/shape validation the tool schema cannot express — a non-empty
        ``id``,

        exactly one content field, and each field's type — is enforced here so
        the MCP

        tool edge carries it too; the HTTP route's extractor passes the raw body
        through

        to the same checks.
      operationId: post_api_storage_resources
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StorageUpload'
        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.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    StorageUpload:
      description: >-
        A storage upload: exactly ONE of ``content_text`` (stored verbatim) or

        ``content_base64`` (decoded to bytes) supplies the content for ``id``.
        An

        existing id is overwritten — provider passthrough semantics.
      properties:
        content_base64:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Content Base64
        content_text:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Content Text
        id:
          title: Id
          type: string
      required:
        - id
      title: StorageUpload
      type: object
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````