What You’ll Build
A FastAPI-powered webhook receiver that:Capture Events
status-update and conversation-update events per call in memoryLive Chat View
Multi-Call Support
Auto-Refresh

Example of the live events dashboard showing a conversation with status pills and chat bubbles.
Prerequisites
- Python 3.8+
- ngrok installed and authenticated
- An Interactly assistant with webhooks enabled
Architecture Overview
The system has two parts:Backend — FastAPI webhook receiver
status-update and conversation-update events, deduplicates messages, and exposes REST endpoints to query stored data.Frontend — HTML live dashboard
Step 1: Install Dependencies
Step 2: Create the Webhook Server
Createserver.py — this is the core of the live events system:
How the server works
In-memory event store
In-memory event store
event_store is a plain Python dict keyed by call ID. Each entry holds three lists — statuses, messages, and raw events. No database setup required; data resets when you restart the server.Message deduplication
Message deduplication
conversation-update event. The server tracks seen messageId values in a set and only appends genuinely new messages — so your dashboard never shows duplicates.Dual-purpose server
Dual-purpose server
POST /webhook), the REST API (GET /api/conversations), and the HTML dashboard (GET /). One process, one port — no CORS issues.Step 3: Create the Live Dashboard
Createdashboard.html in the same directory as server.py:
Dashboard features at a glance
Auto-discovery of new calls
Auto-discovery of new calls
/api/conversations every 1.5 seconds. When a new call ID appears, it’s added to the dropdown and auto-selected so you see messages immediately — no manual refresh needed.Chat-style message rendering
Chat-style message rendering
Status pill timeline
Status pill timeline
queued → ongoing → finished) are displayed as pills above the chat area, giving you a quick timeline of the call lifecycle.Pause / Resume / Reset
Pause / Resume / Reset
Step 4: Start Everything
You need two terminals — one for the server, one for ngrok.- Terminal 1 — Server
- Terminal 2 — ngrok
Step 5: Configure Your Assistant
Point your Interactly assistant’s webhook to the ngrok URL with/webhook appended.
- Dashboard UI
- API (cURL)
- API (Python)
Open assistant settings
Enable Server Configuration
Select events
status-updateconversation-update
Save
Step 6: Make a Test Call
Open the dashboard
http://localhost:8000 in your browser.Start a call
Watch live
queued → ongoing), then messages stream in as the conversation progresses.End the call
finished status pill. All messages remain visible for review.- Server Terminal
- Browser Dashboard
Project Structure
After completing all steps, your directory should look like:Troubleshooting
Dashboard shows 'Waiting for calls…' but events are arriving in the terminal
Dashboard shows 'Waiting for calls…' but events are arriving in the terminal
http://localhost:8000 (served by FastAPI), not by opening the HTML file directly.ngrok tunnel died / URL changed
ngrok tunnel died / URL changed
ngrok http 8000), copy the new Forwarding URL, and update your assistant’s webhook URL. The server itself doesn’t need restarting.Duplicate messages in the chat
Duplicate messages in the chat
messageId. If it does, restart the server (Ctrl+C then python server.py) to clear the in-memory store, or click Reset in the dashboard.Port 8000 already in use
Port 8000 already in use
lsof -i :8000 then kill <PID>), or start on a different port: