Beta. STARCO Dev works with synthetic data only: do not send real personal or health data. Every feature shows its real status (Available Beta Beta · in development Coming).

Documentation menu

Tutorial 11

STARCO Studio from the API.

Goal: do by code what STARCO Studio does with clicks: pick a kit, create a study with its synthetic cohort, look at the cohort and one descriptive statistic, and export the study with its fingerprint.

time 15 minlevel intermediateyou need curl and jq, or Python 3 with requestsuses STARCO Studio Beta · project keys Beta
STARCO Studio is switched off by default.Studio is built and tested on top of this API, with the same developer account, projects and audit chain, and only with synthetic data. It is not open to the public: when it is switched on for your account you receive the address of its API, which this tutorial keeps in STARCO_STUDIO_API (the same variable the notebooks generated by Studio read). Until then, the Academy and the playground run the twin side.
  1. 1Sign in
  2. 2Kits
  3. 3Study
  4. 4Cohort
  5. 5Describe
  6. 6Export

STEP 1 Sign in with your developer account Beta#

Studio uses the console token of STARCO Dev (POST /v1/sessions, see the quickstart): the studies belong to your account, and each study is a project of yours.

export API="https://api.starco.dev/v1"
export STUDIO="$STARCO_STUDIO_API"
export STARCO_CONSOLE=$(curl -s -X POST "$API/sessions" -H "Content-Type: application/json" \
  -d "{\"email\": \"dev@example.test\", \"password\": \"$STARCO_PASSWORD\"}" | jq -r .token)

STEP 2 The kits Beta#

A kit is a study template: measures with their units and the bounds a value must fit to be recorded (never a reference range), states and phases, and alerts. Each kit comes with its schema already normalised, ready to send back as is or edited. The STARCO bio reference describes the three kits measure by measure.

curl -s "$STUDIO/kits" -H "Authorization: Bearer $STARCO_CONSOLE" | jq '.kits[] | {key, measures: [.schema.measures[].key]}'
Expected outputillustrative · synthetic
seguimiento-entre-visitas ['study.qol_score', 'study.energy', 'wellness.mood_level', 'wellness.sleep_hours', 'wellness.steps']
sueno-y-actividad ['wellness.sleep_hours', 'biomarkers.resting_heart_rate', 'biomarkers.hrv_rmssd', 'wellness.steps', 'wellness.exercise_minutes']
cohorte-laboratorio ['lab.marker_1', 'lab.marker_2', 'biomarkers.weight', 'biomarkers.waist_circumference', 'biomarkers.height']
{'formats': ['csv'], 'xlsx': False, 'max_kb': 2048, 'max_rows': 5000}

The kits' names and labels are in Spanish in the API; the Studio screens show them in Catalan and English too.

STEP 3 Create a study Beta#

Send the kit, a name and the measures (here, the kit's own). Studio creates, all or nothing, a project of yours with its synthetic cohort, schema version 1, the initial states and the kit's automations switched off.

MEASURES=$(curl -s "$STUDIO/kits" -H "Authorization: Bearer $STARCO_CONSOLE" | jq '.kits[] | select(.key == "sueno-y-actividad") | .schema.measures')
STUDY=$(curl -s -X POST "$STUDIO/studies" -H "Authorization: Bearer $STARCO_CONSOLE" -H "Content-Type: application/json" \
  -d "{\"kit\": \"sueno-y-actividad\", \"name\": \"Sleep 01\", \"measures\": $MEASURES, \"planned_participants\": 40, \"duration_months\": 6}")
STUDY_ID=$(echo "$STUDY" | jq -r .study.id); PROJECT=$(echo "$STUDY" | jq -r .study.project_id)
Expected outputillustrative · synthetic
d8362ec3-2469-4ff9-93ce-0d5a330994cb 8668960e-48fe-4518-9253-fb204fe51b15 1 synthetic

A wrong measure is refused with a stable code and the field, and nothing is created: for example 422 bounds_invalid with "field": "measures.0.min" when the minimum is not below the maximum.

STEP 4 The cohort at a glance Beta#

curl -s "$STUDIO/studies/$STUDY_ID/overview" -H "Authorization: Bearer $STARCO_CONSOLE" | jq '{participants, window, measures}'
Expected outputillustrative · synthetic
8 {'from': '2026-11-06', 'to': '2026-11-19', 'days': 14}
wellness.sleep_hours 85.7
biomarkers.resting_heart_rate 100
biomarkers.hrv_rmssd 100
wellness.steps 83
wellness.exercise_minutes 83.9

The share of participant-days with data: a day without data is counted as missing, never filled in. With nobody to count it is null.

STEP 5 Describe a measure Beta#

Exploratory, descriptive statistics: n and missing data always, the participant as the unit (the mean of each participant's days) and also by participant-day. No reference ranges and no interpretation. The STARCO bio reference writes out each method with a worked example.

curl -s "$STUDIO/studies/$STUDY_ID/analysis/describe?measure=wellness.sleep_hours" -H "Authorization: Bearer $STARCO_CONSOLE" | jq '{participants, note, by_participant}'
Expected outputillustrative · synthetic
Exploratory, descriptive statistics on synthetic sandbox data: not clinical conclusions about any person. n and missing data are always shown; null means no data.
{'n': 8, 'missing': 0, 'mean': 7.398492, 'sd': 0.451854, 'median': 7.566621, 'iqr': 0.556818}

A statistic that needs more data than there is (a standard deviation with one participant) is null. By phase, comparisons between groups, correlations and simulations have their own routes next to this one: analysis/phases, analysis/compare, analysis/correlation and scenarios.

STEP 6 Export the study with a project key Beta#

The export is read with a key of the study's project (scope read), as the R and Python notebooks do: one JSON document, its SHA-256 in X-Content-SHA256 and the same fingerprint in the project's audit chain.

KEY=$(curl -s -X POST "$API/projects/$PROJECT/keys" -H "Authorization: Bearer $STARCO_CONSOLE" -H "Content-Type: application/json" \
  -d '{"name": "notebook", "scopes": ["read"], "ttl_days": 7}' | jq -r .secret)
curl -s -D headers.txt -o study.json "$STUDIO/export" -H "Authorization: Bearer $KEY"
grep -i x-content-sha256 headers.txt; sha256sum study.json
Expected outputillustrative · synthetic
starco-studio-export/v1 True

What just happened

A kit became a study: a project of yours with a synthetic cohort and a versioned schema. You looked at it the way Studio's panel does and described one measure without labelling anyone. The export left with a fingerprint that the audit chain also holds. Everything you did is a row of the project's chain (studio.* actions next to the API's).

kit study · 8 synthetic overview · describe export · SHA-256

Next steps#