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

# Add a file to an upload session

> Upload a new file to an existing upload session



## OpenAPI

````yaml /api-reference/openapi-v2.yaml post /api/v2/upload-session/{uuid}
openapi: 3.0.3
info:
  title: Paradigm API
  version: xenial-xerus (v2)
  description: >-
    A versatile and adaptable tool designed to integrate Generative AI into your
    applications
servers:
  - url: https://paradigm.lighton.ai
security: []
tags:
  - name: Models
    description: Operations about AI models
  - name: Files Search
    description: Operations about files search
  - name: Files
    description: Operations about files
  - name: Upload Sessions
    description: Operations about upload sessions
  - name: Workspaces
    description: Operations about workspaces
  - name: Users
    description: Operations about users
  - name: Companies
    description: Operations about companies
  - name: SCIM
    description: Operations about SCIM
  - name: Feedbacks
    description: Operations about feedbacks
  - name: Reporting
    description: Operations about reporting
  - name: Monitoring
    description: Operations about monitoring
  - name: Platform Status
    description: Operations about platform status
paths:
  /api/v2/upload-session/{uuid}:
    post:
      tags:
        - Upload Sessions
      summary: Add a file to an upload session
      description: Upload a new file to an existing upload session
      operationId: api_v2_upload_session_create_2
      parameters:
        - in: path
          name: uuid
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileCreateRequestSerializerV2'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadSessionFileAdditionResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    FileCreateRequestSerializerV2:
      type: object
      description: Request serializer for file upload.
      properties:
        title:
          type: string
          nullable: true
          maxLength: 255
        filename:
          type: string
          nullable: true
          maxLength: 512
        file:
          type: string
          format: uri
        collection:
          type: integer
          nullable: true
        owner:
          type: integer
          writeOnly: true
          description: Owner of the file (optional)
        company:
          type: integer
          writeOnly: true
          description: Company to associate the file with (optional)
        content:
          type: string
          nullable: true
        file_type:
          type: string
          nullable: true
          maxLength: 30
        collection_type:
          allOf:
            - $ref: '#/components/schemas/CollectionTypeEnum'
          writeOnly: true
          description: >-
            Type of collection to store the file in (private, company, or
            workspace)


            * `private` - private

            * `company` - company

            * `workspace` - workspace
        workspace_id:
          type: integer
          writeOnly: true
          description: Workspace ID when collection_type is 'workspace'
        chunk_size:
          type: integer
          description: Size of chunks for document processing (optional)
        chunk_overlap:
          type: number
          format: double
          description: Overlap between chunks (optional)
        external_metadata:
          allOf:
            - $ref: '#/components/schemas/ExternalMetadata'
          nullable: true
          description: Additional external metadata for the document (optional)
        OCR_AGENT:
          type: string
          description: OCR agent to use for processing (optional)
        OCR_COMPLETE_DOC_TABLE_EXTRACTION:
          type: boolean
          nullable: true
          description: Enable complete document table extraction (optional)
        OCR_HI_RES_MODEL_NAME:
          type: string
          description: High resolution OCR model name (optional)
        OCR_STRATEGY:
          type: string
          description: OCR processing strategy (optional)
        OCR_TIMEOUT:
          type: integer
          description: OCR processing timeout in seconds (optional)
        OCR_URL:
          type: string
          description: OCR service URL (optional)
        IS_VISUAL_INGESTION_ON:
          type: boolean
          nullable: true
          description: Enable visual ingestion processing (optional)
        DEFAULT_PIPELINE:
          type: string
          description: Default processing pipeline to use (optional)
      required:
        - file
    UploadSessionFileAdditionResponse:
      type: object
      description: Response serializer for upload session file addition.
      properties:
        message:
          type: string
        id:
          type: integer
          description: Unique identifier of the added file
      required:
        - id
        - message
    CollectionTypeEnum:
      enum:
        - private
        - company
        - workspace
      type: string
      description: |-
        * `private` - private
        * `company` - company
        * `workspace` - workspace
    ExternalMetadata:
      type: object
      properties:
        doc_id:
          type: string
          description: External document ID
        doc_type:
          type: string
          description: External document type
        name:
          type: string
          description: External document name
        version:
          type: string
          description: External document version
        mime_type:
          type: string
          description: External document MIME type
        created_at:
          type: string
          format: date-time
          description: Creation time of the external document
        modified_at:
          type: string
          format: date-time
          description: Last modification time of the external document
        last_synced_at:
          type: string
          format: date-time
          description: Last synced time of the external document
        external_url:
          type: string
          format: uri
          description: External document URL
        external_full_path:
          type: string
          description: Full path of the external document
      required:
        - doc_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````