Download OpenAPI specification:
File upload API for Convilyn - AI-powered file conversion platform.
Provides endpoints for uploading files via two methods:
All endpoints support both authenticated and anonymous users:
Authorization: Bearer <access_token> header1. POST /upload/presign → Get presigned S3 URL
2. PUT {presigned_url} → Upload file directly to S3
3. POST /upload/confirm → Confirm upload and create file record
1. User authorizes OAuth with cloud provider (client-side)
2. POST /upload/cloud → Server downloads from cloud and uploads to S3
Following project-wide convention (same as auth/payment contracts):
Upload a file from Google Drive or Dropbox.
Flow:
Supported Providers:
google-drive - Google Drive (supports Workspace file export)dropbox - DropboxGoogle Workspace Files: Google Docs/Sheets/Slides are automatically exported to:
Authentication: Optional (supports anonymous users via session cookie)
| provider required | string (CloudProvider) Enum: "google-drive" "dropbox" Supported cloud storage providers |
| fileId required | string <= 500 characters File ID in the cloud provider |
| accessToken required | string OAuth access token for the cloud provider |
| fileName required | string <= 255 characters Original filename |
| mimeType required | string <= 100 characters MIME type of the file |
| fileSize required | integer >= 1 File size in bytes |
{- "provider": "google-drive",
- "fileId": "1A2b3C4d5E6f7G8h9I0j",
- "accessToken": "ya29.a0...",
- "fileName": "document.pdf",
- "mimeType": "application/pdf",
- "fileSize": 1024000
}{- "success": true,
- "fileId": "file_abc123xyz",
- "fileName": "document.pdf",
- "fileSize": 1024000,
- "jobId": "job_xyz789",
- "mimeType": "application/pdf",
- "isInput": true,
- "createdAt": "2026-01-15T10:30:00Z"
}Upload a file from cloud storage with real-time progress updates via SSE.
Response Type: Server-Sent Events (text/event-stream)
Event Types:
progress - Upload progress updatecomplete - Upload completed successfullyerror - Upload failedProgress Events:
event: progress
data: {"progress": 50, "status": "Downloading...", "bytesProcessed": 500000, "totalBytes": 1000000}
Complete Event:
event: complete
data: {"success": true, "fileId": "...", "fileName": "...", ...}
Error Event:
event: error
data: {"success": false, "error": "...", "code": "...", "status": 500}
Authentication: Optional (supports anonymous users via session cookie)
| provider required | string (CloudProvider) Enum: "google-drive" "dropbox" Supported cloud storage providers |
| fileId required | string <= 500 characters File ID in the cloud provider |
| accessToken required | string OAuth access token for the cloud provider |
| fileName required | string <= 255 characters Original filename |
| mimeType required | string <= 100 characters MIME type of the file |
| fileSize required | integer >= 1 File size in bytes |
{- "provider": "google-drive",
- "fileId": "1A2b3C4d5E6f7G8h9I0j",
- "accessToken": "ya29.a0...",
- "fileName": "document.pdf",
- "mimeType": "application/pdf",
- "fileSize": 1024000
}event: progress data: {"progress": 25, "status": "Downloading from cloud...", "bytesProcessed": 250000, "totalBytes": 1000000} event: progress data: {"progress": 75, "status": "Uploading to S3...", "bytesProcessed": 750000, "totalBytes": 1000000} event: complete data: {"success": true, "fileId": "file_abc123", "fileName": "document.pdf", "fileSize": 1000000, "jobId": "job_xyz789", "mimeType": "application/pdf", "isInput": true, "createdAt": "2026-01-15T10:30:00Z"}
Generate a presigned S3 URL for direct file upload.
Flow:
/upload/confirmAuthentication: Optional (supports anonymous users via session cookie)
| fileName required | string <= 255 characters Original filename |
| fileSize required | integer >= 1 File size in bytes |
| contentType required | string <= 100 characters MIME type of the file |
| jobId | string or null Job ID to associate with (optional).
|
| chatId | string or null Chat ID for goal lane uploads |
{- "fileName": "example.png",
- "fileSize": 1024000,
- "contentType": "image/png",
- "jobId": "job_abc123"
}{- "fileId": "file_xyz789",
- "s3Key": "input/job_abc123/file_xyz789/example.png",
- "expiresIn": 3600
}Confirm that a file has been uploaded to S3 and create the file record.
Prerequisites:
Verification:
Authentication: Optional (supports anonymous users via session cookie)
| fileId required | string File ID from presign response |
| fileName required | string Original filename |
| fileSize required | integer >= 1 File size in bytes |
| contentType required | string MIME type of the file |
| s3Key required | string S3 key from presign response |
| jobId | string or null Job ID (optional for standalone uploads) |
{- "fileId": "file_xyz789",
- "fileName": "example.png",
- "fileSize": 1024000,
- "contentType": "image/png",
- "s3Key": "input/job_abc123/file_xyz789/example.png",
- "jobId": "job_abc123"
}{- "fileId": "file_xyz789",
- "jobId": "job_abc123",
- "fileName": "example.png",
- "fileSize": 1024000,
- "mimeType": "image/png",
- "isInput": true,
- "createdAt": "2026-01-15T10:30:00Z"
}