Skip to main content

Endpoint

POST /backend/messages/media

Body Parameters

lead_id
string
required
Recipient lead ID
type
string
required
Media type: image, audio, document, video
url
string
required
Public media URL
caption
string
Caption (for images and videos)
filename
string
Filename (for documents)

Request Example

curl -X POST "https://api.leavo.ai/backend/messages/media" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "lead_id": "lead-uuid",
    "type": "image",
    "url": "https://example.com/image.jpg",
    "caption": "Check out our latest product!"
  }'

Response

{
  "success": true,
  "data": {
    "id": "message-uuid",
    "lead_id": "lead-uuid",
    "type": "image",
    "media_url": "https://example.com/image.jpg",
    "caption": "Check out our latest product!",
    "role": "assistant",
    "status": "pending",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Supported Formats

  • JPEG (.jpg, .jpeg)
  • PNG (.png)
  • WebP (.webp)
  • Maximum: 5MB
  • MP3 (.mp3)
  • OGG (.ogg)
  • AAC (.aac)
  • Maximum: 16MB
  • PDF (.pdf)
  • Word (.doc, .docx)
  • Excel (.xls, .xlsx)
  • Maximum: 100MB
  • MP4 (.mp4)
  • 3GP (.3gp)
  • Maximum: 16MB
URL must be publicly accessible. Private or authentication-required URLs will fail.