Keitaro Flow Management
Process
- Read
keitaro/references/keitaro-api.mdfor stream endpoint details - Read
keitaro/references/flow-patterns.mdfor common patterns - Parse user intent and context
- Execute API calls
- Display result
Create Flow
When user describes a flow setup:
- Identify the pattern (see
references/flow-patterns.md):- White + Offer (cloaking)
- A/B test
- GEO split
- Device split
- Direct offer
- Determine required fields:
- Campaign ID (required)
- Type: regular, forced, or default
- Schema: redirect, landings, offers, or landings_offers
- Weight (for A/B testing)
- Filters (geo, device, OS, etc.)
- Landing page IDs
- Offer IDs
- Create via API
Quick Patterns
"Add white page to campaign 12":
Endpoint: POST /streams (NOT PUT — Keitaro uses POST for both create and update)
{
"campaign_id": 12,
"type": "default",
"name": "White Page",
"action_type": "show_landing_page",
"schema": "landings",
"landings": [{"id": <white_landing_id>}]
}
"Add offer flow for DE desktop":
Endpoint: POST /streams
{
"campaign_id": 12,
"type": "regular",
"name": "DE Desktop",
"action_type": "redirect",
"weight": 100,
"schema": "landings_offers",
"filters": [
{"name": "geo", "mode": "accept", "payload": "DE"},
{"name": "device_type", "mode": "accept", "payload": "desktop"}
],
"landings": [{"id": 5}, {"id": 6}],
"offers": [{"id": 10}]
}
Update stream weight:
Endpoint: POST /streams/{id} (NOT PUT!)
{
"weight": 70
}
Update Weights
When user says "change weights" or "rebalance":
- List current flows with weights
- Show current distribution
- Apply new weights
- Confirm changes
Example: "set flow A to 70% and flow B to 30%"
Configure Filters
Supported filters (from API):
geo— country codesregion,city— locationdevice_type— desktop, mobile, tabletos— Windows, macOS, iOS, Androidbrowser— Chrome, Firefox, Safarilanguage— browser languageconnection_type— wifi, cellularip— IP rangesreferrer— referrer URL patternsub_id_1throughsub_id_15— sub-ID values
A/B Test Setup
When user says "A/B test landings in campaign 12":
- Get current campaign flows
- Create separate flows with equal weights
- Assign different landings to each flow
- Confirm setup with summary:
A/B Test Created:
├── Flow A: landing_v1.html (50% weight)
├── Flow B: landing_v2.html (50% weight)
└── Min. data needed: 100 clicks per variant
Cloaking Setup
When user says "setup cloaking for campaign 12":
- Create default flow with white page
- Create regular flow(s) with:
- GEO filter (target countries)
- Referrer filter (traffic source domain)
- Device filter if needed
- Assign offer landings to regular flows
- Show complete setup summary
Flow Health Check
Quick checks for a campaign's flows:
- Any flows with 0 clicks in 24h? → "Not receiving traffic"
- Any flows with weight 0? → "Effectively disabled"
- Default flow missing? → "No white page, risky for paid traffic"
- Filters contradicting each other? → "Conflicting filters"