Guide
Build an email-first conditional lead flow
Choose an architecture
The operator creates and publishes the form in ClassFlow, then selects it as the post-capture follow-up in the Lead widget.
Your server creates the lead and form submission. Your frontend owns the visual transition while secrets remain server-side.
1. Define the conditional form
Create the form in Forms → New form or call POST /forms. Each field has a stable key. Conditional fields use display_when.
{
"title": "Child-care interest",
"status": "published",
"fields": [
{
"key": "child_care_help",
"label": "Would child care help you visit JUX?",
"type": "select",
"required": true,
"options_layout": "buttons",
"options": ["Yes", "Maybe", "No", "Not now"]
},
{
"key": "child_count",
"label": "Number of children",
"type": "select",
"options": ["1", "2", "3+"],
"display_when": {
"field_key": "child_care_help",
"op": "in",
"value": ["Yes", "Maybe"]
}
},
{
"key": "age_ranges",
"label": "Broad age ranges",
"type": "checkbox_group",
"options": ["Under 1", "1–2", "3–5", "6–9", "10+"],
"display_when": {
"field_key": "child_care_help",
"op": "in",
"value": ["Yes", "Maybe"]
}
}
]
}2. Capture the email
For a custom frontend, send the normalized contact and attribution to POST /leads. ClassFlow deduplicates by email inside the studio.
{
"email": "randy@example.com",
"first_name": "Randy",
"source": "jux_waitlist",
"utm_source": "instagram",
"utm_campaign": "opening_waitlist"
}3. Store the follow-up answers
Submit only visible answers to POST /forms/{form_id}/submissions. Include the same email so the submission can be understood alongside the lead record.
{
"submitter_name": "Randy Example",
"submitter_email": "randy@example.com",
"data": {
"child_care_help": "Yes",
"child_count": "2",
"age_ranges": ["1–2", "3–5"]
}
}4. React to the completed survey
Subscribe to form.submitted and fetch the current submission if an external CRM, spreadsheet, or notification workflow needs the answers.