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

# Upload File

> Upload a file to an agent (file upload, text content, or web scraping)



## OpenAPI

````yaml POST /agent/file
openapi: 3.1.0
info:
  title: Outbox AI API
  description: API for managing AI agents (chatbots and voicebots) on the Outbox platform
  version: 1.0.0
servers:
  - url: https://api.getoutbox.ai
security: []
paths:
  /agent/file:
    post:
      summary: Upload File
      description: Upload a file to an agent (file upload, text content, or web scraping)
      requestBody:
        description: >-
          File upload options - text content, file upload, or URLs for web
          scraping
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileUpload'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadMultipart'
      responses:
        '201':
          description: File uploaded successfully
        '400':
          description: Bad Request - Invalid file or missing required fields
        '401':
          description: Unauthorized - Invalid or missing API key
        '403':
          description: Forbidden - Insufficient permissions (requires level 2)
      security:
        - CompanyApiKey: []
components:
  schemas:
    FileUpload:
      type: object
      required:
        - agent_id
      properties:
        agent_id:
          type: string
          description: ID of the agent
        text:
          type: string
          description: Text content (for text upload option)
        name:
          type: string
          description: Name of the file (required when using text option)
        urls:
          type: string
          description: Newline-separated URLs for web scraping (for web scraping option)
    FileUploadMultipart:
      type: object
      required:
        - agent_id
        - file
      properties:
        agent_id:
          type: string
          description: ID of the agent
        file:
          type: string
          format: binary
          description: File to upload
  securitySchemes:
    CompanyApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Company API Key

````