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

# Upload knowledge document

> Uploads one source file and creates a knowledge document record. Requires L0 authorization.



## OpenAPI

````yaml POST /api/v1/knowledge/documents/upload
openapi: 3.1.0
info:
  title: FamilyCo API
  description: Core and Knowledge endpoints from the FamilyCo Fastify server.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: http://127.0.0.1:4000
    description: Local development server
security:
  - bearerAuth: []
tags:
  - name: Core
    description: Infrastructure and runtime status endpoints.
  - name: Auth
    description: Token and API key related endpoints.
  - name: Knowledge
    description: Document upload, indexing, and retrieval endpoints.
paths:
  /api/v1/knowledge/documents/upload:
    post:
      tags:
        - Knowledge
      summary: Upload knowledge document
      description: >-
        Uploads one source file and creates a knowledge document record.
        Requires L0 authorization.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Document file to upload
                projectId:
                  type: string
                  description: Optional project scope
                source:
                  type: string
                  description: Optional source label
      responses:
        '201':
          description: Document uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeDocumentItem'
        '400':
          description: Missing or invalid file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    KnowledgeDocumentItem:
      type: object
      required:
        - id
        - name
        - fileType
        - source
        - projectId
        - version
        - status
        - checksum
        - filePath
        - markdownPath
        - converterCommand
        - converterMeta
        - errorMessage
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        name:
          type: string
        fileType:
          type: string
        source:
          type: string
        projectId:
          type:
            - string
            - 'null'
        version:
          type: integer
        status:
          $ref: '#/components/schemas/KnowledgeDocumentStatus'
        checksum:
          type: string
        filePath:
          type: string
        markdownPath:
          type:
            - string
            - 'null'
        converterCommand:
          type:
            - string
            - 'null'
        converterMeta:
          type:
            - object
            - 'null'
          additionalProperties: true
        errorMessage:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - statusCode
        - code
        - message
      properties:
        statusCode:
          type: integer
        code:
          type: string
        message:
          type: string
    KnowledgeDocumentStatus:
      type: string
      enum:
        - uploaded
        - indexing
        - indexed
        - failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````