Campaigns API¶
Campaigns are the core entity in Heka. A campaign defines a communication initiative with a funnel pipeline, agent instructions, and resources.
Campaign lifecycle¶
Campaign pipeline¶
Each campaign has a pipeline of phases. Contacts enter the pipeline and progress through phases based on conversation signals.
Phase transitions are gated — only allowed transitions succeed. The AI agent extracts signals from conversations and advances contacts through the pipeline.
Key endpoints¶
Create a draft¶
curl -X POST https://heka-operator.fly.dev/campaigns/drafts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Amate Q3 2026",
"template_name": "amate_bienvenida_v1",
"language": "es_MX"
}'
Get campaign board¶
Returns campaigns as funnel cards with contact counts per phase.
Move contact through funnel¶
curl -X POST https://heka-operator.fly.dev/campaigns/{campaign_id}/contacts/{wa_id}/phase \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"phase_id": "clase_muestra"}'