Skip to content

Chat Flows API

Chat Flows let you build automated conversation trees using a visual flow builder (ReactFlow-compatible). Flows define how your bots respond to user interactions — template messages trigger node transitions based on button clicks.

MethodEndpointDescription
GET/chat-flow/flows/List flows
POST/chat-flow/flows/Create flow
GET/chat-flow/flows/{id}/Get flow details
PUT/chat-flow/flows/{id}/Update flow
DELETE/chat-flow/flows/{id}/Delete flow
MethodEndpointDescription
GET/chat-flow/nodes/List nodes
POST/chat-flow/nodes/Create node
PUT/chat-flow/nodes/{id}/Update node
DELETE/chat-flow/nodes/{id}/Delete node
MethodEndpointDescription
GET/chat-flow/edges/List edges
POST/chat-flow/edges/Create edge
DELETE/chat-flow/edges/{id}/Delete edge
MethodEndpointDescription
GET/chat-flow/analytics/Flow execution analytics
Terminal window
curl -X POST http://localhost:8000/chat-flow/flows/ \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Flow",
"is_active": true,
"start_template": "template-uuid",
"flow_data": {
"nodes": [...],
"edges": [...]
}
}'
TypeDescription
templateSend a WhatsApp template message
conditionBranch based on user response
actionExecute an action (assign, tag, etc.)

Edges define transitions between nodes. Typically triggered by button clicks on template messages:

{
"source_node": "node-1",
"target_node": "node-2",
"trigger": "button_click",
"trigger_value": "Track Order"
}

The flow_data JSON field stores the complete ReactFlow graph:

{
"nodes": [
{
"id": "node-1",
"type": "template",
"position": { "x": 100, "y": 100 },
"data": {
"template_id": "uuid",
"template_name": "welcome_message"
}
}
],
"edges": [
{
"id": "edge-1",
"source": "node-1",
"target": "node-2",
"label": "Button: Track Order"
}
]
}
  1. Contact triggers the flow’s start_template
  2. Template message is sent to the contact
  3. Contact clicks a button (quick reply)
  4. System matches the button text to an edge
  5. Next node executes (send template, evaluate condition, run action)
  6. Repeat until flow ends or times out