Trumflow Documentation
Everything you need to integrate Trumflow into your tools. REST API, webhooks, and SDK.
Quick Start
5 minAdd Trumflow to your site with 1 line of code. Works with any HTML site, Shopify, WordPress, Webflow, and Next.js.
1. Install the widget
<!-- Add before </body> — that's it --> <script src="https://www.trumflow.com/widget.js" data-chatbot-id="YOUR_CHATBOT_ID" ></script>
Replace YOUR_CHATBOT_ID with the ID found in Dashboard → Settings → Chatbot. The widget appears immediately.
2. Train your AI (optional)
Dashboard → Settings → Training → add URLs, PDFs, or text. Your chatbot will answer with your exact data.
Authentication
All API requests must include a Bearer token in the Authorization header.
# Use Supabase Auth to get your session token:
curl -X POST https://xxxxxxxx.supabase.co/auth/v1/token?grant_type=password \
-H "Content-Type: application/json" \
-H "apikey: YOUR_SUPABASE_ANON_KEY" \
-d '{"email": "you@company.com", "password": "yourpassword"}'
# Response includes access_token — use it as your Bearer tokenChat API
/api/chatSend a message to the chatbot and receive an AI response. Can continue an existing conversation.
POST /api/chat
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"chatbotId": "chatbot_abc123",
"message": "I need help with my order",
"visitorId": "visitor_xyz", // optional
"conversationId": "conv_123" // optional, for continuing a chat
}
# Response:
{
"message": "Of course! Please share your order number.",
"conversationId": "conv_456",
"leadScore": 72
}Leads API
/api/leadsRetrieve and manage leads qualified by your AI.
GET /api/leads
Authorization: Bearer YOUR_TOKEN
# Query params:
?status=hot&score_min=70&limit=50&offset=0
# Response:
{
"leads": [
{
"id": "lead_abc",
"name": "Marie Dupont",
"email": "marie@example.com",
"score": 87,
"stage": "qualified",
"channel": "whatsapp",
"created_at": "2026-05-28T10:00:00Z"
}
],
"total": 142
}Webhooks
Receive real-time events when something happens in Trumflow. Configure the URL in Dashboard → Settings → Integrations → Custom Webhooks.
Available events
// Your endpoint receives:
POST https://yoursite.com/webhook
Content-Type: application/json
X-Trumflow-Signature: sha256=abc...
{
"event": "new_lead",
"data": {
"id": "lead_abc",
"name": "Marie Dupont",
"email": "marie@example.com",
"score": 87,
"channel": "web"
},
"tenant_id": "tenant_xyz",
"timestamp": "2026-05-28T10:00:00Z"
}Integrations
See the full integrations page for WhatsApp (Twilio), Shopify, Calendly, HubSpot, and Zapier guides.
View all integrations →