Documentation Index
Fetch the complete documentation index at: https://docs.leavo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Upload File
POST /backend/uploads
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|
file | file | Yes | File to upload (max 10 MB) |
type | string | No | File type: media or audio (default: media) |
folder | string | No | Folder to organize the file in storage |
Example
curl -X POST "https://api.leavo.ai/backend/uploads" \
-H "Authorization: Bearer your_api_key_here" \
-F "file=@product_photo.jpg" \
-F "type=media"
Response (200)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"filename": "product_photo",
"file_type": "media",
"file_url": "https://api.leavo.ai/media/proxy/d6b10acc/550e8400.jpg",
"mime_type": "image/jpeg",
"size": 1048576,
"status": "PENDING",
"created_at": "2024-01-15T10:30:00Z"
}
After uploading, use the file to send a media message:
POST /backend/messages/send-media
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|
channel_id | UUID | Yes | Channel to send through |
remote_jid | string | Yes | Recipient (WhatsApp JID) |
message_type | string | Yes | image, audio, video, or document |
content | string | No | Media caption |
file | file | Yes | Media file |
Common Errors
| Code | Description |
|---|
400 | File not provided or invalid format |
413 | File exceeds 10 MB limit |