Skip to main content
ClassFlowDevelopersPartner API v1
API statusDashboard

Guide

Build an email-first conditional lead flow

Reproduce a JUX-style waitlist: capture the email first, optionally ask child-care questions, and keep the answers connected to the studio lead.

Choose an architecture

Studio-configured widget

The operator creates and publishes the form in ClassFlow, then selects it as the post-capture follow-up in the Lead widget.

Custom API frontend

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.

POST /forms
{
  "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.

POST /leads
{
  "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.

POST /forms/{form_id}/submissions
{
  "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.