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

# Add file

> Upload a file to memory. Files are automatically processed and made searchable.



## OpenAPI

````yaml api-reference/openapi.json post /memory/{id}/files
openapi: 3.1.0
info:
  title: Ziet API
  description: >-
    Ziet is a serverless platform for AI agents and applications. Build
    intelligent agents with @Agent and @Action decorators, or serverless APIs
    with @Endpoint and Database. Deploy with a single command—no infrastructure
    to manage.
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.ziet.ai/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Deployment
    description: Deploy code
  - name: Actions
    description: Discover actions
  - name: Agents
    description: Discover and configure agents
  - name: Endpoints
    description: Discover and invoke endpoints
  - name: Runs
    description: Execute agents
  - name: Memory
    description: Manage run memory
paths:
  /memory/{id}/files:
    post:
      tags:
        - Memory
      summary: Add file
      description: >-
        Upload a file to memory. Files are automatically processed and made
        searchable.
      operationId: addFile
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                path:
                  type: string
                  description: Optional path (e.g., 'documents/report.pdf')
      responses:
        '201':
          description: File added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    File:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
        path:
          type: string
        size:
          type: integer
        content_type:
          type: string
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: ''Api-Key sk_live_YOUR_KEY'''

````