GET
/
conversations
curl --request GET \
  --url https://dash.superagentes.ai/api/conversations \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "conversation-id-1",
    "title": "Conversa com Cliente",
    "status": "UNRESOLVED",
    "channel": "whatsapp",
    "createdAt": "2023-01-01T00:00:00.000Z",
    "updatedAt": "2023-01-01T00:00:00.000Z",
    "agent": {
      "id": "agent-id",
      "name": "Nome do Agente",
      "iconUrl": "https://exemplo.com/icon.png"
    },
    "messages": [
      {
        "id": "message-id-1",
        "text": "Olá, como posso ajudar?",
        "from": "agent",
        "createdAt": "2023-01-01T00:00:00.000Z"
      }
    ]
  },
  {
    "id": "conversation-id-2",
    "title": "Suporte Técnico",
    "status": "UNRESOLVED",
    "channel": "website",
    "createdAt": "2023-01-02T00:00:00.000Z",
    "updatedAt": "2023-01-02T00:30:00.000Z",
    "agent": {
      "id": "agent-id-2",
      "name": "Agente de Suporte",
      "iconUrl": "https://exemplo.com/support-icon.png"
    },
    "messages": [
      {
        "id": "message-id-3",
        "text": "Como posso ajudar com seu problema técnico?",
        "from": "agent",
        "createdAt": "2023-01-02T00:00:00.000Z"
      }
    ]
  }
]

Listar Conversas

Este endpoint permite listar e filtrar conversas no sistema. Você pode usar vários parâmetros de consulta para filtrar os resultados conforme necessário.

Casos de uso

  • Obter histórico de conversas para análise
  • Filtrar conversas por status para gerenciamento de atendimento
  • Buscar conversas relacionadas a um agente específico
  • Encontrar conversas não resolvidas ou que precisam de atenção

Exemplos de código

const fetchConversations = async () => {
  const response = await fetch('https://dash.superagentes.ai/api/conversations?agentId=agent-id-1&status=UNRESOLVED', {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${seu_token_jwt}`,
      'Content-Type': 'application/json'
    }
  });
  
  const data = await response.json();
  return data;
};

Exemplo de resposta

[
  {
    "id": "conversation-id-1",
    "title": "Conversa com Cliente",
    "status": "UNRESOLVED",
    "channel": "whatsapp",
    "createdAt": "2023-01-01T00:00:00.000Z",
    "updatedAt": "2023-01-01T00:00:00.000Z",
    "agent": {
      "id": "agent-id",
      "name": "Nome do Agente",
      "iconUrl": "https://exemplo.com/icon.png"
    },
    "messages": [
      {
        "id": "message-id-1",
        "text": "Olá, como posso ajudar?",
        "from": "agent",
        "createdAt": "2023-01-01T00:00:00.000Z"
      }
    ]
  },
  {
    "id": "conversation-id-2",
    "title": "Suporte Técnico",
    "status": "UNRESOLVED",
    "channel": "website",
    "createdAt": "2023-01-02T00:00:00.000Z",
    "updatedAt": "2023-01-02T00:30:00.000Z",
    "agent": {
      "id": "agent-id-2",
      "name": "Agente de Suporte",
      "iconUrl": "https://exemplo.com/support-icon.png"
    },
    "messages": [
      {
        "id": "message-id-3",
        "text": "Como posso ajudar com seu problema técnico?",
        "from": "agent",
        "createdAt": "2023-01-02T00:00:00.000Z"
      }
    ]
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

agentId
string

ID do agente para filtrar conversas

status
enum<string>

Status para filtrar conversas

Available options:
UNRESOLVED,
HUMAN_REQUESTED,
RESOLVED
channel
enum<string>

Canal para filtrar conversas

Available options:
dashboard,
whatsapp,
website,
email
page
integer
default:1

Número da página para paginação

limit
integer
default:10

Número de itens por página

Response

200
application/json
Lista de conversas

The response is of type object[].