Skip to main content
GET
https://suasofia.online/api/
/
user
/
conversations
curl -X GET "https://suasofia.online/api/user/conversations?type=widget&per_page=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "current_page": 1,
  "data": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "assistant_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "assistant_name": "Support Assistant",
      "type": "widget",
      "message_count": 12,
      "total_cost": 0.0045,
      "ai_enabled": true,
      "created_at": "2025-01-25 14:30:00",
      "updated_at": "2025-01-25 14:45:22"
    },
    {
      "id": "8d0f7780-8536-51ef-055c-f18fd2g01bf8",
      "assistant_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "assistant_name": "Support Assistant",
      "type": "whatsapp",
      "message_count": 8,
      "total_cost": 0.0032,
      "ai_enabled": true,
      "created_at": "2025-01-25 10:15:00",
      "updated_at": "2025-01-25 10:28:45"
    }
  ],
  "first_page_url": "https://suasofia.online/api/user/conversations?page=1",
  "from": 1,
  "last_page": 5,
  "last_page_url": "https://suasofia.online/api/user/conversations?page=5",
  "links": [
    {
      "url": null,
      "label": "« Previous",
      "active": false
    },
    {
      "url": "https://suasofia.online/api/user/conversations?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": "https://suasofia.online/api/user/conversations?page=2",
      "label": "2",
      "active": false
    }
  ],
  "next_page_url": "https://suasofia.online/api/user/conversations?page=2",
  "path": "https://suasofia.online/api/user/conversations",
  "per_page": 15,
  "prev_page_url": null,
  "to": 15,
  "total": 68
}
Este endpoint retorna uma lista paginada de conversas pertencentes aos assistentes do usuário autenticado. Use isto para exibir o histórico de conversas, filtrar por tipo ou integrar com seu CRM.
Este endpoint requer autenticação. Passe sua chave API no cabeçalho Authorization como um token Bearer.

Parâmetros de Consulta

type
string
Filtrar conversas por tipo. Valores possíveis: test, widget, whatsapp, api
assistant_id
integer
Filtrar conversas por ID do assistente (deve pertencer ao usuário autenticado)
date_from
string
Filtrar conversas a partir desta data (formato YYYY-MM-DD)
date_to
string
Filtrar conversas até esta data (formato YYYY-MM-DD)
per_page
integer
Número de conversas por página (1-100, padrão: 15)
page
integer
Número da página (padrão: 1)

Campos da Resposta

data
array
current_page
integer
O número da página atual
per_page
integer
Número de itens por página
total
integer
Número total de conversas que correspondem aos critérios
last_page
integer
O número da última página
curl -X GET "https://suasofia.online/api/user/conversations?type=widget&per_page=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "current_page": 1,
  "data": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "assistant_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "assistant_name": "Support Assistant",
      "type": "widget",
      "message_count": 12,
      "total_cost": 0.0045,
      "ai_enabled": true,
      "created_at": "2025-01-25 14:30:00",
      "updated_at": "2025-01-25 14:45:22"
    },
    {
      "id": "8d0f7780-8536-51ef-055c-f18fd2g01bf8",
      "assistant_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "assistant_name": "Support Assistant",
      "type": "whatsapp",
      "message_count": 8,
      "total_cost": 0.0032,
      "ai_enabled": true,
      "created_at": "2025-01-25 10:15:00",
      "updated_at": "2025-01-25 10:28:45"
    }
  ],
  "first_page_url": "https://suasofia.online/api/user/conversations?page=1",
  "from": 1,
  "last_page": 5,
  "last_page_url": "https://suasofia.online/api/user/conversations?page=5",
  "links": [
    {
      "url": null,
      "label": "« Previous",
      "active": false
    },
    {
      "url": "https://suasofia.online/api/user/conversations?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": "https://suasofia.online/api/user/conversations?page=2",
      "label": "2",
      "active": false
    }
  ],
  "next_page_url": "https://suasofia.online/api/user/conversations?page=2",
  "path": "https://suasofia.online/api/user/conversations",
  "per_page": 15,
  "prev_page_url": null,
  "to": 15,
  "total": 68
}

Tipos de Conversa

TipoDescrição
testConversas de teste internas da interface de teste do assistente
widgetConversas do widget de chat da web
whatsappConversas do WhatsApp Business
apiConversas criadas via API

Casos de Uso

  • Dashboard de Análises: Exibir métricas e tendências de conversas
  • Integração com CRM: Sincronizar dados de conversas com sua base de clientes
  • Monitoramento de Qualidade: Revisar volumes de conversas por tipo e assistente
  • Revisão de Cobrança: Acompanhar custos de conversas em sua organização