Skip to main content

File Uploads

Leavo allows you to upload images, audio, videos, and documents for use in messages and conversations.

Supported Formats

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

1

Send the file

Make a POST /backend/uploads with the file as multipart/form-data.
2

Receive the URL

The API returns file metadata including the public file_url.
3

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

StatusDescription
PENDINGUploaded, not yet linked to any entity
ASSOCIATEDLinked to a message or conversation
Uploads with PENDING status for more than 24 hours may be automatically removed by the cleanup process.

Endpoints

MethodEndpointDescription
POST/backend/uploadsUpload 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}/statusUpdate status
POST/backend/uploads/cleanupCleanup orphaned uploads