{
  "format": "baxly-survey/1.0",
  "notes": "Example 1: a short customer satisfaction survey using only core question types, with a screen-out rule, show/hide logic, an AI follow-up and a quota.",
  "survey": {
    "name": "Customer satisfaction, fall 2026",
    "intro": {
      "headline": "Tell us how we did",
      "body": "<p>This takes about <b>3 minutes</b>. Your answers are confidential and reported only in aggregate.</p>",
      "minutes": 3,
      "button_text": "Start"
    },
    "quotas": [
      { "name": "New customers", "limit": 200, "when": { "question": "tenure", "selected": "under_1" }, "on_full": "end" }
    ]
  },
  "pages": [
    {
      "key": "screener",
      "title": "About you",
      "questions": [
        {
          "key": "is_customer",
          "type": "yes_no",
          "text": "Have you purchased from us in the last 12 months?",
          "required": true
        },
        {
          "key": "tenure",
          "type": "select_one",
          "text": "How long have you been a customer?",
          "required": true,
          "choices": [
            { "key": "under_1", "text": "Less than a year" },
            { "key": "one_to_three", "text": "1 to 3 years" },
            { "key": "over_3", "text": "More than 3 years" }
          ],
          "show_when": { "question": "is_customer", "selected": "yes" }
        }
      ],
      "end_when": { "question": "is_customer", "selected": "no" },
      "end_message": {
        "headline": "Thank you",
        "body": "<p>This survey is for recent customers, so we will stop here. We appreciate your time.</p>"
      }
    },
    {
      "key": "experience",
      "title": "Your experience",
      "questions": [
        {
          "key": "nps",
          "type": "nps",
          "text": "How likely are you to recommend us to a friend or colleague?",
          "required": true,
          "settings": { "min_label": "Not at all likely", "max_label": "Extremely likely" },
          "ai_followup": { "goal": "Find out the single biggest reason behind the score", "max": 2 }
        },
        {
          "key": "aspects",
          "type": "multi_select",
          "text": "Which of these stood out, good or bad?",
          "choices": [
            "Product quality",
            "Price",
            "Delivery speed",
            "Customer service",
            { "text": "Something else", "is_other": true, "placeholder": "Tell us what" },
            { "text": "Nothing stood out", "exclusive": true }
          ]
        },
        {
          "key": "service_rating",
          "type": "scale",
          "text": "How would you rate the customer service you received?",
          "settings": { "min": 1, "max": 5, "min_label": "Poor", "max_label": "Excellent" },
          "show_when": { "question": "aspects", "selected": "Customer service" }
        },
        {
          "key": "comments",
          "type": "open_text",
          "text": "Anything else you would like us to know?",
          "settings": { "multiline": true, "placeholder": "Optional" }
        }
      ]
    },
    {
      "key": "contact",
      "title": "Stay in touch",
      "questions": [
        {
          "key": "email",
          "type": "email_capture",
          "text": "If you would like a reply, leave your email address."
        }
      ]
    }
  ]
}
