File Management
Operations for uploading and managing project files
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
JWT token for user session authentication.
ID of the project to associate files with
123e4567-e89b-12d3-a456-426614174000Multiple files to upload (alternative to single file)
Single file to upload (alternative to files array)
All files uploaded successfully
Multi-Status - Some files uploaded successfully, some failed
Bad Request - No files uploaded or all uploads failed
Unauthorized - Authentication required
Project not found or access denied
Conflict - File already exists
File too large - Exceeds 50MB limit
Unsupported file type
Internal Server Error
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": []
}
}Retrieves a list of all files uploaded to a specific project
JWT token for user session authentication.
ID of the project to get files for
Project files retrieved successfully
Bad Request
Unauthorized
Project not found
Internal Server Error
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"
}
]Removes a file from a project and deletes it from storage
API key for external service authentication.
ID of the file to delete
File deleted successfully
Bad Request
Unauthorized
File not found
Internal Server Error
DELETE /api/deleteProjectFile?fileId=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Accept: */*
{
"message": "File deleted successfully"
}