Build your first twin in 5 minutes.
Nine steps, each a real request of the STARCO API that you run here. Watch the twin on the right change as you go: its layers, a series being drawn, the version of its state going up, the event it emits and the row each request adds to the audit chain.
STEP 1 · 20 seconds Create a project
Everything lives in a project: its twins, its keys and its own audit chain. This request is made with the console token you get when you sign in; here the simulation is already signed in as a synthetic developer.
Look at: the project appears on the right with its 8 synthetic twins. From the next step on, each request you make with the key adds a row to the audit chain.
STEP 2 · 20 seconds Create a key
Your code talks to the twins with a project key. A key has scopes (read, write) and an expiry, and its secret is shown once. $PROJECT is the id you just got.
Look at: the secret in the answer. The real API keeps only a keyed hash of it.
STEP 3 · 30 seconds Create a twin
A twin is created from a template and the layers you switch on. Each layer has typed measures with a unit and accepted bounds. From here on, requests use the key.
Look at: the twin and its layers on the right. Try adding "biomarkers" to the layers before you run it.
STEP 4 · 40 seconds Feed it observations
An observation is one value of one kind, in its unit, at the time it refers to. Send five days of steps in one batch. Each line is validated on its own.
Look at: the series being drawn, one point per observation. The day without an observation stays empty: missing is null, never zero.
STEP 5 · 30 seconds Read what it recomputed
The layer was recomputed before the last answer. Reading it gives descriptive values only: count, latest, minimum, maximum and means. No score, no «normal» or «high».
Look at: steps has numbers; every kind you sent nothing for has null.
STEP 6 · 30 seconds Set the twin's current state
Besides its series, a twin has a current state: the present value of each measure, with a version that only grows. Setting it emits an event your code can read or receive by webhook.
Look at: the version going from 0 to 1, the state.changed event, and the ETag header of the answer.
CHALLENGE 1 · 1 minute Cause a 409, then fix it with If-Match
Two writers must not overwrite each other. Send the version you believe the measure has in If-Match: if someone changed it meanwhile, STARCO refuses with 409 version_conflict and tells you the current version.
Your task: run the request as it is (it claims version 0, which is stale) and read the 409. Then put the current version in If-Match and run it again.
- A
409 version_conflictwas answered - The same write succeeded with the right
If-Match
CHALLENGE 2 · 40 seconds Get an observation refused
STARCO stores only what is recordable. A line outside the accepted bounds of its kind, or in another unit, is rejected with a stable reason code, and nothing of it is kept.
Your task: change the value or the unit below so that the line is rejected, and run it.
- A line came back in
rejectedwith its reason
STEP 9 · 30 seconds Verify the audit chain
Every request you made, including the refused ones and the reads, is a row of the project's audit chain. Each row carries the SHA-256 of the row before it, so a changed row breaks every hash after it. Ask STARCO to walk the chain; you can also recompute it yourself without any secret.
Look at: ok, the number of events and the head hash, the same one shown on the right.
You built a twin.
A project, a key, a twin with layers, a series, a state with a version, an event and an audit chain you verified, plus two refusals you caused on purpose. All of it simulated: the real API answers the same requests the same way.
With several twins there is more: the study on the home page follows a research group that describes its cohort, fits a curve to one twin's week, keeps the result in the twin and finds its fingerprint in the audit chain. The two calculations are experimental: cohort summaries and statistical fits, with their fingerprints.