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

Concepts

The twin model, drawn.

Five pictures that hold the whole model. Each one names the endpoints that touch it, so you can go from the drawing to a request.

reading time about 6 min

1. A twin is layers of typed measures#

A twin belongs to a project. It has layers: the built-in ones (wellness, biomarkers) come from its template, and you add your own with a layer schema. A layer is a list of measures, each with a type, a unit and the bounds of what can be recorded. A measure is always named <layer>.<measure>.

A twin with three layersThe twin tour-01 contains the layers wellness and biomarkers, which come from its template, and the layer study, which comes from a layer schema. The wellness layer lists the measures steps, an integer in steps, sleep_hours, a number in hours, and mood_level, an integer rating from 1 to 5. The study layer lists water_ml, weight_kg and the derived measure ml_per_kg. TWIN · tour-01 · template daily_movement LAYER wellness · built in wellness.stepsinteger · steps · 0–100000 wellness.sleep_hoursnumber · h · 0–24 wellness.mood_levelinteger · 1–5 LAYER biomarkers · built inweight, heart_rate, … LAYER study · your schema, version 1 study.water_mlinteger · ml study.weight_kgnumber · kg study.ml_per_kgderived · water_ml / weight_kg
Endpoints: GET /v1/templates, POST /v1/schemas, POST /v1/twins, GET /v1/twins/{twin}/measures. Tutorials: first twin, measures and validation, derived measures.

The same twin in motion. The layers are independent: a value changes the layer it belongs to and no other, and the twin is what runs through all of them.

Three planes float one above another: the built-in layers wellness and biomarkers, and study, a layer from your own schema. A vertical line through the three is the twin. Synthetic values fall one at a time: an observation of steps lands on wellness, one of heart_rate on biomarkers, and a state write of study.water_ml on study. Only the plane that receives the value ripples, and only its figures change: count and latest for an observed kind, version and value for a state write. Before its first value a layer shows count 0 and latest null.

One twin, three layers. A value touches only the layer it belongs to. Observations of built-in kinds arrive through POST /v1/twins/{twin}/observations; a measure of your own schema is written with PUT /v1/twins/{twin}/state/{measure}. The values are synthetic and generated in this page.

Synthetic values · generated in this page

2. Observations become a series, and the layer recomputes#

An observation is one value of one measure at the time it refers to. Each line of a batch is validated on its own: a line that cannot be recorded is rejected with a reason and nothing of it is kept. The accepted ones join the measure's series, and the layer's descriptive values are recomputed before the answer. A day without an observation is a gap: null, never zero.

From a batch of observations to a recomputed layerA batch of three lines is validated line by line. Two lines are accepted and one is rejected with the reason value_out_of_accepted_bounds. The accepted lines join the series of wellness.steps, drawn as bars per day with one day empty. The layer is then recomputed: count 5, latest 8432, minimum 6890, maximum 10240, mean 8422.4. BATCH · POST /v1/twins/{twin}/observations steps 10240 stepsaccepted steps 8432 stepsaccepted steps -5 stepsvalue_out_of_accepted_bounds SERIES · wellness.steps null 121314151617 LAYER wellness · recomputed, descriptive count 5 · latest 8432min 6890 · max 10240 · mean 8422.4no score, no «normal», no «high»
Endpoints: POST and GET /v1/twins/{twin}/observations, GET /v1/twins/{twin}/layers/{layer}, GET /v1/twins/{twin}/series/{measure}. Tutorials: import a week, read a layer.

Experimental The series of a numeric measure can also be read as an illustrative scenario: the twin's own days in a window, and their middle half moved by a change you declare (GET /v1/twins/{twin}/scenarios/{measure}). It is not a prediction, it compares with nothing and it scores nothing; with fewer than 7 days with a value it answers null.

Experimental The same series can be read as statistical fits: regression curves fitted to the twin's own days, side by side and never ranked, with estimates from the one you choose (GET /v1/twins/{twin}/fits/{measure}). An extrapolation of the series, not a health prediction.

Experimental Across the twins of a project, the same daily values give a cohort summary: the mean of each twin and the distribution of those means, with a histogram (GET /v1/cohort/{measure}). The twins are never ranked and the distribution is not a reference range. The three experimental answers carry the fingerprints of what they read and of what they answered.

3. State has a version, and writers do not collide#

The current state is the present value of each measure. Every change raises its version by one. A writer says which version it read (if_version or If-Match); if another writer got there first, the write is refused with 409 version_conflict and nothing changes. Past changes stay in the measure's history.

Two writers and one versionWriter A and writer B both read wellness.mood_level at version 3. Writer A sends a PUT with If-Match 3 and succeeds: the measure is now version 4. Writer B sends a PUT with If-Match 3 afterwards and is refused with 409 version_conflict and current_version 4. Writer B reads again and writes with If-Match 4, which succeeds as version 5. WRITER AWRITER BSTATE 4 · v3 GET v3GET v3 PUT If-Match "3" 5 · v4 PUT If-Match "3" 409 version_conflict · current 4 PUT If-Match "4" 3 · v5 history: v3 → v4 → v5
Endpoints: GET and PATCH /v1/twins/{twin}/state, GET, PUT and DELETE /v1/twins/{twin}/state/{measure}, POST /v1/twins/{twin}/state/{measure}/incr, POST /v1/twins/{twin}/tx, GET /v1/twins/{twin}/history/{measure}. Tutorial: current state and safe updates.

4. Every change is an event#

Each change of a twin appends an event to the project, with a sequence number that only grows. Read them by cursor (after), or register a webhook: STARCO posts each event to your https address, signed, and retries with a backoff if you do not answer.

Events by cursor and by webhookA change of state appends event number 11, of type state.changed, to the project's event log, after events 9 and 10. Your code can read the log with GET /v1/events after 10. A webhook delivers the same event to your receiver over https with the header X-Starco-Signature, which carries a timestamp and an HMAC-SHA256 that the receiver verifies. PUT …/state EVENTS of the project 9 twin.created 10 series.appended 11 state.changed PULLGET /v1/events?after=10long poll up to 10 s PUSH · webhookPOST your https URLX-Starco-Signaturet=…, v1=HMAC-SHA256
Endpoints: GET /v1/events, POST /v1/webhooks, GET /v1/webhooks/{webhook}/deliveries. Tutorial: events and signed webhooks.

5. Every access is a row of a chain#

Separately from events, every request made with a key (reads and refusals too), every MCP request and every console action on the project appends a row to the project's audit chain. A row's hash covers its own fields and the hash of the row before it, so a change anywhere breaks everything after it. You can recompute the chain yourself, with no secret.

The audit chainThree rows of the chain. Row 4, twins.store, status 201, has the hash 5f0c. Row 5, observations.store, status 200, carries prev_hash 5f0c and its own hash a41e. Row 6, layers.show, status 200, carries prev_hash a41e and its own hash 9d27, which is the head of the chain. Each row_hash is the SHA-256 of the row's fields and the previous hash. #4 key · twins.store · 201prev 77b1…row_hash 5f0c… #5 key · observations.store · 200prev 5f0c…row_hash a41e… #6 key · layers.show · 200prev a41e…head 9d27… row_hash = SHA-256(fields of the row + prev_hash)
Endpoints: GET /v1/audit, GET /v1/audit/verify. Tutorial: verify the audit chain.

Next#