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.
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>.
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.
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.
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.
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.
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.
GET /v1/audit, GET /v1/audit/verify. Tutorial: verify the audit chain.