Pin, unpin or restore version
layerz_manage_versionActs on one version of a model (version: exactly one of revision_id, version_number, id) by op. pin: keeps the version listed, diffable and restorable beyond the plan history window; capped per plan (max_pinned_versions, 403 past the cap); a no-op on a pinned version. unpin: frees the slot; a version past the window then stops being listed. restore: replaces the live items, schema and inputs with that snapshot, after saving the current state as a restore backup version (backup_version_id, null when the live state already matched the latest snapshot); requires summary, the label of the restored state. Returns { ok, version_id, version_number, revision_id, pinned, pinned_count, max_pinned_versions } for pin / unpin, { ok, restored_version_id, restored_version_number, restored_revision_id, backup_version_id } for restore. The target is inside the plan window or pinned. Not advertised to read-only keys.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | pin | unpin | restore. | |
| summary | No | Required with `restore`: label of the restored state in the history. | |
| version | Yes | Target version: exactly one of revision_id / version_number / id. | |
| model_id | No | Target model UUID. Required for user-scoped API keys; validated against the bound model for model-scoped keys. |