Conversations
Acesse o histórico de conversas, mensagens e gerencie sessões de atendimento.
Listar Conversas
GET
/api/conversationsRetorna todas as conversas do usuário
Response
[
{
"id": "clxyz...",
"agentId": "clxyz...",
"title": "Atendimento #123",
"status": "active",
"startedAt": "2026-03-06T10:00:00Z",
"endedAt": null
}
]Obter Conversa
GET
/api/conversations/:idDetalhes de uma conversa específica
Listar Mensagens
GET
/api/conversations/messages/:conversationIdTodas as mensagens de uma conversa
Response
[
{
"id": "clxyz...",
"type": "agent",
"content": "Olá! Como posso ajudá-lo?",
"timestamp": "2026-03-06T10:00:01Z"
},
{
"id": "clxyz...",
"type": "user",
"content": "Preciso de ajuda com meu pedido",
"timestamp": "2026-03-06T10:00:15Z"
}
]Enviar Mensagem
POST
/api/conversations/message/send/:conversationIdEnvia mensagem em conversa ativa
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Required | "user", "agent" ou "system" |
content | string | Required | Conteúdo da mensagem |
Iniciar Conversa
POST
/api/conversations/startInicia uma nova sessão
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Required | ID do agente participante |
title | string | Optional | Título da conversa |
Request
curl -X POST https://api.vendoria.com.br/api/conversations/start \
-H "X-Api-Key: vk_sua_api_key" \
-H "Content-Type: application/json" \
-d '{ "agentId": "clxyz..." }'Encerrar Conversa
POST
/api/conversations/endEncerra conversa ativa
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationId | string | Required | ID da conversa |