Happ Docs

Chat Management

Monitor and manage conversations across all channels

Overview

The Chats section is your command center for all customer conversations across every connected channel — Telegram, Instagram, WhatsApp, Facebook, Viber, and voice calls.

For the full API reference, see api.happ.tools/reference.

Chat Dashboard

Navigate to Chats in the sidebar.

Chat List

Each conversation shows:

  • Contact name — Customer's name or username
  • Channel badge — Color-coded messenger icon
  • Last message — Preview of the most recent message
  • Timestamp — When the last message was sent
  • AI status — Whether AI is actively managing the conversation

Channel Colors

ChannelColor
TelegramBlue (#0088CC)
InstagramPink (#E4405F)
WhatsAppGreen (#25D366)
FacebookBlue (#1877F2)
ViberPurple (#665CAC)

Conversation View

Click any chat to open:

  • Full message history — Every message between customer and assistant
  • Message roles — User, Assistant, or System labels
  • Timestamps — When each message was sent
  • Token usage — Per-message input/output tokens and model used

AI Control

Toggle AI for any conversation. See AI Control & Human Handoff for full details.

  • AI On — Assistant responds automatically
  • AI Off — Human operator handles the conversation

Sending Messages Manually

When AI is off (or alongside AI), send messages from the dashboard:

  1. Open a chat
  2. Type your message
  3. Send

The message is delivered to the customer's messenger and appears in the conversation history.

Via API

POST /api/chats/{chatId}/messages
X-Access-Token: happ_your_token_here
Content-Type: application/json

{
  "content": "Hello, let me help you with that!"
}

Creating a Chat

POST /api/chats
X-Access-Token: happ_your_token_here
Content-Type: application/json

{
  "assistantId": "your-assistant-uuid"
}

Listing Messages

GET /api/chats/{chatId}/messages?page=1&take=20
X-Access-Token: happ_your_token_here

Last Messages Preview

Get the latest message for multiple chats at once (useful for chat list UI):

GET /api/messages/last?chatIds=id1,id2,id3
X-Access-Token: happ_your_token_here

Chat Types

TypeDescription
PrivateOne-on-one customer conversation
GroupGroup chat (primarily Telegram)
ChannelBroadcast channel messages

Message Roles

RoleDescription
UserMessage from the customer
AssistantAI-generated response
SystemSystem-level messages
DeveloperDeveloper/admin messages

Message Sources

Messages are tagged by where they came from:

SourceDescription
TELEGRAM, INSTAGRAM, WHATSAPP, MESSENGER, ECHATIncoming from messengers
SAASSent from web dashboard
MOBILESent from mobile app
APISent via REST API
AIGenerated by the AI assistant

Real-Time Updates

All chat events are broadcast via WebSocket:

WebSocket URL: wss://api.happ.tools/ws

Events:

  • MESSAGE_CREATED — New message in any chat
  • CHAT_MODE_CHANGED — AI mode toggled on/off
  • CHAT_CREATED — New conversation started

Connect and join your company room to receive events for all chats.

Context Window

The AI sees only recent messages (~last 10 minutes). Older messages are archived but preserved in the database. See AI Control > Context Window for details.

Tips

  1. Check daily — Review conversations to improve your assistant's knowledge and prompt
  2. Use filters — Filter by channel or AI status for high-volume management
  3. Quick takeover — Toggle AI off to personally handle sensitive conversations
  4. Review token usage — Check per-message tokens to optimize model selection