This document makes the Builder and Interpreter schema contracts easy to find from the platform docs.
docs/openapi.jsondocuments HTTP endpoints and request/response fields.- Builder and Interpreter behavior also depends on config and timeline schemas that are not fully represented as JSON Schema artifacts.
- This page is the human-readable API reference for those runtime schemas.
- Builder plugin and modal schema definitions:
frontend/builder/src/schemas/JSPsychSchemas.js
- Builder shared schema utilities:
frontend/builder/src/schemas/UnifiedSchema.js
- Interpreter compile contract and task routing:
frontend/interpreter/src/timelineCompiler.js
- Backend schema/task scope mapping (used by Credits and validation paths):
backend/project/api_views_common.py
- HTTP contract source of truth:
docs/openapi.json
The Builder exports a config JSON object consumed by the platform and Interpreter.
Core top-level shape:
{
"ui_settings": { "theme": "dark" },
"experiment_type": "trial-based",
"task_type": "rdm",
"data_collection": {
"reaction-time": true,
"accuracy": true,
"correctness": false,
"eye-tracking": false
},
"timeline": []
}Core schema points:
task_typeselects task-scoped component authoring behavior.experiment_typecontrols trial-based vs continuous compilation paths.timeline[]contains single components and structural/generative items (for exampleblock, loop groups, randomization groups).- Parameter-level plugin schemas are defined in
JSPsychSchemasand shared helpers inUnifiedSchema.
Platform-valid task scopes (for Credits and task mapping) currently include:
rdmflankersartstroopsimonpvttask-switchinggabornbackmotsoc-dashboardcustom
These are sourced from TASK_SCOPE_DEFINITIONS in backend/project/api_views_common.py.
The Interpreter consumes Builder-exported config JSON and compiles timeline[] items by type.
Key runtime contract:
- Compiler entrypoint:
frontend/interpreter/src/timelineCompiler.js - Task plugin implementations:
frontend/interpreter/src/jspsych-*.js - Config loader/runtime bridge:
frontend/interpreter/src/configLoader.js,frontend/interpreter/src/djangoRuntimeBackend.js
Common timeline types compiled at runtime include:
- Generic:
html-keyboard-response,html-button-response,image-keyboard-response,survey-response,block - Task-specific:
rdm-trial,flanker-trial,sart-trial,stroop-trial,emotional-stroop-trial,simon-trial,pvt-trial,task-switching-trial,gabor-trial,mot-trial,nback-block,soc-dashboard - Continuous/specialized:
continuous-image-presentation, SOC subtask composition, DRT start/stop boundaries
These endpoints connect Builder/Interpreter schemas to the backend API:
POST /api/v1/configs/publish- Accepts Builder config JSON in the
configfield.
- Accepts Builder config JSON in the
POST /api/v1/runs/start- Returns
configandconfigs[]payloads consumed by Interpreter launch.
- Returns
POST /api/v1/results/submit- Accepts
result_payloadplus optional per-trialtrials[]data.
- Accepts
Field-level request validation for these endpoints is defined in backend/project/api_serializers.py.
When Builder/Interpreter schema behavior changes:
- Update relevant frontend schema/compile files.
- Update this page if task scopes, timeline types, or schema responsibilities changed.
- Regenerate API artifact if endpoint payloads changed:
./scripts/generate_openapi.sh
- Update
docs/API_PUBLIC.mdand/ordocs/API_RESEARCHER.mdwhen contract behavior changed.