# Headless form builder: what it means and when you need one

"Headless" means the same thing here it means for CMSs: the content (your
form definition) and the interface that renders it are separate. You never
open an editor — you send structured data in, and a finished, hosted UI
comes out.

## What that buys you

- **An AI agent can build the form.** There's no editor UI for an agent to
  click around in — it just POSTs JSON. This is the whole reason "build me a
  form" works as a one-sentence request to Claude or ChatGPT with
  [quizgen.dev/llms.txt](/llms.txt).
- **The definition can live in your own repo.** A form is a JSON file you can
  diff, review in a pull request, and regenerate — not a state locked inside
  someone else's editor.
- **You can generate many similar forms programmatically.** Twenty slightly
  different intake forms for twenty clients is a loop over a template, not
  twenty editor sessions.
- **Validate before you send.** The JSON Schema (draft-07) behind every
  QuizGen quiz is published at
  [quizgen.dev/schema/v1.json](/schema/v1.json) — the exact schema the API
  validates against, so you can catch mistakes locally.

## When you don't want headless

If a human is going to sit down and carefully design one specific form —
picking layout, colors, a background image — a visual, drag-and-drop builder
is still the better tool. Headless trades that fine-grained visual control
for speed and programmability.

## What "headless" doesn't mean here

It doesn't mean bare-bones. A QuizGen form still gets a hosted URL,
mobile-friendly rendering, autosave, a progress bar, branching logic
(`show_if`), and scoring (`outcomes`) — all from the same JSON request.
Headless is about *how you build it*, not what the result looks like.

## Minimal example

```json
{ "schema_version": 1, "title": "Coffee or tea?",
  "sections": [ { "key": "main", "questions": [
    { "id": "pick", "type": "choice", "prompt": "Coffee or tea?",
      "options": [ { "value": "coffee", "label": "Coffee" },
                   { "value": "tea", "label": "Tea" } ] } ] } ] }
```

`POST` that to `/api/v1/quizzes` and it's live. That's the entire build
step.

---

Full API reference: [quizgen.dev/llms.txt](/llms.txt).
