Skip to main content

Endpoint

POST /backend/messages/send

Body Parameters

lead_id
string
required
Recipient lead ID
content
string
required
Message content
type
string
default:"text"
Message type: text

Request Example

curl -X POST "https://api.leavo.ai/backend/messages/send" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "lead_id": "lead-uuid",
    "content": "Hello! How can I help you today?",
    "type": "text"
  }'

Response

{
  "success": true,
  "data": {
    "id": "message-uuid",
    "lead_id": "lead-uuid",
    "content": "Hello! How can I help you today?",
    "type": "text",
    "role": "assistant",
    "status": "pending",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Possible Errors

CodeDescription
NOT_FOUNDLead not found
INVALID_PHONELead has no valid phone
CHANNEL_ERRORError connecting to messaging channel