Compute
GET /models/:id/compute computes the model and returns every line's series. ?items=uid1,uid2 limits the response to some lines.
{
"values": { "a1b2c3d4": [100, 120, 140] },
"periods": { "yearly": ["2027", "2028", "2029"], "constant": ["constant"] },
"item_timelines": { "a1b2c3d4": "yearly" },
"order": ["e5f6a7b8", "a1b2c3d4"],
"errors": {}
}
values[uid]aligns withperiods[item_timelines[uid]].- A line computed once (a constant, an
IRR, anNPV) has one value, on theconstanttimeline. - When the model cannot compute (a cycle, a broken reference), the response adds
computable: falseandcompute_errors(code,message,item_uids), and the affected series read zero. Fix the model before reading its numbers.
Values are the base plan. Scenario views, values at another grain and the check report are available over MCP (layerz_read with branch_id, granularity, health).
Snapshot
The snapshot is the whole model in its stored format: { manifest, schema, inputs }.
GET /models/:id/snapshotreturns it with anETag(a hash of its content).PUT /models/:id/snapshotreplaces the model with the document you send. Headers:
| Header | |
|---|---|
X-Version-Label | Required: the label of the version this write records |
If-Match | Optional: the ETag you read; the write fails with 409 if the model changed since |
The model is validated and repaired at write time like any other write. Use the snapshot to keep a model in a repository, diff it in code review, or move it between accounts.