Pular para o conteúdo principal
GET
/
backend
/
messages
curl -X GET "https://api.leavo.ai/backend/messages?channel_id=uuid&[email protected]&limit=20" \
  -H "Authorization: Bearer sua_chave_aqui"
[
  {
    "id": "msg-uuid-1",
    "content": "Olá, gostaria de mais informações",
    "role": "user",
    "message_type": "text",
    "timestamp": "2024-01-15T10:30:00Z",
    "status": "read"
  },
  {
    "id": "msg-uuid-2",
    "content": "Olá! Claro, posso ajudar. Qual produto você tem interesse?",
    "role": "assistant",
    "message_type": "text",
    "timestamp": "2024-01-15T10:30:05Z",
    "status": "delivered"
  },
  {
    "id": "msg-uuid-3",
    "content": "",
    "role": "user",
    "message_type": "image",
    "url": "https://storage.leavo.ai/images/abc123.jpg",
    "timestamp": "2024-01-15T10:31:00Z",
    "status": "read"
  }
]

Query Parameters

channel_id
string
obrigatório
UUID do canal
remote_jid
string
obrigatório
JID do WhatsApp (ex: [email protected])
limit
integer
padrão:"50"
Limite de mensagens a retornar
offset
integer
padrão:"0"
Deslocamento para paginação

Response

array
Message[]
Lista de mensagens ordenadas por timestamp
curl -X GET "https://api.leavo.ai/backend/messages?channel_id=uuid&[email protected]&limit=20" \
  -H "Authorization: Bearer sua_chave_aqui"
[
  {
    "id": "msg-uuid-1",
    "content": "Olá, gostaria de mais informações",
    "role": "user",
    "message_type": "text",
    "timestamp": "2024-01-15T10:30:00Z",
    "status": "read"
  },
  {
    "id": "msg-uuid-2",
    "content": "Olá! Claro, posso ajudar. Qual produto você tem interesse?",
    "role": "assistant",
    "message_type": "text",
    "timestamp": "2024-01-15T10:30:05Z",
    "status": "delivered"
  },
  {
    "id": "msg-uuid-3",
    "content": "",
    "role": "user",
    "message_type": "image",
    "url": "https://storage.leavo.ai/images/abc123.jpg",
    "timestamp": "2024-01-15T10:31:00Z",
    "status": "read"
  }
]