Pin version
layerz_pin_versionPin a version so it stays listed, diffable and restorable beyond the plan history window (a validated budget, a closing, the version sent to an investor). pinned: false unpins it and frees the slot. Identify the target with exactly one of { revision_id } (preferred — stable sha256 from layerz_history), { version_number }, or { id } (raw row UUID). Pins are capped per plan (max_pinned_versions in layerz_history, null = unlimited); pinning past the cap fails with a 403 naming the limit — unpin another version first. Pinning an already-pinned version is a no-op. Returns { ok, version_id, version_number, revision_id, pinned, pinned_count, max_pinned_versions }. Mutating — not available for read-only API keys. Requires write access; the target must be inside the plan history window or already pinned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pinned | No | true (default) pins the version, false unpins it and frees its slot. | |
| version | Yes | Version to pin or unpin. Exactly one of revision_id / version_number / id. | |
| model_id | No | Target model UUID. Required for user-scoped API keys; ignored (or validated against scope) for model-scoped keys. |