Skip to content

Developers

Form definition reference

The JSON format for sections, subsections, questions, conditions and approval rules.

A form definition has two parts: the schema (what respondents see) and approval (how responses are scored).

{
  "schema": {
    "sections": [
      {
        "id": "about",
        "title": "About you",
        "required": true,
        "elements": [
          { "kind": "item", "id": "email", "type": "email", "label": "Email", "required": true },
          { "kind": "item", "id": "age", "type": "number", "label": "Age", "integer": true, "min": 16 },
          {
            "kind": "subsection", "id": "refs", "title": "References", "required": false,
            "repeat": { "min": 1, "max": 3, "add_label": "Add a reference" },
            "items": [
              { "kind": "item", "id": "ref_name", "type": "short_text", "label": "Name", "required": true }
            ]
          }
        ]
      }
    ]
  },
  "approval": {
    "enabled": true,
    "threshold_type": "percent",
    "threshold": 60,
    "show_result": true,
    "show_score": false,
    "criteria": [
      { "id": "adult", "item_id": "age", "op": "gte", "value": 18, "points": 1, "required": true }
    ]
  }
}

Sections

FieldTypeNotes
idstringUnique in the form. ^[A-Za-z][A-Za-z0-9_]{0,63}$
title, descriptionstringOptional
requiredboolDefault true
repeatobject{ "min": 1, "max": 10, "add_label": "…" }
conditionobjectSee below
elementsarrayItems ("kind": "item") and subsections ("kind": "subsection")

Subsections

Same fields as sections, with items instead of elements.

Items (questions)

Common fields: id, type, label, description, placeholder, required, repeat, condition.

typeExtra fields
short_text, long_textmin_length, max_length, pattern, pattern_message
email, url, phone—
numbermin, max, step, integer
ratingmax (3–10)
scalemin (0–1), max (2–10), min_label, max_label
date, time, datetimemin_date, max_date
single_choice, dropdownoptions: [{ "value", "label" }], allow_other
multi_choiceoptions, allow_other, min_selections, max_selections
yes_no, consent—
fileaccept (extensions or groups), max_files (1–20), max_file_size_mb
hiddendefault_value
statementdisplay only

Fields that don’t apply to a type are removed when saved.

Conditions

{ "logic": "all", "rules": [{ "field": "authorized", "op": "equals", "value": false }] }
  • logic: all (AND) or any (OR).
  • op: equals, not_equals, contains, not_contains, gt, gte, lt, lte, between ([min, max]), in / not_in (list), is_empty, is_not_empty.
  • field must be an earlier question in the same or an enclosing repeat scope.

Approval

FieldNotes
enabledPro plan
criteria[]id, item_id, op, value, points (0–1000, default 1), required (must-have), match_mode (any/all for repeated answers), label
threshold_typepercent or points
thresholdMinimum to approve
show_result, show_scoreWhat respondents see after submitting
approved_message, rejected_messageCustom messages

Answer format

Answers are keyed by question id. Repeatable sections/subsections become arrays of objects, repeatable questions arrays of values. See Repeatable sections.

TypeValue
text, email, url, phone, date, time, datetime, single choice, dropdown, hiddenstring
number, rating, scalenumber
yes_no, consentboolean
multi_choicearray of strings
filearray of upload references (see Public forms)