Link, refresh or unlink external reference
layerz_external_refManages the links from this model to items of other Layerz models (an external ref, like an Excel linked workbook), by op. link: creates (or retargets, with uid) a non-list assumption whose values hold a snapshot of the source item's computed series projected to this model's grain (null outside the source's coverage); requires read access to the source model; the line is referenceable in formulas like any assumption; up to 200 links in links (one form per call) load each source once, are validated whole (one failure writes nothing) and return results. refresh: re-reads every linked source (or uids) and rewrites the snapshots, the only way the values move; a per-link failure (source or item gone) leaves the stored values intact; when values change, the pre-refresh state is snapshotted first (Auto-backup before refresh). unlink: detaches the line uid, keeping its values as an ordinary assumption. A self-link is rejected; a cross-model cycle resolves one hop per refresh. Link status and staleness: layerz_list_integrations { include_external_refs: true }. Persists one version labelled with summary. Not advertised to read-only keys.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | link | refresh | unlink. | |
| uid | No | `link`: existing non-list assumption to retarget. `unlink`: the linked line to detach. | |
| name | No | `link`: display name (default: the source item's name). | |
| uids | No | `refresh`: restricts the refresh to these linked items (default: all). | |
| links | No | `link`: up to 200 links written as one batch, in place of the flat fields. | |
| parent | No | `link` (create): parent container uid (section / formula / balance / dashboard). | |
| summary | Yes | Short note (3–100 chars) describing the change, stored as the label of the resulting version. Examples: "Renamed Revenue to Net Revenue", "Imported 2024 OPEX from Excel". | |
| model_id | No | Target model UUID. Required for user-scoped API keys; validated against the bound model for model-scoped keys. | |
| source_uid | No | `link`: uid of the source item in that model. | |
| timeline_ref | No | `link`: grain of the linked line (default: the source's grain when active here, else the finest active grain). | |
| source_model_id | No | `link`: the model read from. |