The spec store
The spec store is where Ligament keeps the definitions of your apps as versioned JSON documents called artefacts. You work with it whenever you save a page in the page builder or change a role, and you can work with it directly from the REST API, the CLI or MCP. Knowing how it works helps you script changes, review them, and read what the builders show you.
Artefact types
Section titled “Artefact types”| Type | What one artefact holds | Needed to apply |
|---|---|---|
page |
One page: its title, app, who sees it, navigation and its blocks | build:pages |
role |
A role: its name, the permission sets it holds and its parameters | build:access |
permissionSet |
A set of grants on entities and fields | build:access |
restriction |
A rule that takes access away, whatever else grants it | build:access |
groupMapping |
The roles a group of people holds | build:access |
hierarchy |
A reporting line or other tree that access rules can follow | build:access |
share |
Access to records shared with named people or groups | build:access |
The access types are covered in Access. Shares are stored and versioned like the others but don’t change who can see records yet.
Entities, fields and lifecycles aren’t artefacts: you edit them in Build › Data and they’re saved directly. Workspaces that used an earlier access format may also have acl artefacts. Those are read-only: you can read them and their history, and a change to one is refused with spec.type_replaced, naming the permission sets to change instead.
GET /api/spec/catalog lists the types with the permission each needs, plus the entities, fields, roles, components and blocks a document can refer to. GET /api/spec/schema/<type> returns the JSON Schema of a type.
Addresses
Section titled “Addresses”Every artefact has an address of the form <app>/<type>/<key>:
| Address | What it is |
|---|---|
crm/page/crm_home |
The Sales home page that the CRM app ships |
office_moves/permissionSet/office_moves.member |
The permission set the Office moves app gives its member role |
__tenant__/page/loans_desk |
A page the workspace built itself (__tenant__ = belongs to no app) |
When you send an address you can leave the app out (page/loans_desk): the artefact’s current owner is used.
Layers
Section titled “Layers”An installed app’s artefacts and your changes to them are stored separately, so an upgrade can bring in the app’s new version without losing your edits.
| Layer | Meaning |
|---|---|
base |
Shipped by an installed app. Read-only. |
custom |
Your edit of a shipped artefact. It is kept over upgrades; applying the shipped document again removes it. |
source |
An artefact the workspace owns, such as a page you built. |
What runs is the effective document: custom if there is one, otherwise base, otherwise source. Access artefacts an app ships in its manifest (role, permissionSet, restriction) work the same way, except that what runs is always read from the workspace’s access settings: the app’s version is kept as base, and the artefact counts as customised when the settings differ from it. See Access in the manifest. Reads return the effective document unless you ask for a layer (?layer=base). The page builder shows a customised page with a badge such as Customised · shipped by office_moves 1.0.0.
Read an artefact
Section titled “Read an artefact”curl -s -H "Authorization: Bearer $LIGAMENT_API_KEY" \ https://app.ligament.ai/api/spec/page/loans_desk{ "address": "__tenant__/page/loans_desk", "type": "page", "key": "loans_desk", "app": "__tenant__", "layer": "source", "doc": { "specVersion": 1, "key": "loans_desk", "title": "Loans desk", "blocks": [ … ] }, "hash": "e99e59f23c85ced0", "version": 2, "customised": false, "base": null, "conflicts": []}hash is a fingerprint of the document’s content: two identical documents have the same hash. version counts the changes applied to this artefact. GET /api/spec?type=page lists every artefact of a type with its layer, hash and whether it’s customised.
Validate, plan, apply
Section titled “Validate, plan, apply”Every change goes through the same three steps, whoever or whatever makes it:
- Validate checks a document against the schema and your workspace (do the entities and fields it names exist?). It needs no permissions and writes nothing.
- Plan compares the document with what’s live and says what applying it would do: the action (
create,update,delete,resetornoop), the layer it writes, a summary of each change, the permission it needs and whether you hold it, and whether a person must apply it. It writes nothing. - Apply re-checks everything and writes the change, all or nothing. Each artefact that changes gets a new version recording who applied it, with which key and from which changeset.
An item is { "address", "baseHash", "doc" }, or { "address", "baseHash", "delete": true } to delete a workspace artefact or remove your customisation of a shipped one. POST /api/spec/apply needs baseHash on every item: the hash you started from, or null for a new artefact.
curl -s -X POST -H "Authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ https://app.ligament.ai/api/spec/apply \ -d '{ "items": [ { "address": "page/loans_desk", "baseHash": "e99e59f23c85ced0", "doc": { … } } ] }'{ "ok": true, "noop": false, "versions": [ { "address": "__tenant__/page/loans_desk", "version": 3, "hash": "7c222738d26ce5f3", "action": "update" } ], "plan": { … }}Applying a document that matches what’s live is a noop: nothing is written and versions is empty.
In the builders, Plan and Apply are buttons in the header, and the JSON tab shows exactly the document GET returns.
Base hashes and merges
Section titled “Base hashes and merges”Sending the hash you started from is what keeps two editors from overwriting each other. If the artefact changed since that hash, Ligament compares three documents: the one you started from, yours, and the current one.
A clean merge. You and someone else changed different parts. In this example someone renamed the metric while you changed the heading. The apply is refused with 409 spec.merge_available, and nothing is written:
{ "ok": false, "code": "spec.merge_available", "error": "the artefact changed since you started; your change merges cleanly with it. Review the merged doc and apply it (baseHash = currentHash), or send onConflict: \"merge\"", "merged": [ { "address": "__tenant__/page/loans_desk", "baseHash": "4e72d8a148ff063b", "doc": { … } } ]}Review the merged document and apply it with the baseHash it comes with, or send the same request again with "onConflict": "merge" to apply the merge directly. The page builder shows this as Merged with newer changes, with the plan of the merged result, the merged document and an Apply merged button.
A conflict. You both changed the same value. Nothing is applied, whatever onConflict says, and the response lists each conflicting path with the three values and who wrote the current one:
{ "ok": false, "code": "spec.conflict", "error": "someone changed the same values since you started: nothing was applied", "conflicts": [ { "address": "__tenant__/page/loans_desk", "path": "blocks[id=metric].title", "pointer": "/blocks/1/title", "base": "Loans", "yours": "Kit out", "current": "Loans logged", "currentBy": "Ada Admin via API key Loans desk agent (…MT63)" } ]}Start again from the current version, make your change and apply it. The page builder does this for you: its Conflicting changes dialog shows the base, your value and the current value (with who wrote it) for each path. Choose Keep mine, Take current or Edit for each, then Use these values. Your choices become the draft, and you confirm a new plan before anything is written.
History
Section titled “History”Every applied change is a version. The page builder’s History tab lists them with a diff of each; from the API or CLI:
ligament spec history __tenant__/page/loans_deskVERSION ACTION LAYER HASH BY WHEN CHANGESETv7 update source 7b4300da2d088767 Ada Admin via API key Loans desk agent (…MT63) 2026-12-02T16:04:02.270Zv6 update source eac62db87de8a464 Ada Admin via API key Loans desk agent (…MT63) 2026-12-02T15:56:33.192Zv4 update source 7b4300da2d088767 Ada Admin 2026-12-02T15:56:10.852Z cmx6b3gff00n06x6sqhzg1crmv2 update source e99e59f23c85ced0 Ada Admin 2026-12-02T15:51:08.954Z cmx6awxp700ll6x6s05ufdigwv1 create source b19057412dfeaf27 Ada Admin 2026-12-02T15:47:17.169Z cmx6ashgy00jt6x6s4qfqnw12(Output trimmed.) Changes made with an API key name the key; changes applied from a changeset name it. GET /api/spec/<address>?version=4 returns the document as it was at version 4.

Work from the command line
Section titled “Work from the command line”The CLI keeps the hash bookkeeping for you. spec pull writes each artefact to a file and records the hash it started from in .ligament/spec.lock.json; plan and apply send that hash.
ligament spec pull __tenant__/page/loans_desk -d spec# ✓ __tenant__/page/loans_desk → spec/page.loans_desk.json v6 eac62db87de8a464
# edit spec/page.loans_desk.json, then:ligament spec plan spec/page.loans_desk.json# update __tenant__/page/loans_desk → source build:pages ✓# ~ blocks.intro heading config changed# ~ blocks.metric metric config changed# 1 item(s), 1 changing, 0 clean merge(s), 0 conflict(s)
ligament spec apply spec/page.loans_desk.json# ✓ update __tenant__/page/loans_desk v7 7b4300da2d088767Every command is in the CLI reference.
Who can apply
Section titled “Who can apply”Applying needs the permission of the artefact’s type (build:pages for pages, build:access for access artefacts) for every item. Owners and admins hold them all; owners can give them to other roles in Settings › Access › Roles. Anyone without the permission can still save the change as a changeset for someone who has it.
Changes made with an API key follow the same rules, capped at what the key’s creator may do, plus a workspace setting for which changes need a person: see Agents propose, people approve.