📁 Files API (NEW)
The new Files API provides comprehensive file management capabilities with better organization and additional features.Upload Files
POST/api/v1/files/upload
- Upload files for processing with automatic document type detection
- Supports PDF, JPG, JPEG, PNG formats
- Maximum 50 files per request, 10MB per file
- Maintains backward compatibility with existing upload endpoint
List Files
GET/api/v1/files
- Retrieve paginated list of uploaded files
- Support filtering by type and status
- Exclude deleted files by default
page
: Page number (default: 1)page_size
: Items per page (default: 20, max: 100)type
: Filter by document type (invoice, bank_statement, etc.)status
: Filter by status (pending, processing, completed, failed, deleted)
Get File Information
GET/api/v1/files/{file_id}
- Retrieve detailed information about a specific file
- Includes metadata, processing status, and validation results
Download File
GET/api/v1/files/{file_id}/download
- Download the original file content
- Preserves original filename and content type
- Streams file efficiently without loading into memory
Delete File
DELETE/api/v1/files/{file_id}
- Permanently delete a file from the system
- File is completely removed from the system
- Cannot be undone - use with caution
Files API Features
- 🔐 Security: All endpoints validate user ownership - users can only access their own files
- 📄 Pagination: Efficient pagination with configurable page sizes
- 🔍 Filtering: Filter by document type, status, or other criteria
- 📱 Original Filenames: Preserves and extracts original filenames from storage
- 🗑️ Delete: Files are permanently deleted from the system
- ⬇️ Direct Download: Stream file content with proper headers and content disposition
- 🔄 Backward Compatible: Legacy upload endpoint remains functional