File Management

Operations for uploading and managing project files

Upload multiple files to a project with enhanced support

post

Uploads one or more files to be associated with a project for research and content generation purposes.

Enhanced Features:

  • Support for 20+ file types including PDF, Word, TXT, Markdown, Python, JSON, XML, CSV, HTML, TEX, JavaScript, C, YAML, TOML, and more

  • Multi-file upload support (single or multiple files per request)

  • Advanced validation with detailed error reporting

  • Automatic duplicate detection and prevention

  • Comprehensive response formatting with upload summary

  • Secure file storage with unique naming and proper cleanup on errors

File Type Support: PDF, Word Documents, Text Files, Markdown, Python Scripts, JSON Data, XML Documents, CSV Files, HTML Files, TEX/LaTeX, JavaScript, C Source Code, YAML Configuration, TOML Configuration, Jupyter Notebooks, RSS/Atom Feeds, SVG Images, and more.

Upload Limits:

  • Maximum file size: 50MB per file

  • No limit on number of files per request

  • Automatic validation and error reporting for each file

Authorizations
AuthorizationstringRequired

JWT token for user session authentication.

Body
projectIdstring · uuidRequired

ID of the project to associate files with

Example: 123e4567-e89b-12d3-a456-426614174000
filesstring · binary[]Optional

Multiple files to upload (alternative to single file)

filestring · binaryOptional

Single file to upload (alternative to files array)

Responses
200

All files uploaded successfully

application/json
post
/uploadProjectFiles
POST /api/uploadProjectFiles HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 80

{
  "projectId": "123e4567-e89b-12d3-a456-426614174000",
  "file": "[binary file data]"
}
{
  "success": true,
  "files": [
    {
      "id": "file-uuid-1",
      "file_name": "document.pdf",
      "file_type": "application/pdf",
      "file_size": 1048576,
      "file_url": "https://storage.example.com/files/document.pdf",
      "storage_path": "project-123/unique-id-1.pdf",
      "uploaded_at": "2024-01-15T10:30:00Z"
    }
  ],
  "summary": {
    "total_files": 1,
    "successful_uploads": 1,
    "failed_uploads": 0,
    "errors": []
  }
}

Get files associated with a project

get

Retrieves a list of all files uploaded to a specific project

Authorizations
AuthorizationstringRequired

JWT token for user session authentication.

Query parameters
projectIdstring · uuidRequired

ID of the project to get files for

Responses
200

Project files retrieved successfully

application/json
get
/getProjectFiles
GET /api/getProjectFiles?projectId=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "file_name": "research_paper.pdf",
    "file_size": 1048576,
    "file_type": "application/pdf",
    "storage_path": "text",
    "created_at": "2025-12-06T13:53:01.871Z",
    "updated_at": "2025-12-06T13:53:01.871Z"
  }
]

Delete a project file

delete

Removes a file from a project and deletes it from storage

Authorizations
x-api-keystringRequired

API key for external service authentication.

Query parameters
fileIdstring · uuidRequired

ID of the file to delete

Responses
200

File deleted successfully

application/json
delete
/deleteProjectFile
DELETE /api/deleteProjectFile?fileId=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Accept: */*
{
  "message": "File deleted successfully"
}