File Uploads
Leavo allows you to upload images, audio, videos, and documents for use in messages and conversations.
Images
.jpg, .jpeg, .pngMax: 10 MB (auto-compressed above 2 MB)
Audio
.mp3, .wav, .ogg, .m4aMax: 10 MB
Video
.mp4, .webm, .aviMax: 10 MB
Documents
.pdf, .doc, .docx, .xls, .xlsx, .csv, .txtMax: 10 MB
Upload Flow
Send the file
Make a POST /backend/uploads with the file as multipart/form-data.
Receive the URL
The API returns file metadata including the public file_url.
Use in messages
Use the file_url to send media in messages or reference it in other contexts.
Automatic Image Compression
Images larger than 2 MB are automatically compressed:
- Max dimensions: 1920 x 1920 pixels (aspect ratio preserved)
- Quality: 85% (JPEG)
- Output format: JPEG
Upload Status
| Status | Description |
|---|
PENDING | Uploaded, not yet linked to any entity |
ASSOCIATED | Linked to a message or conversation |
Uploads with PENDING status for more than 24 hours may be automatically removed by the cleanup process.
Endpoints
| Method | Endpoint | Description |
|---|
POST | /backend/uploads | Upload file |
GET | /backend/uploads/{id} | Get upload by ID |
GET | /backend/uploads/tenant/{tenantId} | List tenant uploads |
DELETE | /backend/uploads/{id} | Delete upload |
PUT | /backend/uploads/{id}/status | Update status |
POST | /backend/uploads/cleanup | Cleanup orphaned uploads |