{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/comp-ai/json-schema/comp-ai-upload-document-dto-schema.json",
  "title": "UploadDocumentDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/comp-ai-knowledge-base-api-openapi.yml#/components/schemas/UploadDocumentDto",
  "type": "object",
  "properties": {
    "organizationId": {
      "type": "string",
      "description": "Organization ID that owns the document"
    },
    "fileName": {
      "type": "string",
      "description": "File name"
    },
    "fileType": {
      "type": "string",
      "description": "MIME type of the file"
    },
    "fileData": {
      "type": "string",
      "description": "Base64-encoded file contents. For the web UI / direct callers. AI/MCP clients should instead upload via /v1/uploads/presign (purpose=document) and pass `s3Key` — base64 through an LLM is impractically slow and times out. Provide exactly one of fileData or s3Key."
    },
    "s3Key": {
      "type": "string",
      "description": "Key of a file already uploaded via /v1/uploads/presign (purpose=document). The server fetches the bytes from storage — no base64 needed. Provide exactly one of fileData or s3Key."
    },
    "description": {
      "type": "string",
      "description": "Optional description"
    }
  },
  "required": [
    "organizationId",
    "fileName",
    "fileType"
  ]
}