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 01

Create your first twin.

Goal: look at the templates, choose layers, create a synthetic twin and find it again among the twins of your project.

time 10 minlevel beginneruses templates Beta · twins Beta
  1. 1Key
  2. 2Templates
  3. 3Create
  4. 4Fetch
  5. 5List

STEP 1 Keep your key in the environment#

Use a project key with the read and write scopes (see the quickstart). Never paste it into code you commit. The TypeScript and CLI tabs use the SDK and the command line, which are not published as packages yet.

export STARCO_KEY="starco_dk_…"
export API="https://api.starco.dev/v1"

STEP 2 Look at the templates Beta#

The catalogue has three parts: the templates, the layers and every observation kind with its unit and accepted bounds.

curl -s "$API/templates" -H "Authorization: Bearer $STARCO_KEY" | jq '.templates[] | {id, layers}'
Response (trimmed)illustrative · synthetic
{ "templates": [
    { "id": "daily_movement", "name": "…", "focus": "…", "layers": ["wellness", "biomarkers"],
      "wellness_kinds": ["exercise_minutes", "steps", "sitting_breaks", "strength_sessions", "sleep_hours", …] },
    { "id": "sleep_optimization", … }, … ],
  "layers": ["wellness", "biomarkers"],
  "kinds": [
    { "kind": "sleep_hours", "layer": "wellness", "unit": "h", "accepted_min": 0, "accepted_max": 24, "integer": false },
    { "kind": "steps", "layer": "wellness", "unit": "steps", "accepted_min": 0, "accepted_max": 100000, "integer": true },
    { "kind": "resting_heart_rate", "layer": "biomarkers", "unit": "bpm", "accepted_min": 20, "accepted_max": 200, "integer": false },
    … ] }

A template orders the wellness kinds by what it focuses on; every kind of a layer is accepted on any twin that has the layer. The bounds only check that a value is recordable: they are not reference ranges.

STEP 3 Create the twin Beta#

Choose a template and switch on only the layers you need. The label is optional and is for you: up to 64 letters, digits, spaces, _, . or -, and it must not look like a real identifier.

curl -X POST "$API/twins" -H "Authorization: Bearer $STARCO_KEY" -H "Content-Type: application/json" \
  -d '{"template": "daily_movement", "layers": ["wellness", "biomarkers"], "label": "tutorial-01"}'
Expected outputillustrative · synthetic
{ "twin": { "id": "3a9d5e2c-8b14-4f7a-a6d1-c2e09f4b7d31", "template": "daily_movement",
            "layers": ["wellness", "biomarkers"], "custom_layers": [],
            "label": "tutorial-01", "origin": "api",
            "data_class": "synthetic", "created_at": "2026-11-19T15:42:07Z", "updated_at": "2026-11-19T15:42:07Z" } }

Mistakes come back with a stable code: unknown_template (with the expected list), validation_failed for a layer that does not exist, identifier_not_accepted for a label that looks like a real identifier, such as a phone number.

STEP 4 Fetch it Beta#

export TWIN=3a9d5e2c-8b14-4f7a-a6d1-c2e09f4b7d31
curl "$API/twins/$TWIN" -H "Authorization: Bearer $STARCO_KEY"
Expected outputillustrative · synthetic
[ { "layer": "biomarkers", "observation_count": 0, "computed_at": "2026-11-19T15:42:07Z" },
  { "layer": "wellness",   "observation_count": 0, "computed_at": "2026-11-19T15:42:07Z" } ]

STEP 5 List the twins of the project Beta#

Your project already had 8 twins: the synthetic cohort it was created with, each with the 14 days that end yesterday. Yours is the ninth. Pages hold up to 200 twins; follow next_after when it is not null.

curl -s "$API/twins?limit=50" -H "Authorization: Bearer $STARCO_KEY" | jq '.data[] | [.origin, .template, .label]'
Expected outputillustrative · synthetic
synthetic_cohort sleep_optimization synthetic-01
synthetic_cohort daily_movement synthetic-02
…
api daily_movement tutorial-01
next_after: None

What just happened

The template gave the twin its starting shape and you switched on two layers. The twin exists but is empty: each layer has been computed once with no observations, and reading it now returns null values, not zeros. Every call you made is a row of the project's audit chain.

daily_movement wellness biomarkers 3a9d…7d31 · 0 observations

Next steps#