Endpoint
GET /backend/messages/{lead_id}
Path Parameters
Query Parameters
Number of messages to return
Get messages before this timestamp (ISO 8601)
Get messages after this timestamp (ISO 8601)
Request Example
curl -X GET "https://api.leavo.ai/backend/messages/lead-uuid?limit=100" \
-H "Authorization: Bearer your_api_key_here"
Response
{
"success": true,
"data": [
{
"id": "message-uuid-1",
"content": "Hello, I would like information about the product",
"role": "user",
"type": "text",
"timestamp": "2024-01-15T10:30:00Z",
"status": "delivered"
},
{
"id": "message-uuid-2",
"content": "Hello! Of course, I'd be happy to help...",
"role": "assistant",
"type": "text",
"timestamp": "2024-01-15T10:30:05Z",
"status": "delivered"
},
{
"id": "message-uuid-3",
"content": null,
"role": "user",
"type": "image",
"media_url": "https://storage.leavo.ai/messages/image.jpg",
"timestamp": "2024-01-15T10:31:00Z",
"status": "delivered"
}
],
"pagination": {
"has_more": true,
"oldest_timestamp": "2024-01-15T10:30:00Z"
}
}
Message Status
| Status | Description |
|---|
pending | Waiting to be sent |
sent | Sent to provider |
delivered | Delivered to recipient |
read | Read by recipient |
failed | Sending failed |