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

# Upload and index a file (PDF, DOCX, XLSX, PPTX)

> Upload a file, extract its text, chunk it, embed each chunk, and persist
to Qdrant (vectors) and PostgreSQL (metadata).

The raw file is also stored under ``/data/raw/filesystem/<doc_id><ext>``
for reference and potential re-indexing.



## OpenAPI

````yaml /api-reference/knowledge-api.json post /v1/knowledge/ingest/upload
openapi: 3.1.0
info:
  title: Strattum Knowledge API
  description: >-
    REST API that serves semantic document search — embeddings via the
    configured LLM provider, indexed in Qdrant, with metadata stored in
    PostgreSQL. (PRD-004, Workstream 1.4)
  version: 1.0.0
servers: []
security: []
paths:
  /v1/knowledge/ingest/upload:
    post:
      tags:
        - ingest
        - ingest
      summary: Upload and index a file (PDF, DOCX, XLSX, PPTX)
      description: |-
        Upload a file, extract its text, chunk it, embed each chunk, and persist
        to Qdrant (vectors) and PostgreSQL (metadata).

        The raw file is also stored under ``/data/raw/filesystem/<doc_id><ext>``
        for reference and potential re-indexing.
      operationId: upload_and_index_v1_knowledge_ingest_upload_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_and_index_v1_knowledge_ingest_upload_post
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_upload_and_index_v1_knowledge_ingest_upload_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: File to upload (.pdf, .docx, .xlsx, .pptx)
        tags:
          type: string
          title: Tags
          description: Comma-separated tags, e.g. 'rh,onboarding'
          default: ''
        owner:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner
          description: Owner / team responsible for this document
      type: object
      required:
        - file
      title: Body_upload_and_index_v1_knowledge_ingest_upload_post
    IngestResponse:
      properties:
        doc_id:
          type: string
          title: Doc Id
        title:
          type: string
          title: Title
        chunks:
          type: integer
          title: Chunks
        source:
          type: string
          title: Source
        stored_path:
          type: string
          title: Stored Path
      type: object
      required:
        - doc_id
        - title
        - chunks
        - source
        - stored_path
      title: IngestResponse
      description: Response for POST /v1/knowledge/ingest/upload.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````