# Ligament docs > The operations platform your AI agents can build on. Guides for workspace admins, developers and the people who use the apps. # What is Ligament? > The operations platform your AI agents can build on: what it does, who it is for, and how changes reach production. Source: https://docs.ligament.ai/get-started/ Ligament is an operations platform. Companies run their day-to-day processes on it: service desks, customer cases, HR records, requests and approvals, and the apps they build themselves. It is designed so that AI agents can build and change those apps alongside your team, and a person stays in charge of what goes live. ## What you get - **Apps for your processes.** Install apps such as IT Service Management, CRM, customer service, people, service catalogue and knowledge base from the App Store, or build your own in **Build** without code. - **Records with real lifecycles.** Every app is made of record types (entities) with fields, states and transitions, business rules, SLAs and related lists. Records keep their full activity history. - **Automation.** Workflows react to record changes, schedules and events: notify people, ask for approvals, call other systems, run AI steps. - **Self-service.** A portal where employees and customers search knowledge, raise requests and follow them up. - **Access control in one place.** Roles, permission sets and restrictions decide every read and write, whether it comes from the app, the API, an MCP client or an API key. Anyone can ask why they can see a record, and admins can see the app as someone else does. - **Effective dating** for data where dates matter, such as pay and job history: schedule changes, correct the past, and read any record as it was on a date. ## Built for agents In Ligament an app is defined as data, not code: a manifest of entities, fields, lifecycles and workflows, plus versioned documents in a spec store for its pages and access rules. Every editor changes those documents the same way (validate, plan, apply): the page builder does, and so do the REST API, the CLI and the MCP server. That gives agents a safe way in: 1. An agent connects over [MCP](https://docs.ligament.ai/developers/mcp/index.md) or the API with a key whose scopes say exactly what it may do. 2. It reads the spec, plans a change and sees what would happen, including who would gain or lose access. 3. It proposes the change as a [changeset](https://docs.ligament.ai/guides/building-apps/changesets/index.md). 4. A person reviews the changeset in **Build › Changes** and applies it. Your workspace decides which kinds of agent changes need that review ([Agents propose, people approve](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md)). Every apply records who made it and from which changeset, so you can always trace a change back. ## Getting access Ligament opens for sign-up at launch. Until then you can [register interest](https://ligament.ai/interest/?utm_source=docs&utm_medium=get-started) and we’ll email you when it opens. ## Where to start - New to Ligament? Read [Core concepts](https://docs.ligament.ai/get-started/concepts/index.md), then follow [Tutorial: your first app](https://docs.ligament.ai/get-started/first-app/index.md). - Setting up a workspace? Start with [How access works](https://docs.ligament.ai/guides/access/index.md) and [Single sign-on](https://docs.ligament.ai/guides/identity/sso/index.md). - Integrating or connecting an agent? Go to the [API overview](https://docs.ligament.ai/developers/index.md) and [Build with AI](https://docs.ligament.ai/build-with-ai/index.md). --- # Core concepts > Workspaces, apps, entities and records, lifecycles, the spec store, changesets and agents. Source: https://docs.ligament.ai/get-started/concepts/ These are the words the rest of the docs use. Each section is short; follow the links when you need the detail. ## Workspace A workspace is your organisation’s space in Ligament: its members and roles, its apps, its data and its settings. Everything you build or install lives in one workspace and is invisible to every other workspace. A large organisation can have [subsidiary workspaces](https://docs.ligament.ai/guides/workspaces/subsidiaries/index.md) under a parent. The examples in these docs use a workspace called Northwind Group. ## Apps An app is a named bundle of record types, pages and automation that belongs together, such as IT Service Management or CRM. There are two kinds: - **Installed apps** come from the App Store. Their author publishes numbered versions; you install one and later upgrade to a newer one. Your changes to what an installed app ships are kept across upgrades (see [Upgrades and your customisations](https://docs.ligament.ai/guides/building-apps/upgrades/index.md)). - **Your own apps** are the ones you create in **Build › Apps**, or write as a manifest and publish with the CLI (see [App manifests](https://docs.ligament.ai/developers/app-spec/index.md)). Each app has a key (`itsm`, `crm`, `equipment_loans`) that stays the same for its whole life. ## Entities and records An entity is a record type: Incident, Account, Equipment loan. A record is one row of it: incident INC0000042, or the loan of a Dell XPS 13 laptop to Tomás Ortega. Every record has a page at `/r//` and every entity has a list at `/r/`. Entities are defined in **Build › Data**, where you also see how they reference each other. ## Fields A field is one value on a record. When you add a field you pick its key (machine name, such as `due_back`), its label and its type: | Type | Holds | | --- | --- | | `string` | Text | | `number`, `currency` | Numbers and amounts | | `boolean` | Yes or no | | `date` | A date | | `url`, `email`, `image_url` | Links, email addresses, image links | | `file` | An attached file | | `enum` | One of a fixed list of values, each with a colour | | `reference` | Another record, for example a person or an account | A field can be required and can have a default value. ## Lifecycles A lifecycle is the set of states a record moves through and the transitions allowed between them. A loan might go Requested → On loan → Returned. One state is the initial state for new records, terminal states end the lifecycle, and each transition has an action label (“Hand over”), can require a role and can run a workflow. On a record page the transitions appear as buttons and the states as a stepper. ## The spec store The spec store holds an app’s definitions as versioned JSON documents called **artefacts**. Today it holds pages and the access artefacts (roles, permission sets, restrictions, group mappings, hierarchies and shares). Entities, fields and lifecycles are edited directly in **Build › Data** and saved as you go. Every artefact has: - an **address** of the form `//`, for example `crm/page/crm_home` or `__tenant__/page/loans_desk` (`__tenant__` means the workspace’s own artefacts that belong to no app); - a **layer**: `base` for what an installed app ships, `custom` for your edit of it, `source` for artefacts the workspace owns; - a **hash**, a short fingerprint of its content such as `7b4300da2d088767`. When you send a change you also send the hash you started from, so a change made since by someone else is merged, never silently overwritten. Every editor (the page builder, the JSON tab, the REST API, the CLI and MCP) changes artefacts the same way: validate, plan, apply. Each apply writes a new version with who made it. See [The spec store](https://docs.ligament.ai/guides/building-apps/index.md). ## Changesets A changeset is a named draft of one or more artefact changes that someone reviews and then applies together, all or nothing. Anyone with access to Build can propose a changeset; applying it needs the build permission for every item in it. Changesets live in **Build › Changes**. See [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md). ## Agents An agent is anything that changes your workspace with an API key: an AI assistant connected over MCP, a script, or the CLI in a pipeline. Agents use the same spec store and changesets as people. A workspace setting decides which of their changes go live by themselves and which wait for a person to apply them. See [Agents propose, people approve](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md). --- # Tutorial: your first app > Build a small equipment loans app, add a page, then propose a change as a changeset, review it and apply it. Source: https://docs.ligament.ai/get-started/first-app/ In this tutorial you build an **Equipment loans** app for an IT desk that lends laptops, headsets and cameras to staff. You create a record type with a few fields and a lifecycle, add a record, build an overview page with the page builder, and then take a change through a changeset: someone proposes it, you review it and apply it. It takes about 20 minutes. You need to be a workspace owner or admin. Step 8 also uses a second person with access to Build but without the `build:pages` permission. ## 1\. Create the app 1. Open **Build › Apps** and select **New app**. 2. Enter the app name `Equipment loans`. The key fills in as `equipment_loans`. Keys are permanent, so change it now if you want a different one. 3. Select **Create**. The app opens on its **Overview** tab: its key, visibility (Private), latest version (Unpublished) and an empty **Data model** section. ## 2\. Add a record type 1. Under **Data model**, select **New entity**. 2. Enter the label `Equipment loan`. The key fills in as `equipment_loan`. 3. Select **Add**. The entity appears in the data model with one field, **Name**, which every entity starts with. Select **Equipment loan** to open its schema in **Build › Data**. ## 3\. Add fields On the **Fields** tab, select **Add field** and fill in the panel for each of these fields, then select **Add field** at the bottom of the panel: | Key | Label | Type | Other settings | | --- | --- | --- | --- | | `asset_tag` | Asset tag | string | Required | | `borrower` | Borrower | reference | Reference entity `person`, display field `name` | | `due_back` | Due back | date | | | `condition` | Condition on return | enum | Values `Good`, `Damaged`, `Missing` | The list shows the five fields, and the **Relations** diagram above it shows the new link from Equipment loan to Person. \[Screenshot: The Fields tab of the Equipment loan entity, listing Name, Asset tag, Borrower, Due back and Condition on return, with a relations diagram linking Equipment loan to Person\] ## 4\. Add a lifecycle Open the **Lifecycle** tab. 1. Select **Add state** three times and fill in the rows: | Key | Label | Colour | Kind | | --- | --- | --- | --- | | `requested` | Requested | yellow | initial | | `on_loan` | On loan | blue | | | `returned` | Returned | green | terminal | 2. Select **Add transition** twice: **Requested → On loan** with the action label `Hand over`, and **On loan → Returned** with the label `Mark returned`. Leave **anyone** as the required role. 3. Select **Save lifecycle**. State keys can’t be changed once saved; labels and colours can. \[Screenshot: The Lifecycle tab with the states Requested, On loan and Returned and the transitions Hand over and Mark returned\] ## 5\. Lend a laptop 1. Select **View records**. The list opens at `/r/equipment_loan`, and **Equipment loans** now has its own section in the navigation. 2. Select **New equipment loan** and fill in the form: Name `Dell XPS 13 laptop`, Asset tag `NW-LT-0142`, Borrower `Tomás Ortega`, Due back a date two weeks out. 3. Select **Create equipment loan**. The record opens in the Requested state, with the lifecycle as a stepper and a **Hand over** button. Select **Hand over** when the laptop leaves the desk: the record moves to On loan. \[Screenshot: The record page of Dell XPS 13 laptop in the Requested state, with the Hand over button and the asset tag, borrower and due date\] ## 6\. Build an overview page Open **Build › Pages** and select **New page**. The page builder opens with a heading and a text block. 1. In the **Page** panel on the right, set the key to `loans_desk`, the title to `Loans desk` and the description to `Equipment out on loan and what is due back.` 2. Select the heading block on the canvas. On its **Content** tab, set the text to `Equipment on loan`. 3. Select the text block and replace its text with a line for the desk, for example `Laptops, headsets and other kit lent to staff.` 4. In the **Library** on the left, select **Metric**. On its **Content** tab set the title to `Loans`; on its **Data** tab set the entity to **Equipment loan (equipment\_loan)**. The measure is **Count of records**. 5. Select **List** in the library. Set its title to `All loans` and its entity to **Equipment loan**. The builder picks the first three columns for you (name, asset\_tag, borrower). 6. Switch the canvas from **Layout** to **Preview** to see the page with live data, as you would see it. Now select **Plan**. The plan shows what applying the page would do: ```text Create __tenant__/page/loans_desk ✓ build:pages This workspace + add heading + add metric + add list + add rich-text ``` Instead of applying it straight away, select **Save as changeset**. Nothing goes live yet: the builder now shows the badges **Draft · 1 change** and **Changeset Draft: Loans desk**. ## 7\. Review and apply the changeset 1. Open **Build › Changes** and select **Draft: Loans desk**. 2. Read the **Plan** tab. The **Impact** panel says whether you hold the permission the change needs (`build:pages`), whether it touches access rules or code, and which layer it writes. 3. Select **Mark ready**. The status changes to **Ready for review**. In a team, this is the point where the person who built the page hands it to the person who approves it. 4. Select **Apply**. The changeset is now **Applied** and read-only, and its **Activity** tab records who created it, who marked it ready and who applied it. Open **Build › Pages › Loans desk** and select **Open page**: \[Screenshot: The live Loans desk page: the heading Equipment on loan, a Loans metric showing 3, and a list of three loans with asset tags and borrowers\] ## 8\. Take a change from someone else Changesets matter most when the person who makes a change can’t apply it. In Northwind, Max has a “maker” role: he can use Build but doesn’t hold `build:pages`. 1. Max opens **Build › Pages › Loans desk**, selects **Edit**, selects the **All loans** list and, on its **Data** tab, adds the column `due_back`. 2. He selects **Plan**. The plan says *Applying needs build:pages, which you don’t hold. You can still save it as a changeset for someone who does (proposing is free).* He selects **Save as changeset**, then **Mark ready** in Build › Changes. 3. You open the changeset in **Build › Changes**. The plan shows `~ list config changed` on `__tenant__/page/loans_desk`, and the Impact panel shows that you hold `build:pages`. Select **Apply**. The page now shows the due-back date, and the page’s **History** tab lists both versions with who applied each one and from which changeset. ## Next steps - [Core concepts](https://docs.ligament.ai/get-started/concepts/index.md) explains apps, the spec store and changesets in one place. - [Page builder](https://docs.ligament.ai/guides/building-apps/page-builder/index.md) covers every block, filters, the JSON tab and custom components. - [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md) covers drafts, review and who may apply. - [Agents propose, people approve](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md) shows how an AI agent can make the same kind of change with an API key. - [App manifests](https://docs.ligament.ai/developers/app-spec/index.md) shows how to write an app like this one as code and publish versions of it. --- # Example data > Load a fictional company into your apps to see how they are set up, try the main flows as different people, and remove it again. Source: https://docs.ligament.ai/guides/demo/ Every app in the Store ships **example data** for one fictional company, **Tamarind Robotics**: about fifty people in Bangkok, Singapore, Berlin and remote, who build warehouse robots and a fleet-management service for logistics and retail customers. Load it to see how an app is configured with realistic records and three months of history behind its reports, then remove it again. Nothing in it is real: every person, customer, investor (“Sample Ventures”) and address is invented, and every email address is on an `example.com` domain. ## Load and remove example data Only the workspace **owner** can load or remove example data, because it writes into every app at once. - **Settings › Example data** lists each installed app that has example data, how many rows it adds, how many are loaded, and how many records people have made in the same tables. **Load** or **Remove** one app, or use **Load all** and **Remove all**. - When you install an app from the **Store**, tick **Load example data** in the install dialog. If the app’s tables already hold records people made, Ligament asks before loading: the example rows are added next to yours and nothing of yours changes. Loading twice adds nothing the second time. Everything a load creates is tagged, so **Remove** deletes only those rows, plus the rows the apps’ own automations made from them (an onboarding journey’s tasks, a policy’s assignments). If someone edited an example row after it was loaded, it’s kept and listed in the removal report, with a link to it; tick **Also remove rows people edited** to remove those too. Removing also cancels approvals still waiting on removed rows and takes down the example portals. ## What’s in it | App | Example data | | --- | --- | | People and HR | 7 departments, 50 employees with managers, offices and positions; pay and job history (a raise, a promotion keyed wrong then corrected, a transfer next month), a leave of absence, a leaver; leave balances and requests in every state, three waiting for a manager | | Service desk | 47 incidents over three months with SLA results, a major incident with three linked incidents, groups and assignment rules, announcements, time logged | | Problem and change | Three problems (one known error with a workaround) and seven changes, one **waiting for approval** | | CMDB | 16 configuration items with their dependencies; the telemetry API is degraded | | Service catalog and Knowledge | 13 request items with their forms, 16 requests, 11 help articles | | Customers, CRM and Customer Service | Four plans, ten customer accounts, contacts, a sales pipeline with won and lost deals, quotes, 26 support cases with SLA results and satisfaction scores, health history, a go-live plan half done, and a customer support portal | | Compliance | Five published policies, obligations part-way through the cycle, a public speak-up form, concerns, a risk register, controls and governance items with evidence | | Assets | Laptops, monitors, docks and phones assigned to people, stock with reorder levels, warranties ending this month, a repair, purchase requests | | Onboarding | A new hire starting next week with their journey part-way through, a leaver, a mover (Lucas), desks, bank details to verify | | E-signatures | Noah’s signed employment contract (on his employee record) and a remote working agreement waiting for Mei | | Feedback, FX, Templates | Satisfaction survey answers, three months of example exchange rates (not market data), reply and email templates | Each app also gets saved views, reports and dashboards with numbers in them (People overview, Service desk overview, Sales pipeline, Compliance overview, IT assets, Onboarding overview and others under **Dashboards**). ## Things to try You load example data as the owner, so the approvals and tasks in it wait for you. To see an app from another person’s side, invite a colleague and use [View as](https://docs.ligament.ai/guides/access/view-as/index.md). 1. **Work an incident.** Open **Incidents**, pick an open one, choose **Start work**, then **Resolve**: the SLA panel shows Response and Resolution as Met. 2. **Approve a change.** Open **Approvals** and approve “Upgrade the fleet database to PostgreSQL 16”. The change moves to Scheduled with who approved it and when. 3. **Follow a new hire.** Open **Onboarding** and the journey for the new hire starting next week: some tasks are done, the rest are waiting on HR, IT, facilities, the manager and payroll. 4. **Report a concern anonymously.** Open the speak-up form (**Compliance › Settings** shows its public link), report something without your name and keep the reference and passphrase. Then find it under **Concerns**. 5. **Run an evidence pack.** Open **Compliance › Evidence packs**, choose Sample Ventures, set the dates to cover the last three months, tick group by control, and download it: the completion certificates, the policy texts with their fingerprints, the evidence register, and a summary with risk and concern counts. 6. **Read the dashboards.** Open **Dashboards**: People overview, Service desk overview, Sales pipeline and the others have three months of numbers behind them. 7. **Check a signed document.** Open Noah Fischer’s employee record: his employment contract is signed and sealed, with its audit certificate. When you’re done, remove the example data from **Settings › Example data**. --- # How access works > Roles, permission sets and restrictions, and how one evaluator decides every read and write. Source: https://docs.ligament.ai/guides/access/ Access in Ligament decides who can see, create, change and delete which records, and which fields on them. Read this page first if you’re setting up access for a workspace, or if you need to work out why someone can or can’t see something. You manage it in **Settings › Access**. Workspace owners and admins can open it; everyone else sees their own access through the [Why panel](https://docs.ligament.ai/guides/access/why-can-i-see-this/index.md) on a record. ## The three building blocks | Block | What it is | Example in Northwind Group | | --- | --- | --- | | Role | What you give a person. Every member has one seat role (owner, admin, member, viewer or a custom role) and can hold more roles on top. | `team_lead` (Team lead) | | Permission set | A bundle of grants: an entity, the actions allowed on it, which rows, which field levels, plus workspace capabilities. A role holds one or more sets. | `people.my_team`: read and update the people who report to me | | Restriction | A rule that forbids something. It wins over every grant. | `people.no_phone_for_viewers`: viewers never see phone numbers | Roles are what you hand out, permission sets say what a role allows, and restrictions take things away again. Details and examples: [Roles, permission sets and restrictions](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md). ## Who holds a role A person holds: - their seat role, set in Settings › Members; - roles assigned to them directly, with or without an end date ([Time-bound access](https://docs.ligament.ai/guides/access/time-bound-access/index.md)); - roles mapped to a group they belong to ([Groups](https://docs.ligament.ai/guides/access/groups/index.md)); - roles from an approved elevation, a break-glass session or a delegation ([Time-bound access](https://docs.ligament.ai/guides/access/time-bound-access/index.md)). An assignment that has ended stops counting at once. Nothing has to run for it to expire. ## One decision for every request The same evaluator answers every request that reads or writes a record: in the app, through the REST API, through MCP tools, and with an API key. It decides in this order: 1. It collects the person’s roles: seat role, assignments, group mappings, elevations and delegations, leaving out any that have ended. 2. It looks for a grant. The permission sets of those roles must grant the action on the entity. No grant means no access, so an entity nobody has granted is closed. 3. It works out the rows. Each grant can carry a row condition, such as “assigned to my group” or “below me in the reporting line”. The person gets the rows of any of their grants, minus the rows a restriction forbids. 4. It works out the fields. Each field ends up hidden, masked, read or write: the highest level any of the person’s grants gives on that row, capped by restrictions. 5. For a change, every field it touches must be writable for that person. Grants add up, so a second role can only give more. Restrictions always win, so a restriction takes away even what another role grants. There are no priorities or rule orders to manage. Owners and admins skip grants and see every row. A restriction with **Enforce on owners and admins too** switched on still applies to them; see [Restrictions](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md#restrictions). An API key acts as the person who made it, capped at their current role, and it also needs a scope for the route (see [API keys](https://docs.ligament.ai/developers/api-keys/index.md)). A key made by an owner acts as an admin. Automations run with the system’s access, so roles and restrictions don’t limit what a workflow step reads or writes. ## Row conditions A row condition compares one field of the record with a value or a token. The tokens are resolved for the person asking, on every request. | Token | Means | | --- | --- | | `@me` | the person’s user id, for example `{{assigneeId}} eq @me` | | `@my.groups` | the person’s groups (and the records linked to them), for example `{{assignment_group}} in @my.groups` | | `@me.descendants`, `@me.descendants_or_self`, `@me.ancestors` | records below (or above) the person in a hierarchy such as the reporting line; see [Managers and their reports](https://docs.ligament.ai/guides/access/hierarchies/index.md) | | `@role.` | a parameter of the role that granted the rule, such as `@role.location` | | `@today`, `@now` | the date or time now, with an offset such as `@today-30d` | Operators are `eq`, `ne`, `contains`, `empty`, `not_empty`, `in`, `lt`, `lte`, `gt`, `gte` and `within`. Conditions combine with all (and), any (or) and not. You build them with the condition builder in the permission set editor, or write them as JSON. ## Field levels | Level | The person can | | --- | --- | | `write` | see and change the field | | `read` | see it, not change it | | `masked` | see the shape of the value (`h•••@northwind.example`, `•••••`), not the value. Holders of `pii.reveal` can reveal it with a reason. | | `hidden` | not see it. A hidden field is left out of lists, records, search, reports and API responses, and filtering on it matches nothing. | Fields a set doesn’t list follow its grant: read for a set that grants read, write for one that grants update or create. A field you [classify](https://docs.ligament.ai/guides/access/data-classification/index.md) as personal data or sensitive is masked instead, unless a set gives it a level. A grant can also set levels for just the rows it covers, so the same field can be in clear on your own record and masked on someone else’s. ## When the answer surprises you - On a record, open **More actions › Why can I see this?** to see which role and set gave access: [Why can I see this?](https://docs.ligament.ai/guides/access/why-can-i-see-this/index.md) - To see the app as someone else does, use [View as](https://docs.ligament.ai/guides/access/view-as/index.md). - Before you change a role or set, the plan shows who gains or loses what: [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md). - **Settings › Access › Entities** shows, per entity, which role may do which action. **Settings › Access › Audit** lists every access change and who made it. --- # Roles, permission sets and restrictions > Give people access with roles made of permission sets, and fence it off with restrictions. Source: https://docs.ligament.ai/guides/access/roles-and-permission-sets/ Use this page when you set up who can do what in a workspace: you’ll make a role, give it permission sets, and add restrictions where something must never happen. Everything here lives in **Settings › Access**, under the Roles, Permission sets and Restrictions tabs. You need to be a workspace owner or admin, or an [app admin](https://docs.ligament.ai/guides/access/app-admins/index.md) for one app’s roles, sets and restrictions. ## Roles A role is what you give a person. Every member has one **seat role**, chosen in Settings › Members, and can hold more roles on top of it (see [Who holds a role](https://docs.ligament.ai/guides/access/index.md#who-holds-a-role)). ### Built-in roles | Role | What it gets | | --- | --- | | Owner | Everything, including owner-only settings such as granting build permissions, adding `workspace.admin` to a set, and break-glass settings. Owner and admin skip grants and see every row; the Roles list shows them as **Bypasses rules**. | | Admin | Everything an owner can do on records, plus Settings, Build, AI, Logs and the App Store. Only an owner can make someone an owner. | | Member | The permission sets the installed apps ship for members, such as `itsm.member` and `people.member`. In Northwind Group the member role holds 14 sets, 13 of them shipped by apps. | | Viewer | The sets apps ship for viewers, such as `itsm.viewer`. Mostly read access. | You can’t rename or delete the built-in roles. You change what member and viewer allow by adding sets to them or by adding restrictions. ### Custom roles Click **New role** on the Roles tab. A custom role has: | Setting | What it does | | --- | --- | | Name, key, description | The key (for example `team_lead`) can’t change later. Reserved keys such as `system`, `enduser`, `public` and `everyone` are refused. | | Permission sets | The sets the role holds. You can add workspace sets and sets that apps ship (such as `itsm.member`) to build a role out of existing pieces. | | Parameters | Default values for `@role.` in the sets’ conditions. See [Role parameters](#role-parameters). | | Elevatable, Break-glass, Max hours | Whether members can request the role for a few hours, or activate it themselves in an emergency. See [Time-bound and elevated access](https://docs.ligament.ai/guides/access/time-bound-access/index.md). | | Overrides restrictions | Holders aren’t stopped by restrictions that are enforced on owners and admins. Owners only. | | Build permissions | Which kinds of change the holders may apply in Build (pages, forms, data model, flows, access, code). Owners only. | A custom role can be someone’s seat role, or be assigned on top of a seat. In Northwind Group, Max Maker’s seat role is the custom role `maker`; Vic Viewer’s seat is viewer and Vic also holds the custom role Team lead. \[Screenshot: Settings › Access › Roles › Team lead: the role holds the My team permission set, and Vic Viewer holds it through a direct assignment with no expiry\] A role page lists its sets, its parameters, its settings and **Who holds it**. Click **Assign role** to give it to a member or a group. ## Permission sets A permission set says what its holders may do. Click **New set** on the Permission sets tab, or open a set and click **Edit**. The editor has four parts: | Part | What you set | | --- | --- | | General | Label, key and description. | | Grants | One or more grants. A grant is an entity, the operations (read, create, update, delete, transition), the record actions it allows, optionally a row condition, and optionally field levels for the rows it covers. No condition means every row. | | Field levels | Per entity and field: hidden, masked, read or write, and whether holders may see the field’s past values (**Hide history**). Unlisted fields follow the grant: read for a set that only reads, write for one that updates or creates, masked for a [classified field](https://docs.ligament.ai/guides/access/data-classification/index.md). | | Capabilities | Abilities that aren’t about records, such as opening Build or revealing masked values. See [Who can open Build, AI, Admin, Logs and the App Store](#who-can-open-build-ai-admin-logs-and-the-app-store) and [Capabilities for one app, and your own](#capabilities-for-one-app-and-your-own). | \[Screenshot: The permission set editor for My team while it is being edited: Comment is ticked under Record actions, and on the rows of the grant Email is set to Masked\] The panel on the right says the set in words (“read, update, comment on Person: Record is below me in my reporting line; there email masked”) and shows whether it’s valid. Click **Plan** to see who would gain or lose access before you click **Apply** (see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)). The **JSON** tab shows the same set as a document: ```json { "key": "people.my_team", "label": "My team", "description": "Update the people who report to me, at any level.", "origin": "workspace", "grants": [ { "entity": "person", "ops": ["read", "update"], "where": { "all": [{ "left": "{{id}}", "op": "in", "right": "@me.descendants" }] } } ], "fields": { "person": { "user": "read", "manager": "read" } }, "capabilities": [] } ``` Here a team lead can update the people below them in the reporting line, but can’t change who they report to or which login account the person record belongs to. ### Field levels | Level | Holders | | --- | --- | | Write | see and change the field | | Read | see it, not change it | | Masked | see the shape of the value, not the value: `h•••@northwind.example` for an email, `••••1234` for a longer text, `•••••` for numbers, dates and references. They can’t change it, its past values aren’t shown, a filter on it matches nothing, and sorting, grouping and search leave it out. | | Hidden | not see it at all | **Hide history** keeps a field’s past values out of the record’s history, the audit trail and as-of reads for the set’s holders, while they still read today’s value. When someone holds several sets, history combines like field levels: the most permissive wins. A set that hides a field’s history hides it only where no other set they hold reads that field without hiding it. History is decided for each record: on a record where another of their grants reads the field (a manager’s grant on the people below them, say), its past values show; on other records they don’t. ### Field levels on a grant A grant can carry its own field levels. They apply only to the rows that grant covers, and win over the set’s field levels for those rows. When a person is covered by several grants on a row, they get the highest level any of them gives on that row. This is how one set says “my own salary in clear, my reports’ salaries masked”: ```json { "key": "hr.line_manager", "grants": [ { "entity": "person", "ops": ["read"], "where": { "left": "{{user}}", "op": "eq", "right": "@me" }, "fields": { "salary": "read" } }, { "entity": "person", "ops": ["read"], "where": { "left": "{{id}}", "op": "in", "right": "@me.descendants" }, "fields": { "salary": "masked" } } ] } ``` The [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md) builds a whole HR setup this way. ### Record actions Besides the operations, a grant can allow record actions on its rows: | Action | Allows | | --- | --- | | `comment` | public comments | | `work_note` | internal work notes | | `attach` | adding attachments | | `export` | exporting records (CSV) | | `merge` | merging duplicates | | `bulk_update` | changing many records at once | | `approval:decide` | deciding approvals on the record | | `reveal` | revealing masked values (holders also need `pii.reveal`, see [Reveal a masked value](https://docs.ligament.ai/guides/access/data-classification/index.md#reveal-a-masked-value)) | An action that no set in the workspace grants on an entity keeps its usual rule: comments, work notes and reveal follow read access; attach, merge and bulk update follow update; export stays with owners and admins, and an approval with its approvers. As soon as one set grants the action on the entity, only people whose grants include it may use it there. Owners and admins always may, unless a restriction enforced on them forbids it. Attachments follow the record they’re on. Someone who can’t read a record can’t list, download, add or remove its files either: they get the same 404 as for the record. Adding or removing a file is checked on that record too, with the `attach` grants when a set grants `attach` on the entity, and otherwise with the person’s update access to that record. For example, after the set `hr.reveal_personal_data` in Northwind Group granted `export` on person, Alex Agent’s export of people had Hannah Becker’s email masked as `h•••@northwind.example`: an export never contains more than the person can read. ### How sets combine Sets add up. When a person holds several roles, they get every row any of their grants allows, and each field gets the highest level any set gives it. In Northwind Group, Mia Member holds `people.member` (every field writable) and, through a delegation, `people.my_team` (manager read only): Mia can still change the manager field, because write is the higher level. To take something away, use a restriction. ### Sets that apps ship When you install an app it adds a set for each role its rules mention, named after the app and the role: `itsm.member`, `itsm.viewer`, `csm.enduser`. The Permission sets tab marks them as shipped by the app, and the Roles list counts them (“14 (13 shipped)”). Add a shipped set to a custom role to give that role the same access to the app as the built-in role has. ### Role parameters A grant can compare a field with `@role.`, so one set serves several roles. For example, a set with the grant “read person where `location` eq `@role.location`” and two roles that hold it, one with the parameter `location` = `Bangkok` and one with `Berlin`. - The role gives the default value. An assignment or a group mapping can give its own value, which wins. - `*` means any value: the condition is dropped. - A missing or empty value matches nothing, so a forgotten parameter never opens every row. ## Restrictions A restriction forbids something for everyone it covers, whatever their roles grant. Use one for rules that must hold, such as “nobody deletes a person who has a login account” or “viewers never see phone numbers”. Click **New restriction** on the Restrictions tab. | Setting | What it does | | --- | --- | | Entity | The entity it applies to. | | Forbidden actions | What it forbids: operations (read, create, update, delete, transition), record actions such as `approval:decide` or `export`, and moving a record into a state (`transition:`, or `transition:*` for any named transition). | | Forbidden when | A row condition. Empty means always. | | Field caps | The most a field may be: hidden, masked or read. They apply on every row, or on every row except those matching **Except on rows where**. They can’t be combined with **Forbidden when**. | | Except on rows where | Optional, with field caps only. A row condition (the same conditions as a grant’s) for rows the caps don’t apply to: the person’s own record (`{{user}} = @me`), a request they filed (`{{requested_by}} = @me`), their direct reports (`{{id}} in @me.descendants via ` with `depth: { max: 1 }`). The level is worked out per row, as for grants. | | Reveal | With a masked cap only. Off (the default): a value the restriction masks can’t be revealed. On (`revealable`): people with the `pii.reveal` capability can reveal it with a reason, which goes into the access audit. | | Roles | Who it covers. Empty means everyone. | | Enforce on owners and admins too | Off by default: owners and admins aren’t covered. Switch it on for rules such as separation of duties. Holders of a role with **Overrides restrictions** are still exempt. | | Except holders of capability | Optional. People whose sets hold this capability aren’t covered, for example `hr.medical` for “leave reasons are hidden, except for HR”. | | Message | What a refused person reads, in the error and in the Why panel. | Restrictions are how you set up [separation of duties](https://docs.ligament.ai/guides/access/separation-of-duties/index.md). Northwind Group has this one: ```json { "key": "people.no_phone_for_viewers", "entity": "person", "actions": [], "fields": { "phone": "hidden" }, "roles": ["viewer"], "enforceOnAdmins": false, "message": "Viewers don't see personal phone numbers." } ``` Vic Viewer also holds Team lead, whose set gives write on unlisted person fields. The restriction still wins: for Vic, `phone` is hidden on every person. A restriction with a condition and **Enforce on owners and admins too** on covers owners as well. With this restriction applied, `forbidWhen` `{{user}} not_empty` and `actions: ["delete"]`, explaining a delete for Ada (the owner) gave: ```text allow: false reason: forbidden message: People with a login account are offboarded, not deleted. "owner" (workspace admin): every row, except where a restriction enforced on admins forbids restriction people.keep_leavers (enforced on admins): forbids delete where user not_empty restriction people.keep_leavers matches this record: user is set ``` The same check on a person without a login account was allowed. ### A rule that depends on the record “Salary is for HR, the employee and the managers above them, owners and admins included” is one restriction: ```json { "key": "hr.pay_hr_only", "entity": "hr_employee", "fields": { "salary": "masked" }, "unlessCapability": "hr.comp", "unlessWhere": { "any": [ { "left": "{{user}}", "op": "eq", "right": "@me" }, { "left": "{{id}}", "op": "in", "right": "@me.descendants", "via": "hr.reporting" } ] }, "revealable": true, "enforceOnAdmins": true, "message": "Pay is for HR, the employee and the managers above them." } ``` For an owner, the salary is in clear on their own record and on the records of everyone below them in the reporting line, and masked on every other record: in lists, search, exports, the API and the history. A filter or sort on salary matches nothing for them while any row they see is masked, because it would tell them something about the masked rows. A total on salary is shown only over rows that are all in clear for them (their own line), and left out whenever a masked row is part of it. Holders of `hr.comp` aren’t covered at all. The relation is a parameter: `in @me.descendants` is everyone below (the chain); add `"depth": { "max": 1 }` for direct reports only. The reporting line is read from a table of who is below whom that’s kept up to date on every change, so the check costs no recursive query, and a loop in the line can’t be saved. See the [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md) for the full model. Apps can ship restrictions too. ITSM ships one that hides `resolution_notes` on incidents from members; it shows on the Restrictions tab with the app as its origin. ## Who can open Build, AI, Admin, Logs and the App Store Parts of the app that change the workspace itself need a **capability**. A permission set grants capabilities, and a person has a capability when any set they hold grants it. | Capability | Opens | | --- | --- | | `workspace.admin` | Members, access, workspace settings, secrets and embed tokens. Includes every capability below. Only owners can add it to a set. | | `build:use` | Build: data model, pages, components, blocks, changes, apps, imports, automations, plugins, extensions and templates. | | `ai:manage` | AI: agents, knowledge sources, MCP servers, tunnels, prompts and AI governance. | | `store:install` | The App Store: install, upgrade and remove apps, modules and plugins. | | `logs:read` | Logs: workflow runs, API calls, audit, agent and assistant activity, outbound mail and spend. | | `access.explain.others` | Explain another person’s access and use [View as](https://docs.ligament.ai/guides/access/view-as/index.md). | | `access.delegate` | Create [delegations](https://docs.ligament.ai/guides/access/time-bound-access/index.md#delegations) for other people’s reporting lines. | | `pii.reveal` | [Reveal masked values](https://docs.ligament.ai/guides/access/data-classification/index.md#reveal-a-masked-value) on a record, with a reason. | Connecting an outside account is an admin action, even inside Build and the App Store: entering or changing a plugin’s token, secret, headers or base URL, choosing which secret and hosts a connector uses, testing a provider such as an email sender, making one the default and removing it all need an owner or admin (an API key also needs `settings:write`). Builders keep authoring the connectors themselves; a secret a connector was connected with is sent only by that connector, only to its hosts, and can’t be used as `{{secrets.NAME}}` in a flow or script. Each of these changes is recorded in the access audit. Owners and admins hold every capability. Members and viewers hold none by default, so their app shows their own work and their personal settings (profile, security, notifications and API keys). A page they can’t open says so: “If you need it, ask a workspace admin.” ### Example: a maker role Northwind Group has a custom role `maker` that holds a set `maker_tools` with the capability `build:use` and no grants. Max Maker, whose seat role is `maker`, can open Build but not Logs, the App Store or AI settings. To give a member Build without making them an admin: 1. On the Permission sets tab, click **New set**. Name it, leave Grants empty, and under Capabilities tick `build:use`. 2. Click **Plan**, then **Apply**. 3. On the Roles tab, click **New role**, add the set, and apply. 4. Give the role to the person: as their seat role in Settings › Members, or with **Assign role** on the role page. In the same way, Northwind’s `service_desk.lead` set grants `logs:read` along with delete on incidents, so shift leads can read the logs. ### Capabilities for one app, and your own Some capabilities can be given for one app only, written `@`: - `app.admin@` makes the holder an administrator of that app, for example `app.admin@itsm`. Today it lets them change the classification of that app’s fields through the API (`PUT /api/access/classification`); the Classification page itself is for workspace admins. - `pii.reveal@` lets the holder reveal masked values on that app’s records only. You can also name your own capabilities, `.`, such as `hr.medical`. They don’t open anything by themselves: restrictions use them as an exemption (“hidden, except for holders of `hr.medical`”). Names starting with a prefix the platform uses (`workspace.`, `access.`, `pii.`, `app.`, `records.` and a few others) are refused. In the editor, the Capabilities part lists the workspace capabilities, the per-app ones for each installed app, and the capabilities your other sets already use; type any other one under **Add a capability**. The editor checks the name as you add it. ## Do it through the API Roles, permission sets and restrictions are documents you can read, plan and apply through the spec API and MCP (addresses `role/`, `permissionSet/`, `restriction/`). Changes made with an API key wait for a person to apply them; see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md#changes-made-with-an-api-key). Endpoints: [Access](https://docs.ligament.ai/reference/rest-api/index.md#access) and [Spec store](https://docs.ligament.ai/reference/rest-api/index.md#spec-store). --- # Groups and SCIM groups > Grant roles to groups, and let your identity provider keep the groups up to date. Source: https://docs.ligament.ai/guides/access/groups/ Give a role to a group instead of to people one by one: everyone in the group holds the role while they’re in it, and loses it the moment they leave. This works best when your identity provider already knows who’s on which team, because it can keep the groups in Ligament up to date for you. You see every group in **Settings › Access › Groups**, with where it comes from, how many members it has and which roles it’s mapped to. ## Where groups come from | Source | Who keeps the members | How it’s made | | --- | --- | --- | | Manual | Owners and admins of the workspace | Through the API (see below) | | SCIM | Your identity provider, over SCIM | The provider pushes the group | | SSO | The group claim in each person’s SSO sign-in | Created at the first sign-in that names it | You can’t edit the name or members of a SCIM or SSO group in Ligament: the group page says “Kept in sync by SCIM: change membership in your identity provider.” ## Map a group to roles A group mapping says which roles a group’s members hold. In Northwind Group, the group Service desk leads is mapped to the role Service desk lead. 1. Open **Settings › Access › Groups** and click the group. 2. Click **Edit role mapping**. 3. Add one or more custom roles. If a role has parameters, set them for this group: the group’s value wins over the role’s default. 4. Click **Plan** to see who gains what, then **Apply**. You can also start from a role: on the role page, click **Assign role** and pick a group instead of a member. A few rules apply: - Only custom roles can be mapped, never a seat role (owner, admin, member, viewer) and never a break-glass role. - A mapping has no end date. For access that should end on a date, assign the role to the people instead ([Time-bound access](https://docs.ligament.ai/guides/access/time-bound-access/index.md)). - To remove every role from a group, delete its mapping. The plan shows who loses access. When the plan for Northwind’s mapping ran, it showed exactly one change: ```text Member Alex Agent through service_desk_lead (group: Service desk leads) Gains: incident · delete no access → every row rows 0 → 39 ``` ## Groups in row conditions A row condition can use `@my.groups`: the ids of the person’s groups. A group can also be linked to a record, such as the ITSM assignment group Service Desk, and then `@my.groups` includes that record too. So a grant like this lets people see the incidents assigned to their own team: ```json { "entity": "incident", "ops": ["read", "update"], "where": { "all": [{ "left": "{{assignment_group}}", "op": "in", "right": "@my.groups" }] } } ``` ## Manual groups The app lists manual groups and edits their role mapping, but you create them and change their members through the API. Use a key with the `members:write` scope (an admin scope), or a signed-in owner or admin session. `recordEntity` and `recordId` are optional: they link the group to a record, such as an ITSM assignment group. ```bash curl -X POST "https://app.ligament.ai/api/access/groups" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H "content-type: application/json" \ -d '{"name":"Workplace IT on-call","description":"Weekend on-call rota for Workplace IT","recordEntity":"group","recordId":""}' ``` ```json { "id": "cmx6b0syc00m96x6sfm40lse4", "name": "Workplace IT on-call", "source": "manual", "externalId": null, "description": "Weekend on-call rota for Workplace IT", "recordEntity": "group", "recordId": "cmx1vv1bu00orfeutot8odlug" } ``` Add a member with `POST /access/groups//members` and `{"userId":""}`; remove one with `DELETE /access/groups//members?userId=`. The person must already be a member of the workspace (otherwise `404 no_member`). Map roles with `POST /access/group-mappings` and `{"groupId":"","roleKey":"service_desk_lead"}`. All endpoints: [Access](https://docs.ligament.ai/reference/rest-api/index.md#access). ## SCIM groups If your identity provider (Okta, Microsoft Entra ID and others) provisions users over SCIM, it can push groups too. Set up SCIM first: [SCIM provisioning](https://docs.ligament.ai/guides/identity/scim/index.md). Then assign the groups you want to the SCIM app in your provider. - The provider creates, renames and deletes groups, and adds and removes members, at `https://app.ligament.ai/api/scim/v2/Groups`. - Every member must be a user of the workspace already. If one isn’t, the provider gets an error naming it, and nothing in that request is written: `400 invalidValue: Not a user of this workspace: ""`. - The provider sees only SCIM groups. Manual and SSO groups stay out of its reach. - The group shows in Settings › Access › Groups with the source SCIM and the provider’s external id, for example “Service Desk Tier 2 · SCIM · 00g8kq2tier2”. Map it to roles as above. \[Screenshot: A SCIM group in Settings › Access › Groups: Service Desk Tier 2, mapped to service\_desk\_lead, with Alex Agent added by SCIM\] When the provider removes someone from the group, they lose the group’s roles on their next request. ## SSO group sync When people sign in with SSO (OIDC or SAML), Ligament reads the group claim in their sign-in and updates their SSO groups to match. Set up SSO first: [Single sign-on](https://docs.ligament.ai/guides/identity/sso/index.md). - The claim is `groups`, or `roles` if there’s no `groups` claim. For SAML, the SSO connection’s attribute mapping has to pass the attribute that carries the groups through as `groups`. - A group named in the claim that doesn’t exist yet is created, with the claim value as its name. Map it to roles once it appears. - The person joins every SSO group the claim names and leaves every other SSO group. An empty list removes them from all SSO groups. - If the claim is missing altogether, nothing changes, so a misconfigured provider can’t empty your groups. - Membership changes at sign-in. Someone removed from a group in the provider keeps the group’s roles until they next sign in with SSO; use SCIM if you need removals to take effect sooner. Every change to a group, its members or its mapping is recorded in **Settings › Access › Audit**, including the ones your provider makes. --- # Managers and their reports > Let managers see the people who report to them, at any depth you choose. Source: https://docs.ligament.ai/guides/access/hierarchies/ Give managers access to the people below them, without listing anyone by name. You declare a field such as **Manager** on Person as a hierarchy, then write grants like “people below me in the reporting line”. When someone changes manager, the access follows on the next request. Two steps: declare the hierarchy, then use it in a permission set. ## Declare a hierarchy A hierarchy is a reference field that points at the same entity: Person › Manager, or Department › Parent department. 1. Open **Settings › Access › Hierarchies** and click **Declare hierarchy**. 2. Fill in the declaration (table below) and click **Plan**, then **Apply**. 3. Ligament checks the existing data straight after the apply. If it finds no loops and no chain deeper than the maximum, the hierarchy becomes **Active**. Otherwise it stays **Blocked**, grants nothing through it, and the page shows the report. Fix the data, then recheck. | Setting | What it does | | --- | --- | | Key | For example `hr.reporting`. Can’t change later. | | Entity, field | The entity and its self-reference, for example Person and `manager`. | | Label | The name people see, for example “Reporting line”. | | Kind | `primary` for the main line. `secondary` for a dotted line, which counts one level only unless you make it transitive. | | Max depth | 1 to 64 levels (default 32). A change that would make a chain deeper is refused. | | When a node is removed | `refuse`: deleting a person who still has reports fails. `reparent_to_parent`: their reports move up to their manager. | | A member’s node | How Ligament finds “me” in the hierarchy: `user` means the record whose `user` field is the signed-in person. A two-step path such as `holder.user` also works, for positions held by people. | Northwind Group’s reporting line: ```json { "key": "hr.reporting", "entity": "person", "field": "manager", "label": "Reporting line", "kind": "primary", "maxDepth": 8, "onRemove": "reparent_to_parent", "principalVia": "user" } ``` \[Screenshot: Settings › Access › Hierarchies › Reporting line: active, Person · Manager, max depth 8, 18 nodes, 0 cycles\] Once a hierarchy is declared, Ligament refuses changes that would break it. Setting Vic Viewer’s manager to someone who reports to Vic gives: ```json { "error": "hierarchy_cycle: setting manager would make a loop (Vic Viewer → Hannah Becker → Tomás Ortega → Vic Viewer)", "code": "hierarchy_cycle" } ``` and making Vic their own manager gives `hierarchy_cycle: Vic Viewer can't be their own manager`. ## Grant access down the line In a permission set grant, compare a field with one of these tokens, using the `in` operator: | Token | Matches | | --- | --- | | `@me.descendants` | everyone below me | | `@me.descendants_or_self` | everyone below me, and me | | `@me.ancestors` | everyone above me: my manager, their manager, and so on | Add `depth` to limit how many levels count. On Person, `{{id}} in @me.descendants`: | `depth` | Who matches | | --- | --- | | none | all my reports, at every level | | `{ "max": 1 }` | my direct reports only | | `{ "min": 2 }` | reports of my reports, and further down | Add `"via": ""` when the entity has more than one hierarchy and you need to say which one. The `within` operator takes record ids instead and matches everything under them, for example everyone in a department and its sub-departments. In the condition builder, pick **Record**, **is one of**, **My hierarchy** and **below me**, then fill in the levels. ### Example: Northwind’s team leads The Facilities team in Northwind Group looks like this: ```text Vic Viewer (Facilities team lead) ├── Tomás Ortega (Facilities coordinator) │ └── Hannah Becker (Facilities assistant) └── Ravi Menon (Workplace technician) ``` The permission set `people.my_team` grants read and update on Person where `{{id}} in @me.descendants`, and the role Team lead holds it. Vic’s seat is viewer, which can only read people, but with Team lead Vic can update Tomás, Hannah and Ravi, and nobody else. Explaining Vic’s access gives: ```text allow: true reason: granted rows: id is below you in Reporting line: 3 today set people.my_team (role "team_lead", direct): allow update where id in @me.descendants visible because Hannah Becker → Tomás Ortega → Vic Viewer (you) (hr.reporting, 2 levels) ``` To limit team leads to their direct reports, add `"depth": { "max": 1 }`. The plan for that change shows Vic’s update access going from 3 people to 2, because Hannah reports to Tomás, not to Vic. See [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md). ### Other entities A grant on another entity can walk the same hierarchy through a field that references a person. For example, on an entity with an `employee` field that points at Person, `{{employee}} in @me.descendants` matches the records of everyone below me. ## What people see - The [Why panel](https://docs.ligament.ai/guides/access/why-can-i-see-this/index.md) on a record shows the path that gave access, such as “Visible because Hannah Becker → Tomás Ortega → you (Reporting line, 2 levels)”. - When an admin uses [View as](https://docs.ligament.ai/guides/access/view-as/index.md) for a manager, the banner says how big their reporting line is: “reporting line of 3 people”. - A manager going on leave can hand their line to someone else for a while: see [Delegations](https://docs.ligament.ai/guides/access/time-bound-access/index.md#delegations). ## Through the API `GET /api/access/hierarchies` lists the declared hierarchies with their status and data report. Declarations are documents at `hierarchy/`, planned and applied like roles and sets. If a hierarchy is blocked, fix the data and recheck it with `POST /api/access/hierarchies/` and `{"action":"recheck"}`. All endpoints: [Access](https://docs.ligament.ai/reference/rest-api/index.md#access). --- # Time-bound and elevated access > Access that ends on a date, temporary elevation with approval, delegation and break-glass. Source: https://docs.ligament.ai/guides/access/time-bound-access/ Some access should only last a while: cover for a colleague on leave, a contractor until the end of the project, extra rights for one evening shift, or a way in during an outage. Ligament has four tools for this, and each one ends on its own: nobody has to remember to take the access away. | You want | Use | Who starts it | Longest | | --- | --- | --- | --- | | Give someone a role until a date | [An assignment with an end date](#assignments-with-an-end-date) | An owner or admin | 366 days | | Let a member ask for a role for a few hours | [An elevation](#elevations) | The member asks, an owner or admin approves | The role’s max hours (at most 90 days) | | Let someone act for a manager | [A delegation](#delegations) | The manager, or an admin | 30 days (manager), 90 days (admin) | | Get in during an emergency, at once | [Break-glass](#break-glass) | An eligible person, no approval | 4 hours | All four appear in **Settings › Access › Assignments** while they’re active, and every start, decision and end is written to **Settings › Access › Audit**. When one ends, the access ends with it on the next request; nothing has to run first. \[Screenshot: Settings › Access › Assignments: Mia Member holds Service desk lead until the end of December and Team lead through a delegation; Vic Viewer holds Team lead with no expiry\] ## Assignments with an end date 1. Open the role (Settings › Access › Roles) and click **Assign role**, or click **Assign role** on the Assignments tab. 2. Pick the member and the role. If the role has parameters, fill them in. 3. Under **Expires**, pick 1 day, 1 week, 30 days, **On a date**, or No expiry. 4. Add a reason. It’s kept in the access audit. 5. Click **Assign**. In Northwind Group, Mia Member covers as service desk shift lead for December: ```bash curl -X POST "https://app.ligament.ai/api/access/assignments" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H "content-type: application/json" \ -d '{"userId":"","roleKey":"service_desk_lead","expiresAt":"2026-12-31T17:00:00.000Z","reason":"Acting shift lead for December"}' ``` ```json { "id": "cmx6asm0d00k16x6swo7a0zzo", "userId": "ixO3gz5g8e3XQY4PvpXkT6dQD32DlB5P", "roleKey": "service_desk_lead", "source": "direct", "startsAt": "2026-12-02T15:45:55.308Z", "expiresAt": "2026-12-31T17:00:00.000Z", "reason": "Acting shift lead for December", "grantedBy": "vtvYBRvkNm4bYx6I0D9xqXS1lxzj7rBJ" } ``` The key needs the `members:write` scope. You can also pass `startsAt` to start later. To end an assignment early, click **Unassign** on the Assignments tab (or `DELETE /api/access/assignments/`). Group mappings have no end date. For access that ends, assign the role to the people. ## Elevations An elevation is a request for a role for a few hours, with a reason, that an owner or admin approves. First make the role elevatable: in the role’s editor, switch on **Elevatable** and set **Max hours**. Without max hours an elevation lasts at most 8 hours. Members ask through the API with their own session; the app has no screen for members to make the request yet. Mia asks for Service desk lead for an evening: ```text POST /api/access/elevations {"roleKey":"service_desk_lead","hours":4,"reason":"Covering the evening shift lead while Lena is on leave"} ``` ```json { "id": "cmx6apm5k00e36x6s37enp1gt", "roleKey": "service_desk_lead", "kind": "request", "hours": 4, "status": "pending" } ``` The reason must say something (at least 10 characters). Owners and admins get a notification, and the request waits in **Settings › Access › Elevations**: \[Screenshot: Settings › Access › Elevations: Mia Member asks for Service desk lead for 4 hours, with Approve and Deny buttons\] An owner or admin clicks **Approve** or **Deny**, and can add a note. You can’t decide your own request. On approval the role starts at once and runs for the hours asked for: ```json { "status": "active", "decidedBy": "vtvYBRvkNm4bYx6I0D9xqXS1lxzj7rBJ", "decisionNote": "Approved for tonight", "startsAt": "2026-12-02T15:44:23.579Z", "endsAt": "2026-12-02T19:44:23.579Z" } ``` While it’s active, Mia’s explanation for deleting an incident names the elevation and when it ends: ```text also holds "service_desk_lead" (elevation, until 2026-12-02T19:44:23.579Z) set service_desk.lead (role "service_desk_lead", elevation): allow delete ``` To end it early, click **Revoke** under Active now, with a reason. Through the API: `POST /api/access/elevations//decide` with `{"approve": true, "note": "…"}` (or `false`), and `POST /api/access/elevations//revoke` with `{"reason": "…"}`. ## Delegations A delegation lets one person act for a manager on a hierarchy, for example while the manager is on holiday. While it’s active, the delegate: - sees and acts on the manager’s reporting line as if it were theirs; - holds the manager’s custom roles whose sets use the hierarchy (such as Team lead), until the delegation ends. It only affects grants that walk the hierarchy. Restrictions still apply to the delegate. Who can create one: - the manager, for their own line, for at most 30 days, through the API; - owners, admins and holders of the `access.delegate` capability, for anyone’s line, for at most 90 days, with **New delegation** in **Settings › Access › Delegations**. Longer than that needs an [elevation](#elevations) instead. Vic Viewer, Northwind’s Facilities team lead, hands the team to Mia for two weeks: ```text POST /api/access/delegations {"hierarchy":"hr.reporting","toUserId":"","endsAt":"2026-12-16T17:00:00.000Z","reason":"Covering my team while I am on annual leave"} ``` ```json { "hierarchy": "hr.reporting", "fromUserId": "pouyJIsvwzDk87bfOKevCX01vT2rjjMR", "fromNodes": ["cmx6ak5xy009x6x6srp7pyvma"], "toUserId": "ixO3gz5g8e3XQY4PvpXkT6dQD32DlB5P", "endsAt": "2026-12-16T17:00:00.000Z", "createdAs": "self", "roles": ["team_lead"] } ``` \[Screenshot: Settings › Access › Delegations: Vic Viewer to Mia Member on the reporting line, active until 16 December\] Click **Revoke** to end a delegation early. An admin creating one for someone else adds `"fromUserId"`. ## Break-glass Break-glass is for emergencies: an eligible person turns on a role themselves, at once, with a reason, for up to 4 hours. Nobody approves it, but every owner gets an in-app notification and an email, and every record change made under it is audited with the session. Set it up in the role’s editor (owners only): 1. Switch on **Break-glass** and set **Max hours** (at most 4). 2. Under **May break the glass**, add the members or groups who may use it. Owners and admins always may. 3. Plan and apply. Northwind Group’s role Emergency access holds a set with full access to incidents and problems, and Alex Agent may break the glass. During a P1, Alex activates it: ```text POST /api/access/break-glass {"roleKey":"emergency_access","reason":"P1: payroll service down, need to merge duplicate incidents","hours":1} ``` ```json { "elevation": { "kind": "breakglass", "hours": 1, "status": "active", "startsAt": "2026-12-02T15:44:53.565Z", "endsAt": "2026-12-02T16:44:53.565Z" }, "notified": { "inApp": 1, "email": 1 } } ``` Someone who isn’t eligible gets `403 not_eligible`: “You aren’t eligible to break the glass for “emergency\_access”: ask an owner to add you”. \[Screenshot: Settings › Access › Break-glass: the Emergency access role, Alex Agent's active session ending in 60 minutes, and the Activate form\] Owners and admins can also activate from the form on the **Break-glass** tab. Members who are eligible use the API with their session, because Settings › Access is only open to admins. To end a session early, click **End now**. Break-glass roles can’t be assigned or mapped to groups: the only way in is activation with a reason. --- # Why can I see this? > Find out why you, or someone else, can or can't see or change a record. Source: https://docs.ligament.ai/guides/access/why-can-i-see-this/ Every record has a **Why can I see this?** panel. It tells you, in plain words, whether you can see, edit, delete and change the state of that record, and which of your roles gives you that. Use it when you can see something you didn’t expect, or when a button you need is missing. ## Open the panel 1. Open the record. 2. Click **More actions** (the three dots at the top right) and choose **Why can I see this?** The panel answers for you, now, using the same rules that decide every request. Here is Vic Viewer, the Facilities team lead in Northwind Group, looking at Hannah Becker’s person record: \[Screenshot: The Why can I see this? panel on Hannah Becker's record: See yes, Edit yes, Delete no, Change state no, with the reporting-line path that gives Vic edit access\] ## Read the answer The top line sums up the four actions: **See**, **Edit**, **Delete** and **Change state**, each yes or no. Below it, each action opens to show why. For a yes, you see the chain that allowed it: the role you hold, how you hold it, and the permission set that grants it. | You see | It means | | --- | --- | | Set people.viewer | Your seat role (here, viewer) includes this set. | | Role team\_lead (assigned directly) → Set people.my\_team | An admin gave you the role Team lead. | | Role team\_lead (delegated …, until 16 Dec 2026) | Someone delegated their role to you until that date. See [Delegations](https://docs.ligament.ai/guides/access/time-bound-access/index.md#delegations). | | Role service\_desk\_lead (elevation …) | You asked for the role for a few hours and it was approved. | | an unconditional grant covers every record | The set allows the action on every record of this kind. | | Visible because Hannah Becker → Tomás Ortega → you (Reporting line, 2 levels) | The record is below you in a reporting line, and this is the path. See [Managers and their reports](https://docs.ligament.ai/guides/access/hierarchies/index.md). | The **See** section also lists the fields: **Can edit**, **Read only** and **Hidden**. In the picture, Vic can edit Hannah’s job title and location, can see but not change her manager and login account, and can’t see her phone number at all. For a no, the panel says why in one sentence: | Reason | What you read, for example | What to do | | --- | --- | --- | | No grant | “None of your roles grants delete on person.” | Ask an admin for a role that includes it. | | Outside your scope | “This record is outside your update scope.” You can do this on some records of this kind, but not on this one (for example, it isn’t in your team). | Check you’re on the right record, or ask an admin. | | Restriction | The restriction’s own message, such as “Viewers don’t see personal phone numbers.” Without a message: “A restriction forbids this delete (restrictions always win over grants).” | Usually nothing: the rule is deliberate. Ask an admin if you think it’s wrong. | | Field rule | “A field rule refuses this change.” You can change the record, but not one of the fields you touched. | Leave that field as it is, or ask an admin. | | Closed record | The record is resolved or closed, so it can’t be edited. | Reopen it first. | You won’t see the panel for records you can’t see at all: those don’t open for you. ## The same answer when something is refused When the app or the API refuses a change, the message carries the same reason, plus a hint and a link to the explanation. Vic trying to change the job title of Lena Fischer, who isn’t in Vic’s team: ```json { "error": "Not permitted to update this record", "code": "row_mismatch", "fix": "This record is outside your update scope on person.", "explain": "/api/access/explain?entity=person&action=update" } ``` The codes are `no_grant`, `forbidden` (a restriction), `row_mismatch` (outside your rows), `field_level`, `app_access` (you don’t have access to that app), `key_scope` (an API key lacks the scope) and `locked` (a closed record). See [Errors](https://docs.ligament.ai/developers/errors/index.md). ## For admins: explain someone else Owners, admins and holders of the `access.explain.others` capability see an extra **Explain for…** box at the top of the panel. Pick a member, and the panel answers for them instead of you, with a **View as** button to see the whole app as they do (see [View as](https://docs.ligament.ai/guides/access/view-as/index.md)). ### Through the API `GET /api/access/explain` answers the same question. Parameters: | Parameter | Value | | --- | --- | | `entity` | Entity key, for example `person` (required) | | `action` | `read` (default), `create`, `update`, `delete` or `transition` | | `recordId` | A record, for a record-level answer | | `principal` | `user:` or `role:`. Leave it out to explain yourself. Others need an admin. | | `fields` | Comma-separated field keys, to limit the field levels returned | ```bash curl "https://app.ligament.ai/api/access/explain?entity=person&action=update&recordId=&principal=user:" \ -H "authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "principal": { "kind": "user", "role": "viewer", "label": "Vic Viewer" }, "entity": "person", "action": "update", "allow": true, "reason": "granted", "rows": { "readable": "id is below you in Reporting line: 3 today" }, "fields": { "name": "write", "email": "write", "title": "write", "department": "write", "manager": "read", "user": "read", "location": "write", "phone": "hidden" }, "trace": [ { "step": "grant", "note": "set people.my_team (role \"team_lead\", direct): allow update where id in @me.descendants" }, { "step": "fields", "note": "restriction people.no_phone_for_viewers caps phone (no read/update/create)" }, { "step": "hierarchy", "note": "visible because Hannah Becker → Tomás Ortega → Vic Viewer (you) (hr.reporting, 2 levels)" } ], "record": { "allow": true, "note": "matches grant 1: id is below you in Reporting line: 3 today" } } ``` The output above is trimmed: the full trace has a step for each thing the evaluator checked. A key needs the `records:read` scope. `POST` with the same fields as JSON works too. `GET /api/access/effective?principal=user:&entity=person` gives the whole picture for a person instead of one action: every action allowed or not, the rows in words, and every field’s level. Leave out `entity` for all entities. ### Through MCP An agent connected to the MCP server can ask the same questions with these tools (scope `records:read`): | Tool | Answers | | --- | --- | | [`access_whoami`](https://docs.ligament.ai/reference/mcp-tools/index.md#access_whoami) | Who the key acts as: user, role, scopes. | | [`access_explain`](https://docs.ligament.ai/reference/mcp-tools/index.md#access_explain) | Why a person may or may not do one action, on an entity or one record. | | [`access_effective`](https://docs.ligament.ai/reference/mcp-tools/index.md#access_effective) | Everything a person can do, per entity. | `access_explain` takes `entity`, `action`, `recordId`, `fields` and `principal` (`"self"`, `{"user": ""}` or `{"role": ""}`), and returns the same result as the API. --- # View as > See the app exactly as another person sees it. Source: https://docs.ligament.ai/guides/access/view-as/ View as lets an admin see Ligament exactly as another member does: their navigation, their lists, their records, the fields they can and can’t see. Use it to check a new role before you tell people about it, or when someone reports “I can’t see X” and you want to see what they see. It’s read-only and lasts at most an hour. ## Who can use it - Owners, admins and people holding the `access.explain.others` capability. - You can view as another member of the same workspace, not as yourself. - Only an owner can view as an owner. An admin who tries gets “Only an owner can view as an owner”. View as works in a signed-in browser session only, never with an API key. ## Start viewing as someone From the member list: 1. Open **Settings › Members** and click the member. 2. In the panel, click **View as** followed by their name (for example **View as Mia Member**). Or from a record: 1. Open the record, then **More actions › Why can I see this?** 2. In **Explain for…**, pick the member. 3. Click **View as** followed by their name. The app reloads as that person, with a banner across the top: \[Screenshot: The View as banner: Viewing as Mia Member (Member), read-only, reporting line of 3 people, ends in 60 min, you are Ada Admin, with an Exit button\] The banner says whose view you’re in, their seat role, how many people are in their reporting line (when they manage someone, or act for a manager through a [delegation](https://docs.ligament.ai/guides/access/time-bound-access/index.md#delegations)), how long is left, and who you really are. Everything you open is decided as that person: lists, record pages, search, reports, dashboards and the Why panel. If they can’t open a page, you can’t either: viewing as Mia, Settings › Access says “Only workspace admins can open this page.” ## It’s read-only You can look, not change. Any change, from a button or from the API in the same session, is refused: ```json { "error": "You are viewing as another member: Ligament is read-only until you exit View as.", "code": "view_as_read_only", "fix": "Exit View as (DELETE /api/access/view-as, or Exit in the banner), then retry." } ``` ## Stop viewing Click **Exit** in the banner. The app reloads as you. The view also ends by itself after an hour, or as soon as it’s no longer allowed: if your own role changes, or the other person leaves the workspace. Every start and end is recorded in **Settings › Access › Audit**. ## Through the API From a signed-in session (not an API key): | Call | Does | | --- | --- | | `POST /api/access/view-as` with `{"userId":""}` | Starts a view and returns who and until when | | `GET /api/access/view-as` | Says whether a view is active | | `DELETE /api/access/view-as` | Ends it | ```json { "active": true, "viewAs": { "targetUserId": "ixO3gz5g8e3XQY4PvpXkT6dQD32DlB5P", "targetName": "Mia Member", "targetRole": "member", "expiresAt": "2026-12-02T16:46:05.000Z" } } ``` To check one action without switching views, use the [explain API](https://docs.ligament.ai/guides/access/why-can-i-see-this/index.md#through-the-api) instead. --- # Reviewing access changes > Before a change to access is applied, see who gains or loses what. Source: https://docs.ligament.ai/guides/access/reviewing-access-changes/ You see the effect of an access change before it happens. Before you apply a new role, an edited permission set, a restriction, a group mapping or a hierarchy, Ligament plans it and shows the **effective access diff**: which roles and which people gain or lose which actions, on which entities, and how many records that is. Read this page before you change a set that many people hold, or when an agent proposes an access change. ## Plan, then apply Every access editor in Settings › Access (roles, permission sets, restrictions, group mappings, hierarchies) has the same three buttons: | Button | Does | | --- | --- | | **Plan** | Shows what applying the draft would change. Nothing is written. | | **Apply** | Applies the draft. The change takes effect on the next request and is recorded in the history and the access audit. | | **Save as changeset** | Keeps the draft as a changeset in Build › Changes, so someone else can review and apply it. See [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md). | Applying an access change needs the `build:access` permission. Owners always have it; any other role has it when it’s among the role’s Build permissions, which the Roles list shows as “Apply access”. In Northwind Group that’s the admin role. ## Read the diff In Northwind Group, the set `people.my_team` lets team leads update everyone below them in the reporting line. Restricting it to direct reports means adding `depth` `{ "max": 1 }` to the condition. Clicking **Plan** on that draft shows: \[Screenshot: The Plan dialog for people.my\_team: 1 role and 1 member affected, 0 gains, 3 losses; Vic Viewer loses update on person, rows 3 to 2\] The top part lists each item and what changes in its document (`change grants[entity=person].where.all`). The **Effective access** part is the diff: - **Role** rows show what every holder of a role gains or loses, as conditions in words. Here every Team lead goes from “below the member in the hierarchy” to “exactly 1 level”, for read and for update. - **Member** rows show real people, with how they hold the role (“through team\_lead (direct)”), and the number of records before and after. Vic Viewer can update 3 people today and would update 2. - Each change is a gain, a loss or a change. The header counts them: “1 role, 1 member: 0 gains, 3 losses”. Vic doesn’t lose read on person, because Vic’s viewer seat already reads every person; the diff only lists what really changes for each person. A diff can also be all gains. Mapping the group Service desk leads to the role Service desk lead showed: ```text Member Alex Agent through service_desk_lead (group: Service desk leads) Gains: incident · delete no access → every row rows 0 → 39 ``` The diff covers record access: entities, actions, rows and field levels. Capabilities such as `logs:read` aren’t listed in it, so check the set’s Capabilities section yourself when you add one. ## Changes made with an API key Agents and scripts can propose access changes, but by default a person has to apply them. When an API key applies an access change, nothing is applied: the change becomes a changeset and the call answers `202`: ```bash curl -X POST "https://app.ligament.ai/api/spec/apply" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H "content-type: application/json" \ -d '{"items":[{"address":"permissionSet/people.my_team","baseHash":"2c5aaa1ac2c17330","doc":{ ... }}]}' ``` ```json { "ok": true, "proposed": true, "applied": false, "code": "spec.human_apply_required", "message": "Nothing was applied: a person must apply this change. It is waiting in Build → Changes.", "changeset": { "id": "cmx6akvt800b86x6sil2wvggg", "url": "/build/changes/cmx6akvt800b86x6sil2wvggg", "status": "ready" } } ``` The change waits in **Build › Changes**, marked **Ready for review** and “Proposed via API”, with who proposed it and through which key: \[Screenshot: Build › Changes: a permission set change proposed via API by Ada Admin, ready for review, with the policy note that access and code changes need a person to apply them\] The review page lists the items, the permissions needed and the policy. Someone who holds `build:access` clicks **Apply**, or **Discard** to drop it. The review page doesn’t show the effective access diff; to see it, open the set in its editor and plan the same change, or plan the changeset through the API (`POST /api/changesets//plan`, which returns `accessDiff`). Which key-made changes wait is a workspace setting in **Settings › Building and agents**: | Policy | Key-made changes that wait for a person | | --- | --- | | Access and code changes need a person to apply them (default) | access and code changes | | Every change an API key makes needs a person to apply it | every change | | API keys with spec:apply may apply anything their creator may | none | ## Plan through the API and MCP `POST /api/spec/plan` takes the same items as apply and writes nothing. The key needs `spec:read`. The answer says whether a person must apply it and includes the diff: ```json { "plan": { "ok": true, "humanApplyRequired": true, "policy": "review_access_code", "accessDiff": { "principals": [ { "kind": "user", "label": "Vic Viewer", "via": ["team_lead (direct)"], "changes": [ { "entity": "person", "action": "update", "before": "id is below Vic Viewer in the hierarchy", "after": "id is below Vic Viewer in the hierarchy (exactly 1 level)", "kind": "loss", "rows": { "before": 3, "after": 2 } } ] } ], "summary": { "roles": 1, "members": 1, "gains": 0, "losses": 3, "changes": 0 } } } } ``` (Trimmed: the role entry and the item details are left out.) Agents use the MCP tool [`access_plan`](https://docs.ligament.ai/reference/mcp-tools/index.md#access_plan), which takes the same `items` and returns the same plan. Addresses are `role/`, `permissionSet/`, `restriction/`, `groupMapping/` and `hierarchy/`; read the current document and its hash first with `GET /api/spec/
`. Endpoints: [Spec store](https://docs.ligament.ai/reference/rest-api/index.md#spec-store) and [Changesets](https://docs.ligament.ai/reference/rest-api/index.md#changesets). --- # App admins > Let someone manage access for one app, without making them a workspace admin. Source: https://docs.ligament.ai/guides/access/app-admins/ An app admin manages access for one app, and only that app. Give your customer success lead app admin rights for CSM and they can build CSM roles, hand them out, restrict CSM records and read the CSM part of the access audit. They can’t touch Service Desk, workspace settings, members’ seat roles, API keys, SSO or SCIM. Workspace owners and admins keep everything they have today. App admin rights only ever add to what a member can do, inside one app. ## Make someone an app admin App admin rights are a capability, `app.admin@`, that a permission set carries. Give it to a person through a role, the same way as any other access: 1. In **Settings › Access › Permission sets**, create a set (for example `csm.admins`) with the capability `app.admin@csm`. It needs no grants. 2. Create a role (for example **CSM admin**) that holds the set. 3. Assign the role to the person, or map it to a group. Only a workspace owner or admin can do this the first time. After that, an app admin can make other people admins of the same app: they may grant `app.admin@csm` because they hold it. `app.admin` always names an app. A set with a bare `app.admin` is refused. One person can be an app admin of several apps: give them a set with `app.admin@csm` and `app.admin@crm`, or two roles. Everything below then applies to both apps together, so they can build one role from CSM and CRM sets. ## What belongs to an app | Thing | Belongs to app X when | | --- | --- | | Entity | X installed it. An entity another app owns but X ships too (a shared entity, such as Customers’ `account` used by CSM) is shared with X. | | Permission set | Its app is X, and every entity it names is X’s own or shared with X. A set an app ships, such as `csm.member`, belongs to that app. | | Restriction | Its app is X and it is on one of X’s own entities. | | Role | Every permission set it holds belongs to X. Seat roles (owner, admin, member, viewer) belong to the workspace. | ## What an app admin can do - **Permission sets.** Create and edit sets for their app: set **App** to their app and grant only that app’s entities. On a shared entity they can keep or narrow what a set already grants, but not widen it (no new operations, no dropped condition, no higher field level). - **Roles.** Create custom roles and give them their app’s sets. They can’t change seat roles, role permissions, break-glass, elevation or **Overrides restrictions**. - **Assignments.** Assign and remove a role when every set it holds belongs to their app. A role with no sets yet can’t be assigned. - **Restrictions.** Add restrictions on their app’s own entities. They can’t enforce a restriction on owners and admins. - **Audit.** Read the access audit rows about their app: its sets, roles and restrictions, assignments of its roles, and record reads and reveals on its entities. - **Why and effective access.** Ask why another member can or can’t do something on their app’s entities, see someone’s effective access on them, and see who can see one of their records. Every change goes through the same plan and apply as a workspace admin’s, with the same history and audit row. ## What an app admin can’t do - Give `workspace.admin`, app admin rights for another app, or any capability they don’t hold themselves. Holding `pii.reveal` lets them give `pii.reveal@csm`; holding `pii.reveal@csm` doesn’t let them give `pii.reveal`. - Change another app’s sets, roles or restrictions, or grant access to another app’s entities. - Change groups, group mappings, hierarchies, shares, the evaluator, members’ seat roles, API keys, SSO, SCIM or any workspace setting. When they try, the change is refused with HTTP 403 and code `app_admin`, and nothing is written. For example, a CSM admin who assigns a Service Desk role gets: ```json { "error": "\"itsm_lead\" holds permission sets outside csm: only a workspace admin can assign it", "code": "app_admin" } ``` ## Where they work An app admin’s nav has an **Admin** entry named after their app, for example **Access: Customer success** (plain **Access** when they administer several apps). It opens **Settings › Access** on the Roles tab. They see only the Roles, Permission sets, Restrictions, Entities, Assignments and Audit tabs, and each shows only their app’s rows. The other tabs (groups, hierarchies, classification, elevations, break-glass, delegations, shares and the overview) stay with workspace admins. They create and edit their app’s permission sets, roles and restrictions in the same editors as a workspace admin: **New**, or **Edit** on one of their rows, then **Plan** and **Apply**. The plan shows who gains or loses access before anything changes. An editor for another app’s set, role or restriction answers “not found”. Saving a draft to a changeset in **Build › Changes** still needs the Build capability. Through the API, they use the same endpoints as a workspace admin, with an API key or a signed-in session: | Task | Request | | --- | --- | | Create or change a set | `PUT /api/access/permission-sets/` with `app` set to their app | | Create or change a role | `PUT /api/access/roles/` with `name` and `permissionSets` | | Assign a role | `POST /api/access/assignments` with `userId` and `roleKey` | | Add a restriction | `PUT /api/access/restrictions/` with `app` and `entity` | | Read the audit | `GET /api/access/audit` | | Lists | `GET /api/access/permission-sets`, `GET /api/access/restrictions`, `GET /api/access/assignments` (their app’s rows only) | | Plan, apply or validate through the spec store | `POST /api/spec/plan`, `POST /api/spec/apply`, `POST /api/spec/validate` with items addressed `/permissionSet/`, `/restriction/` or `role/` (roles have no app) | | Read one of their artefacts or its history | `GET /api/spec//permissionSet/` (add `?history=1` for the versions) | The spec store routes accept an app admin only for their own app’s permission sets, roles and restrictions, or a new key. Any other item in the request (another app’s set, a page, a hierarchy) refuses the whole request with `403 capability_required`, before anything is planned. A new key that lands in another app is planned with the error `access.app_admin` and can’t be applied. People with the Build capability use these routes for every artefact type, as before. An API key acts for the person who made it, so a CSM admin’s key has the same limits. The key also needs the endpoint’s scope (`settings:read` to read, `members:write` to change; `spec:read` to plan or read and `spec:apply` to apply through the spec store). Access changes made with a key wait for a person to apply them, as for workspace admins ([Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)). A CSM admin composing a role for case handlers: ```sh curl -X PUT "https://app.ligament.ai/api/access/permission-sets/csm.triage" \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d '{"app":"csm","grants":[{"entity":"case","ops":["read","update"]}]}' curl -X PUT "https://app.ligament.ai/api/access/roles/csm_triage" \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d '{"name":"Case triage","permissionSets":["csm.triage"]}' ``` --- # Data classification, masking and reveal > Mark fields as personal or sensitive data so they are masked, let the right people reveal a value with a reason, and log who opened which record. Source: https://docs.ligament.ai/guides/access/data-classification/ Use this page when some fields hold personal or sensitive data, such as a salary, a home address or a personal email, and most people who can open the record shouldn’t read them. You’ll classify the fields, decide who reads them in clear, let a few people reveal a value when they need it, and switch on a log of who opened which record. You need to be a workspace owner or admin. Everything here is in **Settings › Access › Classification**. ## Classify a field 1. Open **Settings › Access › Classification** and pick the entity. 2. For each field, choose **Personal data** or **Sensitive** (or leave it **Not classified**). 3. Click **Save**. \[Screenshot: Settings › Access › Classification for Person: Email is classified as Personal data, the other fields are not classified, and Audit reads is switched on\] From then on a classified field is **masked** for everyone except owners and admins, unless one of their permission sets gives the field a level. Masked means the person sees the shape of the value, not the value: | Value | Shown as | | --- | --- | | an email, `hannah.becker@northwind.example` | `h•••@northwind.example` | | a text of 8 characters or more, such as an account number | `••••1234` (the last four characters) | | a number, an amount, a date, a reference, a choice, or a short text | `•••••` | | no value | empty | A masked field can’t be changed, a filter on it matches nothing, and sorting, grouping and search leave it out, so nobody can work the value out by filtering. Its past values aren’t shown in the history either. The two classifications mask in the same way. Use them to say what kind of data it is: personal data is about a person (contact details, identifiers), sensitive is data that needs extra care (pay, health, ratings). ### Who sees it masked The **Who sees it masked** column lists the roles that see the field masked and the roles that read it in clear, from the roles’ permission sets. In Northwind Group, after classifying `email` on Person, it read “Masked for Member, Viewer and 2 more; in clear for Owner, Admin and 1 more.” Point at the line to see every role. To let a role read the field, give it a level in a permission set the role holds, on the set’s **Field levels** or on one grant: ```json { "fields": { "person": { "email": "read" } } } ``` A level on one grant applies only to the rows that grant covers. That’s how a person reads their own salary while their reports’ salaries stay masked; the [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md) shows it step by step. Owners and admins read classified fields in clear. To mask a field for them too, add a restriction with a **masked** field cap and **Enforce on owners and admins too** switched on (see [Restrictions](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md#restrictions)). ### Classification set by an app An app can classify its own fields. The Classification page then shows **The `` app** in the **Set by** column. You can still change it, but upgrading the app sets the app’s classification again. A field the app doesn’t classify keeps whatever you chose. ### Everywhere the same Masks apply wherever the record is read: the record page, lists, search, reports, the REST API, MCP tools and exports. An export never contains more than the person can read: after Northwind classified `email`, a member’s CSV export of people had `h•••@northwind.example` in Hannah Becker’s row. On the record page, open **More actions › Why can I see this?** to see which fields are masked for you: the See section lists them under **Masked**. ## Reveal a masked value Some people need the real value now and then, for example payroll fixing a bank detail. Give them the capability `pii.reveal` in a permission set (or `pii.reveal@` for one app’s records only). They then see a **Reveal** button next to a masked field on the record page. \[Screenshot: Hannah Becker's person record as Alex Agent: Email shows h•••@northwind.example, marked Masked, with a Reveal button\] 1. Click **Reveal** next to the field. 2. Type why you need the value, at least three characters. For example: “Payroll correction requested in HR-2291”. 3. Click **Reveal**. The value shows in the dialog. \[Screenshot: The Reveal Email dialog with a reason typed in, before the value is shown\] The value is only shown in the dialog. It isn’t kept on the page, and it’s gone when you close the dialog. Each reveal writes one entry to the access audit with who, which record, which fields and the reason; the value itself is never written there. \[Screenshot: Settings › Access › Audit filtered to reveals: Alex Agent revealed email on a person record with the reason Payroll correction requested in HR-2291\] Some limits: - Only a field that is masked for you on that record can be revealed. A field you can read doesn’t need it; a field that’s hidden can’t be revealed. - A field masked by a restriction can’t be revealed, unless the restriction allows it (**Reveal** on the restriction, `revealable: true`). Restrictions always win. - `reveal` is also a [record action](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md#record-actions): once a set grants it on an entity, only people whose grants include it may reveal there, and a restriction can forbid it on some rows. In Northwind Group, Alex Agent holds the role Payroll officer, whose set `hr.reveal_personal_data` holds `pii.reveal`. The same request without a reason is refused: ```http POST /api/records/person//reveal { "fields": ["email"], "reason": "x" } ``` ```json { "error": "A reason is required to reveal a value (it goes into the access audit)", "code": "reason_required" } ``` ## Log who opened which record Switch on **Audit reads** for an entity on the Classification page. Every time someone opens one record of that entity, in the app or with an API key, the access audit gets an entry **Record read** with who and which record. Opening the same record again within 10 minutes isn’t logged twice. Lists and searches aren’t logged, only opening a record. To read the log, open **Settings › Access › Audit** and choose **Record reads (read audit)** under Kind. In Northwind Group, with Audit reads on for Person, Alex Agent opening Hannah Becker’s record added: ```text record.read person/cmx6ak62y00a16x6siotp0zme Alex Agent ``` Classification changes are in the same audit, as **Classification**, with the fields before and after. ## Do it through the API `PUT /api/access/classification` changes classifications and the read audit of one entity. Send only what changes; `null` removes a classification. Owners, admins and roles with the `build:access` permission may call it; a holder of `app.admin@` may change that app’s entities. With an API key it needs the `members:write` scope. ```http PUT /api/access/classification { "entity": "person", "fields": { "email": "pii" } } ``` ```json { "entity": "person", "fields": { "name": null, "email": "pii", "title": null, "department": null, "manager": null, "user": null, "location": null, "phone": null }, "auditReads": false, "changed": 1 } ``` Reveal is `POST /api/records///reveal` with `{ "fields": [...], "reason": "..." }`; the answer has the values under `values`. Apps declare classification in their manifest with `classification` on a field and `auditReads` on an entity (see the [app manifest reference](https://docs.ligament.ai/reference/app-manifest/index.md)). --- # Separation of duties and approvals > Make sure nobody approves, issues or closes their own work: restrictions that cover admins, the approval:decide action and forbidding a move into one state. Source: https://docs.ligament.ai/guides/access/separation-of-duties/ Separation of duties means one person can’t do every step of a sensitive process alone: the person who asks for a change doesn’t approve it, the person who requests equipment doesn’t hand it out to themselves. Use this page to set that up with restrictions. You need to be a workspace owner or admin. Three things make it work: | Tool | What it does | | --- | --- | | A restriction **enforced on owners and admins too** | Owners and admins normally skip every rule. A restriction with this switch on stops them as well, so the rule has no back door. | | `transition:` | A restriction can forbid moving a record into one state, such as `transition:on_loan` or `transition:implementing`, instead of every state change. | | `approval:decide` | A record action. Grant it to the people who may decide approvals on an entity, and forbid it with a restriction where they mustn’t. | ## Nobody hands out equipment they requested In Northwind Group, equipment loans go from Requested to On loan to Returned. This restriction stops the person who created a loan from moving it to On loan: ```json { "key": "equipment_loan.no_self_issue", "entity": "equipment_loan", "actions": ["transition:on_loan"], "forbidWhen": { "left": "{{createdBy}}", "op": "eq", "right": "@me" }, "enforceOnAdmins": true, "message": "Someone else hands out equipment you requested." } ``` To make it in the app: 1. On the Restrictions tab, click **New restriction**. 2. Choose the entity, Equipment loan. Under **Forbidden actions › Moving into a state**, tick **Move to On loan**. 3. Under **When**, add the condition **Created by** is **me**. 4. Under **Who it covers**, leave the roles empty (everyone) and tick **Enforce on owners and admins too**. 5. Write the message, then **Plan** and **Apply**. \[Screenshot: The restriction equipment\_loan.no\_self\_issue: forbids moving to On loan when Created by is me, for everyone, owners and admins included\] With it applied, Ada (the workspace owner) created a loan for a Dell 27-inch monitor and tried to move it to On loan. The answer was: ```json { "error": "Someone else hands out equipment you requested.", "code": "forbidden", "fix": "Restrictions always win over grants; restriction \"equipment_loan.no_self_issue\" covers this record." } ``` Loans someone else created aren’t covered by the condition, so whoever may change a loan’s state can still move those to On loan. ## Nobody approves their own request Approvals on a record (a change waiting for approval, a leave request) are decided by the approver. Two rules decide who that may be: - **Who may decide.** Grant the record action `approval:decide` on the entity in the approvers’ permission set, with a row condition if only some records are theirs, for example “leave requests of people below me, at most two levels down”. Once any set grants `approval:decide` on an entity, only those grants (and owners and admins) count: being the approval’s assignee is no longer enough on its own. While no set grants it, the assignee or a workspace admin decides, as before. - **Who may not.** A restriction that forbids `approval:decide` when the record was requested by the decider, enforced on owners and admins: ```json { "key": "change.no_self_approval", "entity": "change", "actions": ["approval:decide", "transition:implementing"], "forbidWhen": { "left": "{{createdBy}}", "op": "eq", "right": "@me" }, "enforceOnAdmins": true, "message": "You can't approve or implement a change you requested." } ``` The check runs however the approval is decided: in the app, with an API key (the key’s creator decides) or from an approval email link (the member with that email decides; an email that isn’t a member can’t decide an approval on such a record). \[Screenshot: The restriction editor for a new restriction on Change: Decide approvals and Move to Implementing are ticked, owners and admins are covered, and holders of change.emergency are exempt\] ## Exceptions - **A capability exemption.** Set **Except holders of capability** on the restriction, for example `change.emergency`, and give that capability (in a permission set) to the few people allowed to break the rule. Everyone else, admins included, stays covered. - **Overrides restrictions.** A role with **Overrides restrictions** isn’t stopped by restrictions enforced on admins. Combine it with [break-glass](https://docs.ligament.ai/guides/access/time-bound-access/index.md) so it’s only active for a few hours and every use is in the audit. ## Check it - **More actions › Why can I see this?** on a record shows the restriction that refuses you, with its message. - The entity’s page under **Settings › Access › Entities** shows the restriction next to every role it covers. - Before applying, **Plan** shows who would lose which action (see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)). The [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md) uses the same pattern for leave requests: managers approve their reports’ leave, nobody approves their own. --- # Example: access for HR data > A worked HR setup: managers see their reports and their leave dates but not the reasons, pay is for HR, the employee and the managers above them (owners and admins included), employees enter their own leave reason, HR sees everything and exports keep the masks. Source: https://docs.ligament.ai/guides/access/hr-example/ This walk-through builds access for HR data from the pieces on the other pages: field levels per grant, classification, record actions, restrictions that cover admins, and approvals. Use it as a pattern for any data where people see their own record, managers see their team’s, and a few fields are for HR only. You’ll need two entities of your own (create them in Build or ship them in an app): | Entity | Fields | | --- | --- | | `employee` | `name`, `country`, `phone`, `salary` (an amount), `manager` (a reference to another employee), `user` (the login account) | | `leave_request` | `employee` (a reference), `requested_by` (a user), `start`, `end`, `days`, `status`, `reason`, `medical` | The reporting line is a [hierarchy](https://docs.ligament.ai/guides/access/hierarchies/index.md) on `employee.manager`, here called Reporting line, with `user` as the field that says which employee record is you. The people: Somchai runs the team; Mali reports to him, Niran to Mali and Ploy to Niran. Wei, in another country, also reports to Somchai. Hana works in HR. ## What we want | Who | Employee records | Salary | Leave requests | Reason and medical note | | --- | --- | --- | --- | --- | | An employee (Niran) | their own; may change their phone only | their own, in clear, with its history | their own; may file and comment | on their own requests: they enter them | | A manager (Mali) | everyone below them in the reporting line; may change a report’s country | in clear with its history for everyone below them (Niran, and Ploy below him), in clear on their own record; not their own manager’s | dates of their reports’ leave; may approve up to two levels down | on their own requests only | | HR (Hana) | everyone; may change anything | in clear | everyone’s; may approve | visible | | Owner and admins | everyone | masked, except their own record and anyone below them in the reporting line; only HR changes pay | everyone’s | on their own requests only, unless they’re in HR | | Anyone | | | can’t approve or change a leave request they filed | | ## 1\. Classify the data In **Settings › Access › Classification**: - Employee: set `salary` to **Sensitive**. From now on salary is masked for everyone who isn’t an owner or admin, unless a set gives it a level. - Leave request: switch on **Audit reads**, so every time someone opens a leave request, the access audit says who. See [Data classification, masking and reveal](https://docs.ligament.ai/guides/access/data-classification/index.md). ## 2\. The permission sets **Employee self-service.** Two grants on rows that are “mine”. On the employee record the grant lists its field levels: salary `read` makes the classified salary readable on your own record only, and phone is the one field you may change. ```json { "key": "hr.employee", "label": "Employee self-service", "grants": [ { "entity": "employee", "ops": ["read", "update"], "where": { "left": "{{user}}", "op": "eq", "right": "@me" }, "fields": { "phone": "write", "name": "read", "country": "read", "manager": "read", "user": "read", "salary": "read" } }, { "entity": "leave_request", "ops": ["read", "create"], "actions": ["comment"], "where": { "left": "{{requested_by}}", "op": "eq", "right": "@me" } } ] } ``` **Line manager.** Everyone below me in the reporting line, at any depth (my direct reports, their reports and so on), with their salary in clear and only `country` (the job location) writable. To limit pay to direct reports, add `"depth": { "max": 1 }` to this grant’s condition and to the pay restriction’s exemption below; managers then see the rest of their chain without pay. ```json { "key": "hr.manager", "label": "Line manager", "grants": [ { "entity": "employee", "ops": ["read", "update"], "actions": ["export"], "where": { "left": "{{id}}", "op": "in", "right": "@me.descendants", "via": "reporting_line" }, "fields": { "salary": "read", "phone": "read", "name": "read", "manager": "read", "user": "read", "country": "write" } }, { "entity": "leave_request", "ops": ["read"], "where": { "left": "{{employee}}", "op": "in", "right": "@me.descendants", "via": "reporting_line" } }, { "entity": "leave_request", "ops": [], "actions": ["comment", "approval:decide"], "where": { "left": "{{employee}}", "op": "in", "right": "@me.descendants", "via": "reporting_line", "depth": { "max": 2 } } } ], "history": { "employee": { "phone": "hidden" } } } ``` **HR.** Everything on both entities, salary writable, the HR actions, and a capability of your own, `hr.medical`, that the restriction below looks for. ```json { "key": "hr.hr", "label": "HR administrator", "grants": [ { "entity": "employee", "ops": ["read", "create", "update"], "actions": ["export"], "fields": { "salary": "write" } }, { "entity": "leave_request", "ops": ["read", "create", "update"], "actions": ["export", "comment", "work_note", "approval:decide"] } ], "capabilities": ["hr.medical"] } ``` You build each of these in the permission set editor: the grant’s **Record actions** checkboxes, its **Field levels on these rows** table, the set’s **Hide history** column and **Add a capability**. Or paste them in the JSON tab. ## 3\. The restrictions All are enforced on owners and admins, so they hold for everyone. The first two depend on the record: their field caps don’t apply on the rows that match **Except on rows where** (`unlessWhere`). The reason and the medical note are hidden, except for HR and on a request you filed. The employee enters them when filing and reads them back; nobody else does: ```json { "key": "hr.leave_medical_hr_only", "entity": "leave_request", "actions": [], "fields": { "reason": "hidden", "medical": "hidden" }, "unlessCapability": "hr.medical", "unlessWhere": { "left": "{{requested_by}}", "op": "eq", "right": "@me" }, "enforceOnAdmins": true, "message": "Leave reasons and medical notes are for the employee and HR only." } ``` Pay is masked for everyone, owners and admins included, except for HR (`hr.comp`), on your own record and on the records of everyone below you in the reporting line. HR viewers with `pii.reveal` can still reveal it with a reason (`revealable`): ```json { "key": "hr.pay_hr_only", "entity": "employee", "fields": { "salary": "masked" }, "unlessCapability": "hr.comp", "unlessWhere": { "any": [ { "left": "{{user}}", "op": "eq", "right": "@me" }, { "left": "{{id}}", "op": "in", "right": "@me.descendants", "via": "reporting_line" } ] }, "revealable": true, "enforceOnAdmins": true, "message": "Pay is for HR, the employee and the managers above them." } ``` And only HR changes pay, on their own record too: ```json { "key": "hr.pay_changes_hr_only", "entity": "employee", "fields": { "salary": "read" }, "unlessCapability": "hr.comp", "enforceOnAdmins": true, "message": "Only HR changes pay." } ``` Give the HR set the capability `hr.comp` next to `hr.medical`. ```json { "key": "hr.leave_no_self_approval", "entity": "leave_request", "actions": ["approval:decide", "update"], "forbidWhen": { "left": "{{requested_by}}", "op": "eq", "right": "@me" }, "enforceOnAdmins": true, "message": "You can't approve or change a leave request you filed yourself." } ``` ## 4\. The roles | Role | Holds | | --- | --- | | Employee | `hr.employee` | | Line manager | `hr.employee`, `hr.manager` | | HR administrator | `hr.employee`, `hr.hr` | Every manager also holds the employee set: it shows everyone’s directory fields without pay, and their own record with it. The manager set adds pay for everyone below them. Levels are worked out per row, and the highest level any of your grants gives on that row wins: a manager reads pay on their own record and below them, and nowhere else. ## What each person gets - **Niran** (Employee) opens his own record and sees his salary. He can change his phone; changing his salary, manager or country is refused. He sees his own leave requests and can file one. - **Mali** (Line manager) lists Niran and Ploy, who reports to Niran. Both show their salary, and their records’ history has every past salary. She doesn’t see the salary of Somchai, her own manager, or of Wei’s team next to hers. Her own record shows her salary. - **Somchai** (Line manager, two levels above Niran) may approve Niran’s leave; he can’t approve Ploy’s, which is three levels down. Wei can’t approve either: they’re not in his line. - **Hana** (HR) reads every salary, reason and medical note, and approves any leave request except one she filed herself. - **The workspace owner and admins** see salaries masked, except on their own record and for anyone below them in the reporting line (pay restriction, enforced on admins; they don’t hold `hr.comp`), and can’t change pay. An owner who is also the CEO is at the top of the line, so they read everyone’s pay. They see leave reasons and medical notes only on requests they filed. - **Nobody** approves or edits a leave request they filed: the restriction covers managers, HR and admins alike. ## When the reporting line changes Access follows the current reporting line, kept as a precomputed table of who is below whom that’s updated on every change. When HR moves Niran (and Ploy below him) from Mali to Wei, Wei and everyone above Wei read both salaries and their whole history straight away, including the versions from before Wei became their manager. Mali no longer does, and neither does anyone above Mali who isn’t also above Wei. That’s the usual HR model: the history belongs to the employee, and whoever is above them now may read it. The reporting line itself isn’t dated here, so the switch happens when the change is saved, not on a future effective date, and “as of” reads use today’s line. A reporting line can’t loop: saving a manager who reports to the person is refused, so nobody ends up above their own manager. ## Rules that depend on the record `unlessWhere` takes the same conditions as a grant’s `where`: `@me` (`{{user}} = @me`, `{{requested_by}} = @me`), your attributes and groups, and the reporting line (`in @me.descendants via …`: everyone below; add `depth` to limit it, `{ "max": 1 }` for direct reports only). It works on any entity of any app. Lists, related lists, search, exports, the REST API, the CLI, MCP and the assistant all apply the level for each row. Filters and sorts use the level that holds on every row you can see, so a filter on salary matches nothing when salary is masked or hidden on some of your rows, even if it’s in clear on others: a manager can’t find out a colleague’s pay outside their own line by filtering or sorting. A list total is shown when every row it adds up is in clear for you, and left out as soon as one row is masked or hidden. A manager whose list holds only her line sees its salary total; filter her list to her team (by person or department, not by salary) and the total of that team shows too. Add one person outside her line and the total goes. The same goes for each group’s subtotal. Money totals stay per currency. ## Exports keep the masks Export is a record action, so only sets that grant `export` allow it once any set does: here managers (for their line) and HR. An export contains exactly what the person can read: Mali’s CSV of employees lists Niran and Ploy with their salaries, and an admin’s CSV of leave requests has no reasons or medical notes. ## Reveal a salary when needed A compensation reviewer needs a report’s salary now and then. Give them a set with read on employee and the capability `pii.reveal`: they see the masked salary with a **Reveal** button, type a reason, and the value shows once. The reveal is in the access audit with the reason, never with the value. See [Reveal a masked value](https://docs.ligament.ai/guides/access/data-classification/index.md#reveal-a-masked-value). ## Check it - Use [View as](https://docs.ligament.ai/guides/access/view-as/index.md) to open the employee list as Mali, then as Niran. - On a leave request, **More actions › Why can I see this?** shows which fields are masked or hidden for you and which restriction does it. - **Settings › Access › Audit** lists the record reads of leave requests and every reveal. - Before applying any of the sets, **Plan** shows who gains or loses what (see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)). --- # Effective dating > Record changes that take effect on a date, correct the past, and read data as it was on any day. Source: https://docs.ligament.ai/guides/effective-dating/ Effective dating keeps the history of a record’s values by the date they apply from, not only by when someone typed them. You can schedule a raise for 1 January and it takes effect on the day. You can fix a salary that has been wrong since September, and every report for October shows the fixed figure. You can also ask what a record, a list or a headcount looked like on any date. It suits data where the date a value applies matters as much as the value itself: - HR: job, department, location, pay and employment status. - Contracts: terms, rates and renewal dates that change part-way through. - Price lists: prices that change from a date, so you can look up the price that applied on any day. Effective dating is available through the [API](https://docs.ligament.ai/developers/as-of/index.md), the [MCP server](https://docs.ligament.ai/developers/mcp/index.md) and the [CLI](https://docs.ligament.ai/developers/cli/index.md). The app has no screens for it yet, so forms and record pages show today’s values only. ## Turning it on Effective dating is turned on per entity. Ligament switches it on for you: email hello@ligament.ai with the entity you want dated and how its fields should be grouped (see below). There’s no setting for it in the app, the API or an app manifest. When it’s switched on, every existing record gets a first version that holds its current values. Entities that aren’t dated keep working exactly as before, and an `asOf` on them returns today’s values. ## How a dated entity is organised The dated fields of an entity sit in **groups**. A group is a set of fields that change together and share one history. An employee entity might have: | Group | Fields | Reasons it accepts | Rules | | --- | --- | --- | --- | | `job` (Job) | `department`, `location`, `employment_status` | `hire`, `transfer`, `leave`, `termination` | Back-dating up to 31 days | | `comp` (Pay) | `salary`, `pay_grade` | `hire`, `merit`, `promotion`, `market_adjustment` | Reason and effective date required; back-dating up to 90 days | Each change to a group creates a new **version** of that group, valid from a date until the next version starts. Fields outside every group (here `name` and `email`) are not dated: they always show today’s value. A group can have these settings: | Setting | What it does | | --- | --- | | Reasons | The reasons a change may give. `correction` is always allowed. With no list, any reason is accepted. | | Reason required | A change must give a reason. Corrections and rescinds always need one. | | Effective date required | A change must name the date it applies from. Without this, a change with no date applies from today. | | How far ahead | How many days in the future a change may start. The default is 730. | | How far back | How many days in the past a change may reach without the right to change the past. The default is 0. | A few things stay current-only and can’t be dated: the record id, its lifecycle state, system fields (created and updated), auto-numbers, calculated and roll-up fields, unique fields, and fields that feed a hierarchy. An entity can have up to eight groups. ## Dates and today A date such as `2027-01-01` means midnight at the start of that day in your workspace’s time zone. “Today” is also today in that zone. A change dated for the future is stored straight away and takes effect from midnight on its date (see [Changes, corrections and rescinds](https://docs.ligament.ai/guides/effective-dating/changes-and-corrections/index.md)). ## Who can do what Reading and writing dated records needs the same rights as any record. Two capabilities add more, and owners and admins hold both: | Capability | Lets you | | --- | --- | | `effective.retro` | Change further back than a group’s back-dating limit, and change a [locked period](https://docs.ligament.ai/guides/effective-dating/locked-periods/index.md). | | `records.as_recorded` | Read data as it was recorded at an earlier moment (`knownAt`), and see superseded versions in a record’s history. An API key with the `audit:read` scope can do this too. | Grant them to other people through a permission set: see [Roles and permission sets](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md). ## Next - [Changes, corrections and rescinds](https://docs.ligament.ai/guides/effective-dating/changes-and-corrections/index.md) - [Reading as of a date](https://docs.ligament.ai/guides/effective-dating/as-of/index.md) - [Locked periods](https://docs.ligament.ai/guides/effective-dating/locked-periods/index.md) - [Worked example: a raise and a correction](https://docs.ligament.ai/guides/effective-dating/hr-example/index.md) - [As-of parameters](https://docs.ligament.ai/developers/as-of/index.md) for the API, MCP and CLI details --- # Changes, corrections and rescinds > Schedule changes from a date, correct the past, cancel a change, and what the warnings mean. Source: https://docs.ligament.ai/guides/effective-dating/changes-and-corrections/ Every write to a dated field is one of three things. Pick the one that matches what happened in the real world: | Mode | Use it when | What it does | | --- | --- | --- | | `change` (the default) | Something new happens from a date: a raise, a transfer, a leaver. | Adds a version from that date. The version before it ends the day before. | | `correction` | A value that was recorded is wrong. | Replaces the values of the version in force on a date, for that version’s whole period. Or moves a version to a new start date. | | `rescind` | A change should never have happened, for example a transfer that was cancelled. | Removes the version. The version before it runs on until the next one. | You send the mode with the values, in an `effective` object. The examples on this page use the API. The same calls exist as MCP tools and CLI commands: see [As-of parameters](https://docs.ligament.ai/developers/as-of/index.md). ## A change from a date Send the new values and the date they apply from: ```bash curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":90000},"effective":{"from":"2027-01-01","reason":"merit"}}' ``` ```json { "record": { "name": "Priya Raman", "salary": 84000, "pay_grade": "P3", "…": "…" }, "effective": [ { "group": "comp", "mode": "change", "version": { "id": "a69587f4-91a8-4de5-bf38-d650137a66c1", "from": "2027-01-01", "to": "infinity", "seq": 0, "status": "scheduled" }, "propagated": [], "warnings": [], "periods": [{ "from": "2027-01-01", "to": "infinity", "fields": ["salary"] }], "past": false } ] } ``` `record` always shows today’s values, so the salary is still 84,000. `effective` lists one entry per group the write touched: the new version, its `status`, and the `periods` whose values changed. ### Future dates: scheduled, then applied on the day A change dated after today has the status `scheduled`. Ligament stores it at once and applies it from midnight on its date, in your workspace’s time zone. Nobody has to come back and make the change on the day. - Reads with an `asOf` date are exact from midnight, because they read the versions directly. - Reads without `asOf` show today’s stored values. These catch up with a scheduled change within about a minute of midnight. ### Writes with no date A write to a dated field without `effective` is a change from today. That’s how forms, imports and older integrations keep working on a dated entity. Only the dated values that actually differ from today’s are recorded. You can send the values at the top level (`{"salary": 95000}`) or inside `values` (`{"values": {"salary": 95000}}`); both are the same change from today. Don’t mix the two: `values` next to other fields is refused, because it isn’t clear which values you meant: ```json { "error": "Send the field values either at the top level or inside \"values\", not both.", "code": "effective_values_envelope", "path": "values", "message": "Send the field values either at the top level or inside \"values\", not both.", "fix": "Use { \"values\": { \"salary\": 66000 }, \"effective\": { \"from\": \"2027-03-01\", \"reason\": \"merit\" } } for a dated change, or { \"salary\": 66000 } for a change from today." } ``` If the group requires an effective date, a write without one is refused: ```json { "code": "effective_date_required", "path": "effective.from", "message": "Pay changes need an effective date", "fix": "Send effective.from (YYYY-MM-DD)." } ``` ### New records When you create a record, `effective.from` is the date it starts. Before that date the record isn’t in as-of lists or reports, so someone hired from 4 January doesn’t count in December’s headcount. Without `effective.from` the record starts today. ## A change in the past A change can also be back-dated. If it changes today’s value, `record` shows the new value straight away. Back-dating has limits: - Each group says how far back a change may reach. Beyond that, you need the `effective.retro` capability (owners and admins have it). Without it, the write fails with `effective_backdate_needs_capability`. - A change into a [locked period](https://docs.ligament.ai/guides/effective-dating/locked-periods/index.md) needs `effective.retro` and a reason. ### When a change rewrites later ones A change applies from its date until the next version **that sets the same field**. If a later version didn’t set that field, it now carries the new value too, and the response warns you. In this example a raise to 90,000 was already scheduled for 1 January. Then a promotion to grade P4 from 1 September is recorded: ```json { "group": "comp", "mode": "change", "version": { "from": "2026-09-01", "to": "2027-01-01", "status": "in_force" }, "propagated": [{ "from": "2027-01-01", "fields": ["pay_grade"] }], "warnings": ["The change of 2027-01-01 now carries pay_grade from this one."], "periods": [ { "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary", "pay_grade"] }, { "from": "2027-01-01", "to": "infinity", "fields": ["pay_grade"] } ], "past": true, "retroPeriod": ["2026-09-01", "2026-12-02"] } ``` The 1 January raise still sets the salary to 90,000, but it now carries grade P4 instead of P3. The salary didn’t move forward, because the 1 January version set the salary itself. `past` is true when the change touched a date before today, and `retroPeriod` gives the part of the change that lies in the past. ### Two changes on the same day A second change to the same group on the same date applies after the first, and you get a warning: ```json "warnings": ["Another job change already starts on 2027-02-01: this one applies after it."] ``` Both stay in the history. The earlier one shows the status `same_day`. ## A correction A correction fixes a version’s values for its whole period, without adding a new change. Name the date the wrong version was in force on, and give a reason: ```bash curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":88000},"effective":{"from":"2026-09-01","mode":"correction","reason":"Promotion salary keyed as 86,000; the offer letter says 88,000"}}' ``` ```json { "group": "comp", "mode": "correction", "version": { "from": "2026-09-01", "to": "2027-01-01", "seq": 0, "status": "in_force" }, "warnings": [], "periods": [{ "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary"] }], "past": true } ``` The version from 1 September now holds 88,000. The wrong value isn’t deleted: the history keeps it as a superseded version, and people with `records.as_recorded` can still read what was recorded before the fix (see [Reading as of a date](https://docs.ligament.ai/guides/effective-dating/as-of/index.md#as-recorded-at-an-earlier-moment)). Like a change, a correction carries forward into later versions that didn’t set the same field. ### Correction or new change Ask whether the old value was ever true. - The salary really was 86,000 until it went up: that’s a new **change** from the date it went up. The history then shows both values, each for its own period. - The salary was always meant to be 88,000 and someone typed it wrong: that’s a **correction**. Reports for the past now show 88,000, and the history marks the fix. ### Moving a version to another date To move a version’s start date, send `mode: correction` with the version’s id (from the record’s history) and the new `from`: ```json { "effective": { "mode": "correction", "version": "41aad206-135e-48b0-9c4f-b7292fc5e8a8", "from": "2027-03-01", "reason": "Adjustment moved to the March pay cycle" } } ``` ```json { "group": "comp", "mode": "correction", "version": { "from": "2027-03-01", "to": "infinity", "status": "scheduled" }, "periods": [{ "from": "2027-02-01", "to": "2027-03-01", "fields": ["salary"] }] } ``` `periods` shows that February’s salary changed: it now keeps the value from before the adjustment. A version can’t be moved past the next version of its group, or onto a day that already has another change (`effective_retime_conflict`). ## A rescind A rescind removes a version. Name it by id (`version`) or by a date it’s in force on (`from` plus `group`), and give a reason: ```json { "effective": { "mode": "rescind", "from": "2027-02-01", "group": "job", "reason": "Transfer to Engineering cancelled" } } ``` ```json { "group": "job", "mode": "rescind", "version": null, "rescinded": { "id": "b48894f9-7add-4e24-b27d-a5b9f2dfcc92", "from": "2027-02-01", "to": "infinity" }, "periods": [{ "from": "2027-02-01", "to": "infinity", "fields": ["location"] }] } ``` The version before it now runs on. If the date has several changes, a rescind by date removes the last one of that day, so repeat it to remove the others. Later versions that inherited values from the rescinded one get the earlier values back. The first version of a record can’t be rescinded (`effective_rescind_first`): correct it instead. ## Reasons Each group can list the reasons it accepts, for example `hire`, `merit`, `promotion` and `market_adjustment` for pay. `correction` is always accepted. - Corrections and rescinds always need a reason. It can be any text, such as “Typo in promotion salary”. - A change needs a reason if the group requires one, and it must be one of the group’s reasons: ```json { "code": "effective_reason", "path": "effective.reason", "message": "\"bonus\" isn't a Pay reason: hire, merit, promotion, market_adjustment, correction", "details": { "reasons": ["hire", "merit", "promotion", "market_adjustment", "correction"] } } ``` The reason is stored on the version and shown in the history. ## Several records in one change Some events change several records at once, such as a team moving office. Send them together to `POST /api/records/batch`: either every item is written or none is. ```json { "items": [ { "entity": "employee", "id": "cmx6ai5om007w6x6s2p6fuefi", "values": { "location": "Chiang Mai" }, "effective": { "from": "2027-03-01", "reason": "transfer" } }, { "entity": "employee", "id": "cmx6ai0dx007r6x6stm9adjh5", "values": { "location": "Chiang Mai" }, "effective": { "from": "2027-03-01", "reason": "transfer" } } ] } ``` A batch takes only dated fields. Write other fields with a normal update (`effective_batch_plain` otherwise). A batch holds up to 200 items. ## Errors you may see | Code | Meaning | | --- | --- | | `effective_reason_required` | The change needs a reason (always for corrections and rescinds). | | `effective_reason` | The reason isn’t one of the group’s reasons. | | `effective_date_required` | The group requires `effective.from`. | | `effective_future_too_far` | The date is further ahead than the group allows (730 days unless set otherwise). | | `effective_backdate_needs_capability` | The change reaches further back than the group allows without `effective.retro`. | | `effective_locked` | The change touches a [locked period](https://docs.ligament.ai/guides/effective-dating/locked-periods/index.md). | | `effective_no_version` | Nothing is in force on that date: the record starts later. | | `effective_rescind_first` | The first version can’t be rescinded. | | `effective_conflict` (409) | The version you named changed in the meantime. Reload the history and try again. | The full list, with status codes, is on [As-of parameters](https://docs.ligament.ai/developers/as-of/index.md#errors). --- # Reading as of a date > Read records as they were on a date, as they were recorded at a moment, their history, and the changes feed for exports. Source: https://docs.ligament.ai/guides/effective-dating/as-of/ Add `asOf` to a read to see dated fields as they were, or will be, on that date. Use it for month-end figures, for checking what applied when an invoice or payslip was produced, and for previews of scheduled changes. This page covers: - `asOf` on records, lists and reports; - `knownAt`, to read data as it was recorded at an earlier moment, before later corrections; - a record’s history; - the changes feed, for exports to payroll or finance systems. The examples use the API. Every parameter has an MCP and a CLI equivalent: see [As-of parameters](https://docs.ligament.ai/developers/as-of/index.md). ## As of a date ```bash curl -s "https://app.ligament.ai/api/records/employee?asOf=2026-06-30&sort=name" \ -H "authorization: Bearer $LIGAMENT_API_KEY" ``` On a dated entity, `asOf` changes three things: - Dated fields show the value in force on that date. Fields that aren’t dated show today’s value. - Records that hadn’t started on that date, or whose first version was rescinded, are left out. - Filters, sorting, grouping, counts and sums use the values on that date. Access doesn’t change. Who may see a record, and which of its fields, is decided by today’s roles and today’s data, whatever date you read. Each record in the answer gains an `_effective` object that says which version of each group you’re looking at: ```json { "name": "Priya Raman", "salary": 88000, "pay_grade": "P4", "department": "Finance", "_effective": { "asOf": "2026-10-15", "groups": { "job": { "from": "2026-03-01", "to": null, "seq": 0, "versionId": "5754af2f-0291-4069-abea-b2803c8030c9", "kind": "create", "reason": "hire" }, "comp": { "from": "2026-09-01", "to": "2027-01-01", "seq": 0, "versionId": "a772b6fa-2bd9-46e7-9180-9277554179da", "kind": "correction", "reason": "Promotion salary keyed as 86,000; the offer letter says 88,000" } }, "current": ["name", "email"], "dated": true } } ``` `current` lists the fields shown at today’s value. `to: null` means the version has no end date yet. Asking for one record on a date before it started returns 404: ```json { "code": "effective_not_started", "message": "This employee didn't exist yet on 2026-02-01", "details": { "asOf": "2026-02-01" } } ``` On an entity that isn’t dated, `asOf` returns today’s values, and `_effective.dated` is `false`. ### What `asOf` accepts | Value | Means | | --- | --- | | `2026-06-30` | That date, from midnight in your workspace’s time zone. | | `@today` | Today in your workspace’s time zone. | | `@today-7d`, `@today+2w` | Days (`d`) or weeks (`w`) before or after today. Encode `+` as `%2B` in a URL. | | `@end_of_last_month` | The last day of the previous month. | | `@end_of_last_quarter`, `@end_of_last_year` | The last day of the previous quarter or year. | | `2026-08-31T23:30:00Z` | An instant, read as the date it falls on in your workspace’s time zone (in Bangkok, 1 September). | Anything else is refused with `effective_bad_as_of`. **Tip** A list without `asOf` shows the stored values of every record, including people whose start date is still ahead. Use `asOf=@today` to list only records that are in force today. ### Headcount and totals on a date Reports take `asOf` too. This counts active employees in three departments at the end of June: ```bash curl -s -X POST "https://app.ligament.ai/api/reports/run" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"spec":{"entityKey":"employee","metric":"count","groupBy":"department","viz":"bar","asOf":"2026-06-30", "filters":[{"field":"employment_status","op":"eq","value":"active"}, {"field":"department","op":"in","values":["Finance","Operations","Engineering"]}]}}' ``` ```json { "data": { "buckets": [ { "key": "Finance", "value": 2, "label": "Finance" }, { "key": "Operations", "value": 2, "label": "Operations" } ], "effective": { "asOf": "2026-06-30", "knownAt": null, "dated": true } } } ``` For a figure at several dates, use `series` instead of `asOf`. It evaluates the report at the end of each period (or the start, with `"at": "start"`), up to 120 points: ```json { "spec": { "entityKey": "employee", "metric": "count", "viz": "line", "filters": [{ "field": "employment_status", "op": "eq", "value": "active" }, { "field": "department", "op": "in", "values": ["Finance", "Operations", "Engineering"] }], "series": { "every": "month", "from": "2026-07", "to": "2027-01" } } } ``` ```json { "data": { "series": [ { "at": "2026-07-31", "value": 4 }, { "at": "2026-08-31", "value": 4 }, { "at": "2026-09-30", "value": 4 }, { "at": "2026-10-31", "value": 4 }, { "at": "2026-11-30", "value": 3 }, { "at": "2026-12-31", "value": 3 }, { "at": "2027-01-31", "value": 4 } ], "effective": { "asOf": null, "knownAt": null, "dated": true } } } ``` `every` is `day`, `week`, `month`, `quarter` or `year`. `from` and `to` take `YYYY`, `YYYY-MM` or a full date. Dates after today read scheduled changes, so the last point already counts a hire who starts on 4 January. ## As recorded at an earlier moment `asOf` reads the data as it is known now, corrections included. `knownAt` reads it as it was **recorded** at an earlier moment, before later corrections. Use it to explain a figure someone saw last week, or to reproduce an export exactly. Priya’s salary for October was recorded as 86,000 and corrected to 88,000 two seconds later. Reading October as recorded between the two writes: ```bash curl -s "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5?asOf=2026-10-15&knownAt=2026-12-02T15:38:01Z" \ -H "authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "record": { "name": "Priya Raman", "salary": 86000, "pay_grade": "P4", "_effective": { "asOf": "2026-10-15", "knownAt": "2026-12-02T15:38:01.000Z", "groups": { "comp": { "from": "2026-09-01", "to": "2027-01-01", "kind": "change", "reason": "promotion", "…": "…" } } } } } ``` `knownAt` takes an instant, or a date, which means “everything recorded by the end of that day” in your workspace’s time zone. You can combine it with `asOf` on records and lists. Reading as recorded is limited, because it shows values that were later corrected: - People need the `records.as_recorded` capability. Owners and admins have it; grant it to others through a [permission set](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md). - An API key may use it if it holds the `audit:read` scope. Anyone else gets 403 `effective_known_at_forbidden`. ## A record’s history `GET /api/records///history` lists a record’s versions, newest first, one group or all of them: ```bash curl -s "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5/history?group=comp" \ -H "authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "entity": "employee", "recordId": "cmx6ai0dx007r6x6stm9adjh5", "entries": [ { "group": "comp", "from": "2027-01-01", "to": null, "kind": "change", "reason": "merit", "status": "scheduled", "values": { "salary": 90000, "pay_grade": "P4" }, "recordedAt": "2026-12-02T15:38:00.168Z", "…": "…" }, { "group": "comp", "from": "2026-09-01", "to": "2027-01-01", "kind": "correction", "reason": "Promotion salary keyed as 86,000; the offer letter says 88,000", "status": "in_force", "values": { "salary": 88000, "pay_grade": "P4" }, "…": "…" }, { "group": "comp", "from": "2026-03-01", "to": "2026-09-01", "kind": "create", "reason": "hire", "status": "past", "values": { "salary": 84000, "pay_grade": "P3" }, "…": "…" } ], "proposed": null, "knownAt": null } ``` Each entry also carries `versionId` (what you name in a correction or rescind), `seq`, `retro`, `changeId`, `by` and `recordedAt`. | Status | Means | | --- | --- | | `scheduled` | Starts after today. | | `in_force` | Applies today. | | `past` | Ended before today. | | `same_day` | An earlier change of a day that was changed again the same day. | | `superseded` | Replaced by a correction, a rescind or a later rewrite. Only shown with `include=corrections`. | Add `include=corrections` to see superseded versions too, with `supersededAt` and `supersededBy`, or `knownAt` to see the history as it stood at a moment. Both need `records.as_recorded` or an `audit:read` key. The history follows field access: fields you can’t read are removed from every version, and a group whose fields you can’t read doesn’t appear at all. ## The changes feed for exports A payroll or finance export has to send every change since its last run, including corrections to periods it has already sent. The changes feed gives you exactly that: ```bash curl -s "https://app.ligament.ai/api/records/employee/changes?group=comp&recordedSince=2026-12-02T15:37:57Z&overlapsBefore=2026-12-01" \ -H "authorization: Bearer $LIGAMENT_API_KEY" ``` It lists every change **recorded** after `recordedSince` (new changes, corrections and rescinds), oldest first, on records you can read now. `overlapsBefore=2026-12-01` keeps only changes that touch a period before 1 December, the periods already paid. One of the two changes it returned: ```json { "changes": [ { "changeId": "8e34d954-4c1a-4ab8-9fb2-6e5891f7d52a", "mode": "change", "reason": "promotion", "…": "…" }, { "changeId": "b63d8809-b089-4864-b265-cae2b6f364ff", "recordId": "cmx6ai0dx007r6x6stm9adjh5", "group": "comp", "mode": "correction", "recordedAt": "2026-12-02T15:38:02.433Z", "reason": "Promotion salary keyed as 86,000; the offer letter says 88,000", "retro": false, "periods": [{ "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary"] }], "after": [{ "from": "2026-09-01", "to": "2027-01-01", "values": { "salary": 88000, "pay_grade": "P4" } }], "before": [{ "from": "2026-09-01", "to": "2027-01-01", "values": { "salary": 86000, "pay_grade": "P4" } }] } ], "nextCursor": null, "watermark": "2026-12-02T15:38:02.433Z" } ``` For each change, `periods` says which dates and fields changed: those are what your export re-sends. `after` holds the values now. `before` holds the values they replaced, for readers with `records.as_recorded` or an `audit:read` key (`null` for everyone else). To run an export on a schedule: 1. Keep the `watermark` of your last run. On the first run, use the moment you start exporting. 2. Call the feed with `recordedSince=`. Narrow it with `group`, `effectiveFrom` and `effectiveTo` (only changes whose periods overlap those dates), or `overlapsBefore`. 3. Follow `nextCursor` (pass it as `cursor`) until it’s `null`. Pages hold up to 100 changes by default, 500 with `limit`. 4. Store the new `watermark`. When nothing changed, the feed returns `"watermark": null`: keep the old one. --- # Locked periods > What happens when a change reaches into a period that is closed, such as a payroll month that has been paid. Source: https://docs.ligament.ai/guides/effective-dating/locked-periods/ A locked period protects dates that are already closed, for example months your payroll has paid. A lock applies to one group of one entity, through a date: “Pay is locked through 31 October”. Changes that would alter a value on or before that date are refused unless the person making them has the right to change the past. ## How locks are set Ligament sets locks up for you. To lock a group through a date, or to move a lock, email hello@ligament.ai with the entity, the group and the date. You can’t set or move a lock from the app or the API. A lock records the date it runs through, who or what set it, and why. These appear in the error people get when a change hits the lock. ## What a lock does to writes Ligament works out the earliest date whose values a write would change. That covers changes, corrections and rescinds, including later versions a change carries forward into. If that date is on or before the lock date: - Without the `effective.retro` capability, the write is refused and nothing is saved. - With `effective.retro` (owners and admins have it), the write needs a reason. It’s saved, and every version it writes is flagged `retro: true`. Writes that only change dates after the lock are not affected. A raise scheduled for next month goes through as usual. ### The error A refused write answers 422 with the code `effective_locked`: | Field | Contains | | --- | --- | | `code` | `effective_locked` | | `message` | ` is locked through `, followed by `(set by )` when the lock records who set it. | | `details` | `lockedThrough` (the date), `setBy` and `reason` as stored on the lock. | | `fix` | `Changing a locked period needs the effective.retro capability and a reason.` | If you have `effective.retro` but leave out the reason, you get `effective_reason_required` instead. ### How a retro change shows A change that went through a lock is easy to find afterwards: - In the record’s [history](https://docs.ligament.ai/guides/effective-dating/as-of/index.md#a-records-history), its versions have `"retro": true`. - In the [changes feed](https://docs.ligament.ai/guides/effective-dating/as-of/index.md#the-changes-feed-for-exports), the change has `"retro": true`, so an export can treat it as an adjustment to a closed period. ## Locks and the back-dating limit Each group also has a back-dating limit, such as 90 days for pay. The two work independently: | Compared | Back-dating limit | Locked period | | --- | --- | --- | | Measured from | Today, counting back a number of days | A fixed date | | Moves on its own | Yes, every day | No, only when the lock is moved | | Without `effective.retro` | `effective_backdate_needs_capability` | `effective_locked` | | With `effective.retro` | Allowed | Allowed, with a reason, flagged `retro` | Give `effective.retro` to the few people who correct closed periods, such as payroll administrators, through a [permission set](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md). --- # Worked example: a raise and a correction > Hire someone with a start date, schedule a raise, fix a back-dated mistake, and count heads on a date, with the API, CLI and MCP. Source: https://docs.ligament.ai/guides/effective-dating/hr-example/ This example follows one employee, Priya Raman, through a year of HR changes in a workspace whose time zone is Asia/Bangkok. Today is 2 December 2026. You’ll see: 1. a hire with a start date in the past; 2. a raise scheduled for next month; 3. a promotion recorded late, and the correction of a typo in it; 4. her history, a headcount on a date, and what a payroll export picks up. The `employee` entity is dated with two groups: `job` (`department`, `location`, `employment_status`) and `comp` (`salary`, `pay_grade`). Pay changes need an effective date and one of the reasons `hire`, `merit`, `promotion` or `market_adjustment`. See [Effective dating](https://docs.ligament.ai/guides/effective-dating/index.md) for how groups work. The calls use an API key in `$LIGAMENT_API_KEY` with the `records:read` and `records:write` scopes. The examples trim the responses to the parts that matter here. ## 1\. Hire with a start date Priya joined Finance on 1 March at 84,000, grade P3. Create her record with that start date: ```bash curl -s -X POST "https://app.ligament.ai/api/records/employee" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"name":"Priya Raman","email":"priya.raman@northwind.example","department":"Finance","location":"Bangkok", "employment_status":"active","salary":84000,"pay_grade":"P3"}, "effective":{"from":"2026-03-01","reason":"hire"}}' ``` ```json { "record": { "id": "cmx6ai0dx007r6x6stm9adjh5", "name": "Priya Raman", "salary": 84000, "pay_grade": "P3", "department": "Finance", "…": "…" }, "effective": [ { "group": "job", "mode": "change", "version": { "from": "2026-03-01", "to": "infinity", "seq": 0, "status": "in_force" }, "…": "…" }, { "group": "comp", "mode": "change", "version": { "from": "2026-03-01", "to": "infinity", "seq": 0, "status": "in_force" }, "…": "…" } ] } ``` Each group gets a first version from 1 March. Before that date Priya isn’t in any as-of list or headcount. ## 2\. A raise from next month Her merit raise to 90,000 takes effect on 1 January: ```bash curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":90000},"effective":{"from":"2027-01-01","reason":"merit"}}' ``` ```json { "record": { "name": "Priya Raman", "salary": 84000, "pay_grade": "P3", "…": "…" }, "effective": [ { "group": "comp", "mode": "change", "version": { "id": "a69587f4-91a8-4de5-bf38-d650137a66c1", "from": "2027-01-01", "to": "infinity", "seq": 0, "status": "scheduled" }, "warnings": [], "periods": [{ "from": "2027-01-01", "to": "infinity", "fields": ["salary"] }] } ] } ``` The raise is `scheduled`. Today her salary is still 84,000. From midnight on 1 January it’s 90,000, without anyone touching the record again. Only the salary changes, so this version keeps the grade she has on the day. ## 3\. A late promotion, then a correction HR now records that Priya was promoted to P4 on 1 September, at 86,000: ```bash curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":86000,"pay_grade":"P4"},"effective":{"from":"2026-09-01","reason":"promotion"}}' ``` ```json { "record": { "name": "Priya Raman", "salary": 86000, "pay_grade": "P4", "…": "…" }, "effective": [ { "group": "comp", "mode": "change", "version": { "id": "0839009b-afb9-4e47-b009-f78a2c578ab1", "from": "2026-09-01", "to": "2027-01-01", "seq": 0, "status": "in_force" }, "propagated": [{ "from": "2027-01-01", "fields": ["pay_grade"] }], "warnings": ["The change of 2027-01-01 now carries pay_grade from this one."], "past": true, "retroPeriod": ["2026-09-01", "2026-12-02"] } ] } ``` Two things happened: - Today’s values changed at once, because the promotion is in force today. - The scheduled January raise now carries grade P4, and the response says so. Its salary stays 90,000, because the raise set the salary itself. The promotion reaches back 92 days, past the 90 days the pay group allows. It went through because the key belongs to an owner, who holds `effective.retro`. A key of someone without it gets `effective_backdate_needs_capability`. Then payroll spots a typo: the offer letter says 88,000, not 86,000. The salary was never 86,000, so this is a correction, not a new change: ```bash curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":88000},"effective":{"from":"2026-09-01","mode":"correction","reason":"Promotion salary keyed as 86,000; the offer letter says 88,000"}}' ``` ```json { "record": { "name": "Priya Raman", "salary": 88000, "pay_grade": "P4", "…": "…" }, "effective": [ { "group": "comp", "mode": "correction", "version": { "id": "a772b6fa-2bd9-46e7-9180-9277554179da", "from": "2026-09-01", "to": "2027-01-01", "seq": 0, "status": "in_force" }, "warnings": [], "periods": [{ "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary"] }], "past": true } ] } ``` ## 4\. Check the result ### Her pay history, with the CLI ```bash ligament records history employee cmx6ai0dx007r6x6stm9adjh5 --group comp ``` ```text comp 2027-01-01 → ∞ scheduled change (merit) {"salary":90000,"pay_grade":"P4"} comp 2026-09-01 → 2027-01-01 in_force correction (Promotion salary keyed as 86,000; the offer letter says 88,000) {"salary":88000,"pay_grade":"P4"} comp 2026-03-01 → 2026-09-01 past create (hire) {"salary":84000,"pay_grade":"P3"} ``` The 86,000 that was corrected doesn’t show here. It’s still kept, and `--corrections` lists it as `superseded` for people with `records.as_recorded`. ### Her record on a date Reading 15 October returns the corrected figure. Adding `knownAt` with a moment between the promotion and the correction returns what was on file then: | Request | `salary` | `pay_grade` | | --- | --- | --- | | `GET /api/records/employee/cmx6ai0dx007r6x6stm9adjh5?asOf=2026-10-15` | 88000 | P4 | | `…?asOf=2026-10-15&knownAt=2026-12-02T15:38:01Z` | 86000 | P4 | | `…?asOf=2027-01-01` | 90000 | P4 | | `…?asOf=2026-02-01` | 404 `effective_not_started` | | ### Headcount on a date Count active employees by department at the end of June, and at the end of January (which already includes a hire who starts on 4 January): ```bash curl -s -X POST "https://app.ligament.ai/api/reports/run" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"spec":{"entityKey":"employee","metric":"count","groupBy":"department","viz":"bar","asOf":"2026-06-30", "filters":[{"field":"employment_status","op":"eq","value":"active"}, {"field":"department","op":"in","values":["Finance","Operations","Engineering"]}]}}' ``` | `asOf` | Finance | Operations | Engineering | | --- | --- | --- | --- | | `2026-06-30` | 2 | 2 | | | `@today` (2026-12-02) | 2 | 1 | | | `2027-01-31` | 2 | 1 | 1 | Operations drops to one in November because Sofia Marchetti’s termination took effect on 1 November (`employment_status` set to `terminated` from that date). Swap `"metric":"count"` for `"metric":"sum","metricField":"salary"` to total the pay bill on the date instead. At `2027-01-31` that gives Finance 181,000, Operations 72,000 and Engineering 78,000. An assistant connected over MCP can ask the same question with `records_query`: ```json { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "records_query", "arguments": { "entity": "employee", "asOf": "@end_of_last_quarter", "sort": "name", "filters": [{ "field": "department", "op": "in", "values": ["Finance", "Operations", "Engineering"] }] } } } ``` The tool returns the rows as of 30 September as text, four people with their September values: | name | department | salary | pay\_grade | `_effective.groups.comp.from` | | --- | --- | --- | --- | --- | | Mei Lin Chua | Finance | 91000 | P4 | 2026-01-05 | | Priya Raman | Finance | 88000 | P4 | 2026-09-01 | | Sofia Marchetti | Operations | 69000 | P2 | 2025-11-03 | | Tomás Ortega | Operations | 72000 | P2 | 2025-07-01 | ## 5\. What payroll picks up Payroll has already paid up to 30 November. Its export asks for pay changes recorded since its last run that touch those months: ```bash ligament records changes employee --since 2026-12-02T15:37:57Z --group comp --overlaps-before 2026-12-01 ``` It gets two changes, the promotion and the correction, each with the periods to re-pay. The correction’s entry: ```json { "mode": "correction", "reason": "Promotion salary keyed as 86,000; the offer letter says 88,000", "periods": [{ "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary"] }], "after": [{ "from": "2026-09-01", "to": "2027-01-01", "values": { "salary": 88000, "pay_grade": "P4" } }], "before": [{ "from": "2026-09-01", "to": "2027-01-01", "values": { "salary": 86000, "pay_grade": "P4" } }] } ``` Payroll owes Priya the difference for September, October and November, and stores the feed’s `watermark` for its next run. See [The changes feed for exports](https://docs.ligament.ai/guides/effective-dating/as-of/index.md#the-changes-feed-for-exports). --- # HR > Set up the HR app: employees with dated job and pay, reporting lines, leave with manager approval, the org chart, headcount on a date and the payroll export. Source: https://docs.ligament.ai/guides/hr/ The HR app keeps your employee records, their reporting lines, their pay and their leave. It is built on the same pieces as any other app in your workspace, so everything here also works through the API, MCP and CLI. \[Screenshot: HR home: headcount today and at the end of last month, leave waiting for approval, headcount by department and by employment type, and the list of leave waiting for approval\] ## What’s in the app | Area | What you get | | --- | --- | | Employees | Name, work email, login, manager, job title, position, department, location, employment type, FTE, status, start and end dates, pay, contact and personal details | | Positions and locations | The jobs and work locations employees point at. Departments come from the People app | | Dated history | Job, employment and pay changes take effect on a date, keep their history and can be corrected. See [Dated changes and corrections](https://docs.ligament.ai/guides/hr/dated-changes/index.md) | | Reporting lines | Each employee’s manager. Managers see the people below them, two levels down for approvals | | Leave | Leave types, yearly balances with monthly accrual, and requests that the employee’s manager approves. See [Leave and approvals](https://docs.ligament.ai/guides/hr/leave/index.md) | | Reports | The [org chart and headcount on a date](https://docs.ligament.ai/guides/hr/org-chart-and-headcount/index.md), and the [payroll export](https://docs.ligament.ai/guides/hr/payroll-export/index.md) | | My HR | Each employee’s own page: their record, balances and requests. See [Self-service](https://docs.ligament.ai/guides/hr/self-service/index.md) | ## Set it up 1. As an owner or workspace admin, open **App Store › HR** and select **Install**. HR needs the **People** app (departments live there): if your workspace doesn’t have it yet, the Store says so and installs People first when you confirm. HR seeds four leave types: Annual leave (15 days, accrues monthly), Sick leave (30), Personal leave (3) and Unpaid leave. See [The App Store](https://docs.ligament.ai/guides/workspaces/app-store/index.md). 2. Nothing else to apply: HR ships its access model (permission sets, roles and restrictions) in the app, and the install creates it. Its spec store addresses start with `hr/`, for example `hr/role/hr_admin`. See [Access in the manifest](https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/index.md). 3. In **Settings › Access › Assignments**, give your HR team the **HR admin** role, anyone who only needs to look the **HR viewer** role, and everyone else **HR employee**. 4. Add your locations and positions, then your employees. Enter each hire with their start date, so their history starts on the right day. Link each employee record to the person’s login in the **Login** field: My HR, self-service and the manager’s view all follow that link. 5. Fill in each employee’s **Manager**. That reporting line is what makes someone a manager. There is no separate manager role to assign. An HR admin is also an [administrator of the HR app](https://docs.ligament.ai/guides/access/app-admins/index.md): they can change the HR permission sets, roles and restrictions under **Access: HR** without being a workspace admin. They can’t grant anything outside the HR app. ## Roles and what each one sees | | HR admin | HR viewer | Manager | Employee | Workspace admin and owner | | --- | --- | --- | --- | --- | --- | | Directory fields (name, job, department, manager, location, work email, phone) | everyone, edit | everyone | everyone | everyone | everyone | | Salary, currency, pay frequency | clear, edit | salary masked, can reveal with a reason | everyone below them (direct reports, their reports, and so on) in clear, with the pay history; nobody else’s | their own, read only | masked; in clear on their own record and below them in the reporting line, read only | | Home address, personal email, date of birth, emergency contact | edit | read | hidden | their own, edit their contact details | read | | Leave requests | all, edit | all | their reports’ (dates, type, days) | their own | all | | Leave reason and medical note | read and edit | on their own requests only | on their own requests only | on their own requests: they enter them, and can edit them until the request is decided | on their own requests only | | Decide leave | yes, not their own | no | their reports, up to two levels, not their own | no | as an admin, not their own | | Payroll export | yes | no | no | no | yes, without pay amounts | A masked salary shows as `•••••` with a **Masked** badge. An HR viewer can click **Reveal**, give a reason, and see the figure; every reveal is written to the access audit with the reason. Managers, workspace admins and owners can’t reveal. ### Pay is for HR, the employee and the managers above them Pay is covered by a restriction that also applies to workspace admins and owners: salary is masked for everyone except people who hold HR’s pay capability (`hr.comp`, the HR admin role), the employee on their own record, and everyone above the employee in the reporting line: their manager, their manager’s manager, and so on up. A second restriction keeps pay read-only for everyone without `hr.comp`, so nobody but HR changes pay, their own included. The rule is about the reporting line, not the seat: an owner or IT admin who manages people reads the pay of everyone below them like any other manager. An owner who is also the CEO, at the top of the line, reads everyone’s pay. Nobody reads their own manager’s pay, or the pay of a team next to theirs. **When the reporting line changes**, access follows it straight away. Move someone to another manager and the new manager, and everyone above them, read the person’s pay and its whole history, including the versions from before they became manager. The old manager, and anyone above them who isn’t above the new one, no longer do. That’s the usual HR model. The reporting line isn’t dated yet, so the switch happens when HR saves the change, not on a future date, and an “as of” read uses today’s reporting line. A reporting line can’t loop: saving a manager who reports to the person is refused. To give managers the pay of their **direct reports only**, add `"depth": { "max": 1 }` to the reporting-line condition of the `hr.manager` pay grant and of the `hr.pay_hr_only` restriction (see [Hierarchies](https://docs.ligament.ai/guides/access/hierarchies/index.md)). ### The leave reason and medical note are for the employee and HR A restriction that also applies to workspace admins and owners hides the reason and the medical note from everyone except people with the `hr.medical` capability (the HR admin role) and the employee on their own requests. The employee enters both when they request leave and can change them until the request is approved, rejected or cancelled. Their manager, HR viewers, workspace admins and owners don’t see them. Both rules are restrictions with an **Except on rows where** condition. See [Restrictions](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md#restrictions) and the [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md). \[Screenshot: A manager's view of an employee: job, employment and pay sections, with the salary masked\] To check what someone can see and why, see [Why can I see this?](https://docs.ligament.ai/guides/access/why-can-i-see-this/index.md). --- # Leave and approvals > Leave types, balances and accrual, how an employee requests leave, how the manager approves it, and who sees the reason and medical note. Source: https://docs.ligament.ai/guides/hr/leave/ ## Leave types and balances Each **leave type** has a number of days per year and an accrual: `monthly` (a twelfth of the allowance each month) or `upfront` (the whole allowance on 1 January). The app installs with: | Leave type | Days per year | Accrual | Medical note expected | Paid | | --- | --- | --- | --- | --- | | Annual leave | 15 | monthly | no | yes | | Sick leave | 30 | upfront | yes | yes | | Personal leave | 3 | upfront | no | yes | | Unpaid leave | 0 | upfront | no | no | Change them, or add your own, in **HR › Leave types**. A **leave balance** is one employee’s allowance of one leave type for one year. HR creates the balances for the year; the name, the employee’s login and the accrual are filled in from the employee and the leave type. The balance shows: - **Accrued**: days per year × months accrued ÷ 12; - **Carried over**: days brought from last year, entered by HR; - **Taken**: the working days of the employee’s approved requests against this balance; - **Available**: accrued + carried over − taken. On the 1st of each month the **Monthly leave accrual** pipeline sets the months accrued on this year’s monthly balances. Upfront balances are accrued in full. ## Request leave An employee requests leave from **My HR › Request leave**: they pick the leave type and the first and last day, and save. The request starts as a **Draft**. Saving fills in the employee (from the login), the number of working days (Monday to Friday) and the balance it counts against. **Submit for approval** sends it to the employee’s manager. The state becomes **Waiting for approval** and an approval request appears in the manager’s **Approvals**, and in their manager’s, so someone can decide while the manager is away. The approval shows the request number, the dates and the number of days, never the reason. The employee can withdraw a request while it waits, and cancel approved leave. Cancelling gives the days back to the balance. ## Approve or reject The manager opens the approval from **Approvals** (or the notification) and approves or rejects it, with a note if they like. They can also [approve or reject from the message](https://docs.ligament.ai/guides/notifications/index.md#approve-or-reject-from-a-message) in email, Slack, Teams or browser push. The same rules apply as in the app, and the message shows only what the approver may see there: a manager never gets the medical note. The decision moves the request to **Approved** or **Rejected** and records who decided and when. Approved days count against the balance straight away. A request nobody decides within 14 days is rejected. \[Screenshot: A manager's view of a sick leave request: the dates, type and working days, the decision, and no reason or medical note\] A few rules keep this honest: - Nobody approves or rejects their own leave, or a request they filed for someone else. This applies to workspace admins and owners too. A manager who tries gets `403` with *You can’t approve or reject your own leave.* - Employees, managers and HR viewers approve or reject a request only through its approval. Moving it to Approved by hand is refused with *Leave is approved or rejected through the approval request sent to the manager.* HR admins can still move a request when they need to, but never their own. - Managers decide for the people up to two levels below them, and only for them. ## The reason and the medical note The **Reason (you and HR only)** section of a request holds the reason and the medical note. The employee enters them when they request leave, reads them back, and can change them while the request is a draft or waiting for approval. Once it’s approved, rejected or cancelled the request is locked. People with the `hr.medical` capability (the HR admin role) see and edit them on every request. Managers, HR viewers, workspace admins and owners don’t see them on anyone else’s request: not on the page, in lists, in exports, in search or in the history, and a filter on them matches nothing. Someone filing leave on another person’s behalf can’t fill them in: the request is refused with *Leave reasons and medical notes are for the employee and HR only.* \[Screenshot: HR's view of the same request, showing the reason and the medical note\] See [Separation of duties](https://docs.ligament.ai/guides/access/separation-of-duties/index.md) and [Data classification](https://docs.ligament.ai/guides/access/data-classification/index.md) for how these rules are set up. --- # Dated changes and corrections > Hire with a start date, schedule a raise or a transfer, correct a mistake, and read an employee as they were on a date. Source: https://docs.ligament.ai/guides/hr/dated-changes/ An employee’s record keeps three dated groups of fields: | Group | Fields | Reasons | Back-dating | | --- | --- | --- | --- | | Job | job title, position, department, location, employment type, FTE | hire, transfer, promotion, reorganisation | up to 31 days | | Employment | status, start date, end date | hire, leave of absence, return, termination | up to 31 days | | Pay | salary, currency, pay frequency | hire, merit, promotion, market adjustment (required) | up to 90 days | A change to one of these fields takes effect on the date you give, not when you save it. The record shows the values in force today; the history keeps every version with its dates and reason. Name, contact details and the manager are not dated: a change applies straight away. [Effective dating](https://docs.ligament.ai/guides/effective-dating/index.md) explains the model in full. This page covers what HR does with it day to day. ## A hire Create the employee with their start date as the effective date and `hire` as the reason. In the API: ```json { "values": { "name": "Ines Duarte", "job_title": "Software Engineer", "employment_status": "active", "start_date": "2026-11-17", "salary": 5700, "currency": "EUR", "pay_frequency": "monthly", "…": "…" }, "effective": { "from": "2026-11-17", "reason": "hire" } } ``` Ines counts in headcount from 17 November, and the November payroll export lists her as a joiner. ## A raise or a promotion Edit the pay fields and choose **Takes effect on** and a reason. A pay change without a reason is refused: ```json { "error": "Pay changes need a reason (hire, merit, promotion, market_adjustment)", "code": "effective_reason_required" } ``` A raise for next month is saved now and applies on the day. Until then the record shows the current salary and the history shows the raise as scheduled. ## A future-dated transfer A transfer works the same way on the Job group. In a workspace with example data, Yuki Sato moves to a new department on 1 January 2027. Today her record shows her current department; read the employee list as of 2 January 2027 (`?asOf=2027-01-02`) and she is in the new one. ## Corrections When a value was keyed wrong, correct the version instead of adding a change. Lucas Ferreira’s promotion salary on 1 November was typed as 125,500; his offer letter says 152,000. HR corrects the 1 November version with a reason: ```json { "values": { "salary": 152000 }, "effective": { "from": "2026-11-01", "mode": "correction", "reason": "Promotion salary keyed as 125,500; the offer letter says 152,000" } } ``` Reports for November now show 152,000, the history marks the fix, and the correction appears in the payroll export with its reason. If a change should never have been made, rescind it: the version before it runs on. Back-dating further than the limits above needs the `effective.retro` capability. The HR admin role has it. ## Who sees the history The history follows the same rules as the record, decided for each employee. HR admins see every version with the amounts. A manager sees the pay history of everyone below them in the reporting line with the amounts, and nobody else’s. An employee sees their own. Workspace admins and owners without `hr.comp` see their own, and that of anyone below them in the reporting line. See [Changes, corrections and rescinds](https://docs.ligament.ai/guides/effective-dating/changes-and-corrections/index.md) and [As-of reads](https://docs.ligament.ai/guides/effective-dating/as-of/index.md) for the details and the API. --- # Org chart and headcount > The current reporting lines as a tree, and headcount on today, at the end of last month, quarter and year, or any date. Source: https://docs.ligament.ai/guides/hr/org-chart-and-headcount/ ## Org chart **HR › Org chart** shows the current reporting lines as a tree, starting from the people with no manager. Each person shows their job title, department and location, how many direct reports they have and how many people sit below them in total. The first two levels are open; click a row’s triangle to open or close the level below. \[Screenshot: The org chart: the CEO with 6 direct reports and 57 people in total, the heads of Engineering, Sales and Operations, and their managers\] Everyone sees the part of the organisation their access allows, read as them: the chart never shows a person, or a field, that the viewer couldn’t open as a record. Leavers are left out. The chart shows today’s reporting lines. The manager isn’t dated, so the chart can’t show the organisation as it was on an earlier date yet. You can add an org chart to any page in the page builder: the **Org chart** block draws a tree along any reference from an entity to itself, such as `manager` on employees or `parent` on departments. ## Headcount **HR › Headcount** counts active employees today and at the end of last month, last quarter and last year, by department and by location. The counts read the dated job and employment history, so a person who joined on 17 November counts from that day, and a person who left on 29 November counts up to the 28th. \[Screenshot: The headcount page: 58 today and at the end of last month, quarter and year, with tables by department for today, the end of last month and the end of last year\] For any other date, open **Employees** and add `asOf` to the address, for example `/r/hr_employee?asOf=2026-06-30&group=department`: the list shows everyone as they were on 30 June 2026, grouped by department with a count per group. The API takes the same parameter: ```bash curl -s "https://app.ligament.ai/api/records/hr_employee?asOf=2026-11-28&filters=%5B%7B%22field%22%3A%22employment_status%22%2C%22op%22%3A%22ne%22%2C%22value%22%3A%22terminated%22%7D%5D&limit=1" \ -H "authorization: Bearer ***" ``` In a workspace with example data this returns `"total": 59` on 28 November and 58 today: Mark Sullivan left on 29 November. Page blocks take the same dates: a metric, chart or list block’s **As of** setting accepts a date or `@today`, `@end_of_last_month`, `@end_of_last_quarter` and `@end_of_last_year`. See [As-of reads](https://docs.ligament.ai/guides/effective-dating/as-of/index.md). --- # Payroll export > Download the joiners, leavers, job and pay changes that take effect in a month as a CSV for payroll. Source: https://docs.ligament.ai/guides/hr/payroll-export/ **HR › Payroll export** downloads a CSV of everything that takes effect in a month: joiners, leavers, and job, employment and pay changes, including corrections. It’s for HR admins: the page and the download need the export permission on employees. \[Screenshot: The payroll export page: buttons to download last month, this month so far and pay changes only, and the list of leavers\] There’s one row per changed field. Here is November 2026 in a workspace with [example data](https://docs.ligament.ai/guides/demo/index.md), trimmed: ```csv record_id,record,effective_date,event,group,reason,field,field_label,before,after,kind,retro,recorded_at cmx6o4f1k00f4lp9xt1rfyvll,Lucas Ferreira,2026-11-01,change,job,promotion,job_title,Job title,Engineering Manager,Senior Engineering Manager,change,false,2026-12-02T21:59:25.661Z cmx6o4f1k00f4lp9xt1rfyvll,Lucas Ferreira,2026-11-01,change,pay,"Promotion salary keyed as 125,500; the offer letter says 152,000",salary,Salary,125000,152000,correction,false,2026-12-02T21:59:25.829Z cmx6o4jgt00iplp9xrqdfm510,Wei Zhang,2026-11-01,change,pay,market_adjustment,salary,Salary,64000,70000,change,false,2026-12-02T21:59:25.288Z cmx6o4igq00hylp9xm7ebvkmi,Felix Braun,2026-11-15,change,employment,leave_of_absence,employment_status,Status,active,on_leave,change,false,2026-12-02T21:59:26.313Z cmx6o4grh00gglp9x21ova3rt,Ines Duarte,2026-11-17,start,employment,hire,employment_status,Status,,active,create,false,2026-12-02T21:59:03.394Z ``` | Column | Meaning | | --- | --- | | `effective_date` | The day the change takes effect | | `event` | `start` for a joiner (the record’s first version), `change` for anything later | | `group`, `reason` | The dated group (`job`, `employment`, `pay`) and the reason given; for a correction, its reason text | | `field`, `before`, `after` | The field and its value before and after | | `kind` | `create`, `change` or `correction` | | `retro`, `recorded_at` | Whether the change was back-dated, and when it was recorded | A leaver is a `change` row on `employment_status` to `terminated`, with the end date. The buttons on the page download last month, this month so far, or last month’s pay changes only. For any month, or any range, call the API: ```bash curl -s "https://app.ligament.ai/api/records/hr_employee/effective-events?period=2026-11&format=csv" -H "authorization: Bearer ***" curl -s "https://app.ligament.ai/api/records/hr_employee/effective-events?from=2026-11-01&to=2026-11-15&group=pay&format=csv" -H "authorization: Bearer ***" ``` `period` is a month (`2026-11`), `@this_month` or `@last_month`. `group` and `reason` filter the rows; leave out `format=csv` for JSON. Without the export permission on employees the call returns `403`. A change recorded after you exported a month, but taking effect inside it (a late correction, say), isn’t in the next month’s file. Find those in the record’s history, or in the changes feed (`/api/records/hr_employee/changes?recordedSince=…`), and see [Locked periods](https://docs.ligament.ai/guides/effective-dating/locked-periods/index.md) to stop changes reaching back into a month that’s been paid. --- # Self-service > What employees see and change in My HR, and what managers see of their team. Source: https://docs.ligament.ai/guides/hr/self-service/ ## My HR Every employee has **HR › My HR**: their own record, their leave balances and their leave requests, with a **Request leave** button. It works once HR has linked their employee record to their login. \[Screenshot: My HR for Mei Lin: her record, her annual, sick and personal leave balances for 2026, and her leave requests in each state\] On their own record an employee can: - see their job, employment and pay, including their salary and its history; - change their phone, preferred name, personal email, home address and emergency contact. They can’t change their job, pay, manager or dates: those are HR’s, and the save is refused with `403`. On a colleague’s record they see the directory fields (name, job title, department, manager, location, work email and phone) and nothing about pay or personal details. They don’t see colleagues’ leave, on its own or in the related lists of the colleague’s record. ## Managers A manager is anyone with people below them in the reporting line. Nothing needs assigning: when HR sets someone’s manager, that manager sees them. On their reports’ records (all levels below them) a manager sees the job, employment and contact fields. They also see the salary, currency and pay frequency of everyone below them (direct reports, their reports, and so on) in clear, with the pay history, as of any date. They don’t see their own manager’s pay or a neighbouring team’s. They see their reports’ leave requests and balances, and decide their leave requests up to two levels down. See [Leave and approvals](https://docs.ligament.ai/guides/hr/leave/index.md). \[Screenshot: A manager's view of a report's record: job, employment and pay, with the salary masked\] ## Notes - Changes an employee makes to their own contact details aren’t dated: they apply straight away and show in the record’s activity. - The reason and the medical note on a leave request are for the employee and HR only. The employee enters them on their own request and can change them until it’s decided. - When the reporting line changes, access follows it straight away: the new manager and everyone above them see the person’s pay and its whole history, including the versions from before they became manager; the old manager no longer does. The reporting line itself isn’t dated, so this happens when HR saves the new manager, not on a future date. --- # Get started with Compliance in 15 minutes > From install to the first evidence pack: name your contacts, install a template set, edit and publish the Code of Conduct, assign it to everyone, see what people get, publish the concerns form and download the evidence. Source: https://docs.ligament.ai/guides/compliance/get-started/ This walkthrough takes a workspace from no Compliance at all to a published Code of Conduct that everyone has to read and confirm, a public form for raising concerns, and an evidence pack you can send to an investor or an auditor. The screenshots come from an example workspace called Sample Ventures. You need to be a workspace owner or admin. Everything you install is a draft until you publish or activate it, so nobody gets anything until step 6. ## 1\. Install the app Open **App Store › Compliance** and select **Install**. Compliance uses the People directory to know who works for you, so if People isn’t installed yet, the app installs it too. \[Screenshot: The Install Compliance dialog: Compliance needs People, which this workspace doesn't have yet, with the button Install People and Compliance\] A **Compliance** section appears in the sidebar. ## 2\. Name the people in charge Open **Compliance › Settings** and select **Edit settings**. Under **Contacts**, pick: | Contact | What they do | | --- | --- | | **Compliance owner** | Hears about overdue items after the manager does, and gets the digest | | **Concerns Contact** | Receives and handles concerns. Only they and the Backup Contact can read them | | **Backup Contact** | Handles concerns too, and is the only one who sees a concern about the Concerns Contact | | **Security Contact** | Receives security incident reports | \[Screenshot: Compliance settings with the four contacts filled in: Concerns Contact Sofia Marin, Backup Contact Amara Nwosu, Security Contact Tom Becker, Compliance owner Daniel Okoye\] The app gives these people the roles they need. The reminder defaults (7 days before the due date, then every 7 days; the manager after 3 days overdue, the compliance owner after 10) are on the same page if you want to change them. ## 3\. Install a template set Open **Compliance › Templates**. Each card lists exactly what it creates. For a first programme, **ESG and Safeguarding (investor starter)** is a good fit: the Code of Conduct, an Anti-Bribery and Corruption Policy and a Safeguarding, Harassment and Grievance Policy, each with a “read and sign” obligation, plus website text for the concerns channel and two items on the governance calendar. \[Screenshot: The Templates page: cards for Policy attestation (annual), New joiner policy pack, ABC training with a quiz, Gifts and hospitality, Conflicts of interest, Board governance calendar, and the two sets ESG and Safeguarding and Security and Risk\] Select **Install** on the card. The documents arrive with a draft version 1.0 and the obligations arrive in draft. The policy texts are samples marked **SAMPLE**: replace them with your own before you publish. ## 4\. Edit the Code of Conduct Open **Compliance › Documents** and select **Code of Conduct (SAMPLE)**. Rename it (select the title), then open its version 1.0 under **Related records › Document version**. On the version, select the **Text** field to edit it. It’s Markdown, with a **Preview** tab. Remove the SAMPLE note, write your own code, and fill in **What changed**. Changes save when you click away. \[Screenshot: A draft version of the Code of Conduct in the editor: the Text field open with Write and Preview tabs, What changed, and Submit for approval at the top\] ## 5\. Approve and publish On the version, select **Submit for approval**. From then on the version is frozen: it can’t be edited, so what gets approved is what people will read. Its **sha256** (a fingerprint of the text, or of the file for a PDF or Word version) is taken at that moment, and every confirmation records it. The approval goes to the document’s **Approver**. A document from a template set has none, so it goes to the **Compliance owner** from step 2 (here that’s you). They get an email and an entry in **Approvals**. There they select the request (its **Record** link opens the version to read), then **Approve**, or **Reject** to send the version back to draft. Nobody can approve a version from the version itself: the decision in Approvals is what records who approved it and when. If the document has no Approver and there’s no Compliance owner either, the version goes back to draft and a notification says why. \[Screenshot: Approvals: the request Approve Code of Conduct v1.0 selected, with its record, workflow, who it's assigned to, an optional note, and the Approve and Reject buttons\] A few seconds after the approval the version shows **Approved**. Select **Publish** on it. The document now has version 1.0 as its current version, with its sha256 and effective date, and is **Published**. \[Screenshot: The published version: the status bar with Draft, In approval and Approved done and Published current, and under Approval and fingerprint who approved it and when, its sha256 and when it was published\] People always confirm a specific version. When you publish a new version later and mark it a **material change**, everyone who confirmed the old one is asked to confirm again. ## 6\. Assign it to everyone Open **Compliance › Obligations**, select the **All** tab and open **Code of Conduct: read and sign**. It’s already set up for everyone: confirm by ticking and typing their name, due 30 days after it’s assigned, and new joiners within 30 days of starting. \[Screenshot: The obligation Code of Conduct: read and sign in Draft, with Activate at the top, Preview who this assigns to, and the What, Evidence, Audience and Recurrence sections\] 1. Select **Preview who this assigns to**. You get the list of people it will reach today and why each one is included or left out. Nothing is assigned yet. 2. Back on the obligation, select **Activate**. 3. Open the preview again and select **Assign now** (or let the daily run do it overnight). \[Screenshot: Who this assigns to: 7 of 7 people, each with Assigned Yes because of Everyone, the next due date, and Assign now with the result 7 assigned\] To narrow the audience instead, turn **Everyone** off and pick departments, job titles, locations, access groups, roles or named people before you activate it. ## 7\. What people see Everyone assigned gets a notification and finds the item under **Compliance › My compliance**, with reminders before the due date, on it, and after. \[Screenshot: My compliance for Mei Lin: To do lists Code of Conduct: read and sign, due 4 Jan 2027, version 1.0; Done and My evidence and certificates are empty\] Opening it shows the document, then one confirmation at the end. Only the person can complete it, signed in, in the browser. \[Screenshot: The Code of Conduct on the assignment page, then the Confirm box: the ticked statement I have read and understood Code of Conduct (version 1.0), the typed full name, and Confirm\] Each confirmation becomes an evidence record (who, which version and its fingerprint, when, from where) that nobody can edit afterwards. See [Evidence methods](https://docs.ligament.ai/guides/compliance/evidence-methods/index.md) for the other ways people can confirm, such as a signature or a quiz. ## 8\. Put the concerns form on your website In **Compliance › Settings**, under **Public reporting channel**, select **Publish the channel**. It needs the Concerns and Backup Contacts from step 2. \[Screenshot: Public reporting channel: Live at /public/speak-up, with a status check at /public/speak-up/status, and the buttons Republish and Take it down\] The page shows the form’s address, a path such as `/public/speak-up` on `https://app.ligament.ai`. Link to it from your website, your staff handbook and your contracts. The template set’s **Raising a concern: website text** document has a paragraph you can adapt for that page. \[Screenshot: The public form Sample Ventures: raise a concern, with what it is about, what happened, optional details, the child and Concerns Contact boxes, the option to stay anonymous, and optional name, email and phone\] Anyone can report, with their name or anonymously, and follow up later with the reference and passphrase they’re given. More in [Setting up a concerns channel](https://docs.ligament.ai/guides/compliance/speak-up/index.md). ## 9\. Download the evidence pack Open **Compliance › Evidence packs**. Choose a requirement source or one obligation, and the period, then select **Download the pack**. \[Screenshot: Evidence packs: All sources, the obligation Code of Conduct: read and sign, from 1 December to 31 December 2026, and Download the pack\] You get a ZIP with an index PDF, an Excel register of every assignment and completion, a summary (policies with the share of people who confirmed them, your contacts, the reporting channel, concern counts but never their content), the document versions and any signed certificates, and a `SHA256SUMS` file so anyone can check nothing was changed (`sha256sum -c SHA256SUMS`). The [controls and evidence packs](https://docs.ligament.ai/guides/compliance/controls-and-packs/index.md) page lists every file. ## Next steps - Publish the other two policies in the set and activate their obligations the same way. - Add a **source** (an investor, a customer contract, a law) to group obligations and build a pack per source: see [Compliance](https://docs.ligament.ai/guides/compliance/index.md). - Have signatures sealed into a PDF certificate instead of a tick and a name: see [E-signatures](https://docs.ligament.ai/guides/e-signatures/index.md). --- # Compliance > Set up the Compliance app: controlled documents, obligations people attest to, sign or train for, reminders, evidence, the governance calendar, risks, controls and evidence packs. Source: https://docs.ligament.ai/guides/compliance/ The Compliance app keeps your policies and the evidence that people have read, signed or been trained on them. It also runs your governance calendar, a light risk register, security incident reports and a confidential speak-up channel. It is built on the same pieces as any other app in your workspace (records, views, pages, workflows, access rules), so its data also works through the API, MCP and CLI. ## What’s in the app | Area | What you get | | --- | --- | | Requirement sources | Where an obligation comes from: a funder, a customer contract, a law, your own policy | | Controlled documents | Policies and codes with versions. A version is drafted, approved and published; people attest to a specific version | | Obligations | What people must do: attest, sign, complete training (with an optional quiz), make a declaration, upload evidence. Each has an audience, a due rule and a recurrence | | Assignments | One per person per obligation and period, created and kept up to date by the app: new joiners, leavers, new versions, exemptions | | Evidence | A record per completion (see [Evidence methods](https://docs.ligament.ai/guides/compliance/evidence-methods/index.md)), written once by the system: who, which version and its hash, how, when (UTC and local), from where, quiz score, watched %. Signatures get a sealed PDF certificate | | Governance | Board, audit and review tasks on a calendar, each closed with its evidence file | | Risks, incidents | A light risk register (likelihood × impact, before and after controls) and security incident reports | | Concerns | A speak-up channel with an anonymous public form. See [Setting up a concerns channel](https://docs.ligament.ai/guides/compliance/speak-up/index.md) | | Controls, packs | Your own controls with evidence rolled up per period, and evidence packs. See [Controls and evidence packs](https://docs.ligament.ai/guides/compliance/controls-and-packs/index.md) | ## Set it up New to the app? [Get started with Compliance in 15 minutes](https://docs.ligament.ai/guides/compliance/get-started/index.md) walks through these steps with screenshots. 1. As an owner or workspace admin, open **App Store › Compliance** and select **Install**. 2. Open **Compliance › Settings**. Name the **compliance owner**, the **Concerns Contact** and **Backup Contact**, and the **Security Contact**. Set when reminders start and repeat, and how many days overdue before the manager, then the compliance owner, is told. 3. Optionally open **Compliance › Templates** and install a starting set. Templates arrive as drafts: nothing is assigned until you publish a document version and activate an obligation. The sample anti-bribery policy is marked **SAMPLE**: rewrite it before you use it. 4. Add a **source**, a **document** and its first **version**, then select **Submit for approval** on the version. The document’s **Approver** (or the compliance owner, when it has none) decides in **Approvals**. Once it’s approved, select **Publish**: it becomes the document’s current version. 5. Create an **obligation**: what (the document or course), how (the evidence method), who (the audience), and when (due rule and recurrence). Select **Preview who this assigns to** to check the audience, then activate it. ## What people do Everyone with an obligation sees it under **My compliance** and gets a reminder before the due date, on it, and after. Opening an assignment shows the document (or video and quiz), then one confirmation at the end: tick, tick and type their name, sign (type or draw), or upload a signed copy. Only the person can complete their own assignment, signed in, in the browser. Nobody can complete it on their behalf, and no API key, MCP tool or automation can. People outside your workspace (a non-executive director, a contractor) get a signed link by email instead. The link works once, for that email address, for 14 days by default. ## Evidence Evidence records can’t be edited or deleted. If something was recorded wrongly, an admin records a **correction**: a new record that points to the original, with a reason. Packs and roll-ups use the correction and keep the original. A signed PDF carries a certificate page (signer, time, document hash, the audit trail, and a link and QR code to `/verify/`) and a digital seal with a trusted timestamp: see [E-signatures](https://docs.ligament.ai/guides/e-signatures/index.md). Anyone with a copy can check it there; the file is hashed in their browser and never uploaded. The signed copy is saved on the assignment. ## Roles | Role | Gets | | --- | --- | | Compliance: employee | Their own assignments and evidence. Given automatically to everyone in the directory | | Compliance: auditor | Reads all evidence, packs and the dashboard; changes nothing | | Compliance: admin | Runs the programme: documents, obligations, campaigns, controls, settings | | Compliance: concern handler | The concerns they are a viewer of. Given automatically to the Concerns and Backup Contacts | | Compliance: security contact | Security incidents. Given automatically to the Security Contact | Managers see the assignments of the people who report to them. Signature images, IP addresses and quiz answers are hidden unless you hold the auditor or admin role, workspace admins included. ## API, MCP and CLI - `GET /api/compliance/me` lists the caller’s own assignments. Completing one is browser-only. - MCP: `compliance_my_obligations`, `compliance_preview_audience`, `compliance_sync`, `compliance_summary`. - CLI: `ligament compliance mine | preview | sync | pack --from --to [--by-control]`. --- # Evidence methods and what each proves > The ways a person can complete an obligation, what the evidence record holds for each, and what it does and does not prove. Source: https://docs.ligament.ai/guides/compliance/evidence-methods/ Each obligation has one **evidence method**. Choose the lightest one your requirement source accepts: many funders and customers accept an acknowledgement (“a quick e-signature, or even an email reply”), and the template default is **tick and type full name**. Every method writes the same evidence record, once, as the system: the person, the obligation, the document version and its sha256 hash, the method, the time (UTC and your workspace’s time zone), the IP address and browser, the sign-in session, and whether the person’s account has two-factor authentication. Nobody can edit or delete it; a mistake is fixed with a correction record that points to it. | Method | What the person does | What the record adds | What it shows | | --- | --- | --- | --- | | Tick | Ticks “I have read and agree” | The statement they agreed to | This signed-in person confirmed they read this exact version | | Tick and type full name | Ticks and types their full name | The typed name | As above, with a deliberate act naming themselves. The default for policies | | Signature | Types or draws a signature | The signature image, a sealed PDF with a certificate page and the audit trail ([E-signatures](https://docs.ligament.ai/guides/e-signatures/index.md)) | A simple electronic signature on this exact document. The PDF carries a digital seal and a trusted timestamp; anyone can check it on the verify page or in a PDF reader | | Upload signed copy | Uploads a wet-signed or e-signed copy | The file and its hash; a reviewer accepts or rejects it | The copy was received and checked by a named reviewer | | External e-sign | Signs through an e-signature provider | (Not available yet: the method is reserved for a provider integration) | n/a | | Quiz | Passes the course quiz | The score, the attempt, the watched % of each video | The person passed the questions they were given. Answers are visible only to auditors and admins | | Declaration | Answers the declaration’s questions (gifts, conflicts of interest, nil return) | The answers | What the person declared, and when | | Upload evidence | Uploads a certificate or report (e.g. from an external training or phishing-test provider) | The file and its hash; a reviewer accepts or rejects it | The file was provided and a named reviewer accepted it | An obligation can also require a **reviewer** (someone checks each completion) and a **countersignature** by the manager or the compliance owner. ## Is an electronic signature legally enough? This page is not legal advice. Whether a tick, a typed name or a simple electronic signature is legally sufficient depends on the jurisdiction and on what the counterparty accepts. Many jurisdictions accept electronic signatures for most commercial documents with some exclusions: for example, Singapore’s Electronic Transactions Act accepts them for most commercial documents but excludes some (such as wills and certain property documents). If a requirement source asks for a particular form of signature, use the method that matches it, or ask them. What the app does guarantee is the record: who, which version (by hash), when, how and from where, written once and never changed. --- # Setting up a concerns channel > A confidential channel for concerns: an anonymous public form, a reference and passphrase to follow up, and handling that the owner and admins cannot read. Source: https://docs.ligament.ai/guides/compliance/speak-up/ The speak-up channel takes concerns (harassment, discrimination, safeguarding, bribery, fraud, complaints from customers, partners or the community) from staff and from anyone outside the company. ## Publish it 1. In **Compliance › Settings**, name a **Concerns Contact** and a **Backup Contact**. The channel can’t be published without them. 2. Select **Publish the channel** on the same page. The app creates a public site with two pages: the reporting form and a status check. The form’s address is saved in the settings as **Public reporting form**; put it on your website, in your code of conduct and in contracts. Settings also links the website text document (the template sets install “Raising a concern: website text”), next to the form’s address: publish it, then put its paragraph on your website with a link to the form. Staff find the same form under **Compliance › Raise a concern**. It doesn’t use their sign-in, so they can stay anonymous too. ## What a reporter gets After sending a report, the reporter sees a **reference** (like `CR-7K4M-Q2XD`) and a **passphrase** (four groups of four characters), once. With both they can open the status page, see where their report is, read the handlers’ answers and reply. Nobody else can: the passphrase is stored only as a hash, a wrong pair gets the same answer as an unknown reference, and repeated guesses are blocked. Nothing about the reporter’s connection is stored. A reporter can leave their name and contact details, or stay anonymous. ## Who sees a concern Only the concern’s **viewers**: the Concerns Contact and the Backup Contact, and anyone they add. The workspace owner and admins can’t read concerns, not even through the API. If the report is about the Concerns Contact, the reporter ticks that box and only the Backup Contact sees it. Handlers reply on the concern (the reporter sees the reply on the status page) or add internal notes (never shown to the reporter). Tasks are created from the category, for example a safeguarding review when a child is involved, with deadlines counted in business days. The evidence pack and the annual summary include **counts** of concerns by category, never their content. --- # Controls and evidence packs > Write your own controls, link obligations, documents, governance tasks and risks to them, see the evidence for a period, and export an evidence pack. Source: https://docs.ligament.ai/guides/compliance/controls-and-packs/ ## Controls A control is something your company does to meet its obligations or reduce a risk, for example “Access to production is reviewed every quarter”. Add them under **Compliance › Controls**: a reference you choose (`AC-03`), a title, a description, an owner, a status (not started, in place, needs attention) and a review cadence. The app ships no controls. Write descriptions in your own words. Frameworks such as ISO/IEC 27001 and the AICPA Trust Services Criteria are copyrighted: refer to their requirement IDs (for example in the notes), don’t paste their text. Link controls from: - **obligations**: every completion of the obligation is evidence for the control (the completion keeps the link even if the obligation changes later), - **documents**, - **governance tasks**: the task’s evidence file counts when the task is done, - **risks**, as **mitigating controls**. On a control, select **Evidence for a period** to see, for the dates you choose, the completions recorded, the governance tasks done with their evidence, and the linked risks, documents and obligations. ## Evidence packs **Compliance › Evidence packs** builds a ZIP for a source (or one obligation) and a period: | File | What it holds | | --- | --- | | `index.pdf` | What the pack covers and what’s in it | | `register.xlsx` | Every assignment and completion, quiz results, declarations, exemptions, governance tasks, the document version log and the controls | | `summary.pdf`, `summary.json` | The annual summary: policies in place with acknowledgement %, contacts, the reporting channel, coverage of joiners and refreshers, governance, open risks, concern counts | | `certificates/`, `documents/`, `governance/` | Sealed certificates, the document versions, governance evidence files | | `by-control/` | Optional: the same files grouped per control, with an index per control | | `manifest.json`, `SHA256SUMS` | The hash of every file. Check a pack with `sha256sum -c SHA256SUMS` | The same pack is available from the CLI: `ligament compliance pack --from 2027-01-01 --to 2027-12-31 --by-control`. --- # Assets > Set up the Assets app: hardware on top of the CMDB, who has what, check-out with acknowledgement, requests through the Service Catalog, stock and warranty alerts, depreciation and import. Source: https://docs.ligament.ai/guides/assets/ The Assets app is the record of your company’s hardware: laptops, monitors, phones and anything else you lend people. For each piece it keeps the model, tag and serial number, who has it and where, what it cost and what it is worth today, and when its warranty or lease ends. Every check-out and check-in is kept, so each asset has a dated history. It sits on top of the CMDB: every asset has its own configuration item, so incidents and changes point at it like at any other CI. It is built on the same pieces as any other app in your workspace, so everything here also works through the API, MCP and CLI. ## What’s in the app | Area | What you get | | --- | --- | | Assets | Tag, serial, model, category, status (on order, in stock, assigned, in repair, retired, disposed), person and location, condition, owned or leased, purchase date, supplier, PO and invoice reference (with attachments), cost, warranty and lease end, depreciation and book value | | Models and categories | The make and models you buy, with their unit cost and reorder level, and the categories (laptop, monitor, phone…) with how they depreciate and their default warranty. Eight categories are seeded | | Standard kits | The kit a role gets (“Engineer: laptop, two monitors, optional mouse”), by HR position, job title or department | | Check-outs | Handing an asset to someone, their acknowledgement and the check-in when it comes back. See [Check-out, acknowledgement and check-in](https://docs.ligament.ai/guides/assets/check-out/index.md) | | Requests and stock | Requests through the Service Catalog with manager approval, fulfilment from stock or a purchase request, reorder levels, warranty and lease alerts. See [Requests, stock and alerts](https://docs.ligament.ai/guides/assets/requests-and-stock/index.md) | | Money | Straight-line depreciation and the first import of your existing kit. See [Depreciation and import](https://docs.ligament.ai/guides/assets/depreciation-and-import/index.md) | | My assets | Everyone’s own page: their kit, what’s waiting for their acknowledgement and their history | ## Set it up 1. As an owner or workspace admin, open **App Store › Assets** and select **Install**. Assets needs **People** (who has an asset), **CMDB** (each asset’s configuration item) and **Service Catalog** (requests). If your workspace doesn’t have them, the Store says so and installs them first when you confirm. **HR** is optional: with it you can record work locations and match standard kits on HR positions. See [The App Store](https://docs.ligament.ai/guides/workspaces/app-store/index.md). 2. Nothing else to apply: the install creates the access model (permission sets, roles and restrictions, `assets/` in the spec store), the categories and the settings. See [Access in the manifest](https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/index.md). 3. In **Settings › Access › Assignments**, give IT the **Assets: administrator** role, finance and auditors **Assets: viewer**, and everyone else **Assets: employee**. 4. Make sure each person in **People** is linked to their login (**Login account**) and has a **Manager**. My assets, acknowledgements and the manager’s view follow those links; approvals go to the manager. 5. In **Assets › Settings**, enter who gets the stock, warranty and lease alerts, and who approves a request from someone without a manager. 6. Add your models under **Assets › Models** (tick **Requestable** for the ones people may ask for), then [import your assets](https://docs.ligament.ai/guides/assets/depreciation-and-import/index.md) or add them one by one. An Assets administrator is also an [administrator of the Assets app](https://docs.ligament.ai/guides/access/app-admins/index.md): they can change its permission sets, roles and restrictions without being a workspace admin. ## Roles and what each one sees | | Administrator (IT) | Viewer (finance, audit) | Manager | Employee | Workspace admin and owner | | --- | --- | --- | --- | --- | --- | | Assets | all, edit | all, read only | everyone below them in the reporting line, read only | their own, read only | all | | Cost, PO, invoice, depreciation, book value | read and edit | read | hidden | hidden | read | | Check-outs | all; check out and check in | all, read only | everyone below them, read only | their own: read and acknowledge | all, but never acknowledge for anyone | | Models, categories, kits | edit, with unit costs | read, with unit costs | read | read, without unit costs | edit | | Purchase requests and settings | edit | read | no | no | edit | | Assets dashboard and Stock pages | yes | yes | no | no | yes | The manager scope comes from the People reporting line: someone sees the kit of everyone below them, at any depth. There is no separate manager role to assign. ## How it relates to the CMDB When you add an asset, the app creates its configuration item in the CMDB (type from the category, for example *endpoint* for a laptop) and links the two both ways: the asset’s **Configuration item** field and the CI’s **Asset** field. Retiring or disposing of the asset retires the CI. Report a fault on a laptop as an incident with its CI under **Affected CIs**, exactly as for a server. --- # Check-out, acknowledgement and check-in > Hand an asset to someone, have them confirm they received it, take it back, and read the dated history of every asset. Source: https://docs.ligament.ai/guides/assets/check-out/ Who has an asset only changes through a check-out and a check-in. That way every period someone had a piece of kit is a dated record, with who handed it over, when they confirmed it and when it came back. ## Check an asset out 1. Open **Assets › Check-outs** and select **New**, or open the asset and add a check-out from its **Check-outs** list. 2. Choose the **Asset** (it must be *In stock*) and the **Person**. Optionally set the location, the condition it’s handed over in and an expected return date. 3. Save. The asset becomes **Assigned** to that person (and that location), and the check-out waits for acknowledgement. The person gets a notification on their usual channels asking them to confirm. Assets in repair, on order or already assigned can’t be checked out: the save says why. ## Acknowledge receipt The person selects **Acknowledge receipt** at the top of the check-out (from the notification), or the check-out under **My assets › Waiting for you**. The page shows what they’re receiving and a statement (“I confirm that I have received…, I will look after it and return it when asked or when I leave”). They tick it, type their full name, may add a drawn or typed signature, and select **Acknowledge receipt**. What is recorded, once, and can’t be changed afterwards, by anyone: - their name, the statement, the time (UTC and your workspace’s time), their IP address and browser, a reference to their session, and whether their account has two-factor on; - a **handover receipt** (PDF), attached to the check-out: the equipment, the statement, a certificate page with the signature, the audit trail and a QR code, and a digital seal with a trusted timestamp ([E-signatures](https://docs.ligament.ai/guides/e-signatures/index.md)). Anyone can check a copy of it at **/verify/** followed by the certificate id: the page compares the file’s fingerprint (sha256) with the one recorded. Only the person who received the kit can acknowledge it, as themselves, signed in to their own account. IT, managers, workspace admins and owners can’t do it for them, and neither can an API key, an agent or someone “viewing as” them. ### People without a login For a contractor or a new joiner before their first day, IT opens the check-out, selects **Acknowledge receipt** at the top and then **Send them a link** (or calls `POST /api/assets/checkouts//ack-link`). The person gets an email with a link that works once and expires after 14 days. Opening it shows the equipment and the form; they confirm with the email address it was sent to. The check-out records **Acknowledged how: External link**, with the same receipt. Sending a new link withdraws the old one. ## Check an asset in When the kit comes back, IT sets **Condition on return** on the check-out and selects **Check in**. The asset goes back to **In stock**, or to **In repair** when it came back broken or needing repair, and nobody is assigned any more. **Cancel check-out** undoes a check-out entered by mistake (before acknowledgement); the asset goes back to stock. Employees and viewers can’t check kit in: that’s IT’s job when they have it in hand. ## The history Each asset’s **Check-outs** list shows every period, newest first, with the dates of check-out, acknowledgement and return. **Assets › Check-outs** has saved views for open check-outs, those waiting for acknowledgement and the full history. The asset’s own activity shows every status change. Assets you import that are already with someone get a first check-out marked **Imported**, so their history starts on the day you load them. --- # Requests, stock and alerts > People request kit through the Service Catalog, managers approve, IT fulfils from stock or orders more; reorder levels and warranty and lease alerts. Source: https://docs.ligament.ai/guides/assets/requests-and-stock/ ## Requesting kit Tick **Requestable** on a model and the app creates its Service Catalog item (“Request: ThinkPad T14”) with the Assets fulfilment. People ask for it from the catalog like for any other service. Kit requests start on their own: 1. **Approval.** The request goes to the manager of the person it is for (their **Manager** in People). If they have none, it goes to the approver in **Assets › Settings**. Models without **Needs manager approval** skip this step (a mouse, a cable). 2. **From stock.** When approved and a unit of that model is in stock, the oldest one is checked out to the person, the request is marked fulfilled and they are told to collect it and acknowledge it. See [Check-out, acknowledgement and check-in](https://docs.ligament.ai/guides/assets/check-out/index.md). 3. **Or a purchase.** With nothing in stock, a **purchase request** is raised for IT, the alert recipients are told, and the person hears that it’s on order. 4. **Not approved.** The request is cancelled and the person is told. Approvals arrive in the approver’s inbox and notifications like any other approval. ## Purchase requests **Assets › Purchase requests** lists what’s to order. Fill in the supplier, PO number and unit cost, select **Mark ordered**, then **Receive** when it arrives. Receiving creates one asset per unit, in stock, with the cost, supplier, PO and purchase date. When the purchase came from a request, the first unit is checked out to the person straight away and the request is fulfilled. IT can also raise a purchase request by hand, for example to restock. ## Stock and reorder levels Each model shows how many units are **In stock** and in total. Give a model a **Reorder level** to be warned when stock falls below it. **Assets › Stock** lists every model against its level, what’s on order and the units ready to hand out. ## Alerts Every night at 02:00 the app checks: | Alert | Sent when | Repeated | | --- | --- | --- | | Stock below reorder level | a model’s units in stock are below its reorder level | after the days set in **Repeat a reorder alert after** while it stays low | | Warranty ending | an asset’s warranty ends within the **Warranty notice** days | once per asset | | Lease ending | a leased asset’s lease ends within the **Lease notice** days | once per asset | Each kind is one notification listing everything it found, to the **Alert recipients** in **Assets › Settings** (emails, comma-separated; members get it on their own channels and preferences). See [Notifications](https://docs.ligament.ai/guides/notifications/index.md). --- # Depreciation and import > How the book value is worked out (straight line, exact money), and how to load your existing kit from a CSV or Excel file. Source: https://docs.ligament.ai/guides/assets/depreciation-and-import/ ## Depreciation Each asset’s **book value** is its cost less the depreciation so far, worked out straight line, month by month: - **Months in service** count whole months from the purchase date (a month counts once its day of the month is reached). - **Accumulated depreciation** = cost × months in service ÷ useful life in months, never more than the cost. It is rounded to the currency’s smallest unit (two decimals for THB, SGD, USD; none for JPY), half to even. - **Book value** = cost − accumulated depreciation. After its useful life an asset is worth 0. The method and useful life come from the asset’s category (for example Laptop: straight line over 3 years) unless you set them on the asset. Peripherals depreciate with method **None**: their book value stays at cost. Amounts are exact: no rounding drift, whatever the number of assets. The values update when you change the cost, purchase date or useful life, and every night as months pass. The **Assets dashboard** shows the total cost, book value and depreciation so far, and the book value by category, for IT and finance. ## Import your existing kit Load your current assets once from a spreadsheet, with **Data › Import** (a workspace admin): 1. Prepare a CSV or Excel file with one row per asset. Use the field names as column headers: `asset_tag`, `model`, `serial_number`, `purchase_date` (YYYY-MM-DD), `cost`, `currency`, `state`, `assigned_to`, `location`, `condition`, `ownership`, `warranty_end`, `lease_end`, `supplier`, `purchase_order`, `invoice_ref`, `notes`. 2. Give the **model** and **category** by name, the **person** (`assigned_to`) by email or name, and the **location** by name. They must exist: add your models and people first. 3. Upload the file, check the preview, then import it into the existing **Asset** entity. What the import fills in for you: | If the row has | The asset gets | | --- | --- | | no `asset_tag` | the automatic number (AST-00001…) as its tag | | no `cost` | the model’s unit cost | | no `warranty_end` | the purchase date plus the category’s default warranty | | a person and no `state` | the status **Assigned** | | `state` = `assigned` and a person | a first check-out marked **Imported**, so its history starts today | A row with an unknown model or person stops the import with its name in the message. Each asset also gets its configuration item in the CMDB, like one added by hand. --- # Onboarding > Set up the Onboarding app: joiner, mover and leaver journeys started by HR, the new hire portal, bank details with change control, identity and right to work, kit, desks and offboarding. Source: https://docs.ligament.ai/guides/onboarding/ The Onboarding app runs the work around people joining, changing role and leaving. When HR records a hire, a job change or a last day, Onboarding starts a **journey**: a list of tasks for HR, IT, facilities, payroll, the manager and the person themselves, each due a set number of days before or after the date that started it. Before day 1 the new hire uses a small **onboarding portal** on their phone to enter their details and bank account, check their identity, sign their contract and read the company policies. Onboarding has no workflow engine of its own. Journeys and tasks are ordinary records, started and moved by the app’s pipelines, so everything here also works through the API, MCP and CLI. ## What’s in the app | Area | What you get | | --- | --- | | Journeys | One per joiner, mover or leaver: its template, the date it counts from, progress, overdue tasks and, for joiners, how far the portal steps have got. See [Journeys and tasks](https://docs.ligament.ai/guides/onboarding/journeys/index.md) | | Templates | Ordered tasks with an owner, a due offset (−14 days, day 1, +30 days), dependencies and conditions, chosen by employment type, department, position, location, remote and director. Four are seeded: staff joiner, contractor joiner, mover and leaver | | The new hire portal | Details, bank account, identity and right to work, contract signing, company policies, equipment choice and the first-day plan, from an emailed invite. See [The new hire portal](https://docs.ligament.ai/guides/onboarding/portal/index.md) | | Bank details | Visible in full to payroll and the account holder only (owners and admins see the last four digits); every change is told to the employee’s previous contact details and verified by payroll. See [Bank details, identity and right to work](https://docs.ligament.ai/guides/onboarding/bank-and-identity/index.md) | | Identity and right to work | A check through your identity verification connection with consent, only the result stored; a document copy only where the right-to-work rule needs one, deleted N years after the person leaves | | Kit | The role’s standard kit from the Assets app, requested in the Service Catalog for the new hire and acknowledged on receipt | | Offices and desks | Floors (with the floor plan as an attachment) and desks; one person per desk | | Leavers | Equipment return with a chase, access removal confirmed by IT, licences, final pay, exit interview, handover, the leaver declaration and retention timers | | Dashboard | Joiners this month, journeys at risk, leavers with equipment out or access not confirmed removed, and the payroll page | ## Set it up 1. As an owner or workspace admin, open **App Store › Onboarding** and select **Install**. Onboarding needs **People**, **HR**, **Assets** (1.1 or later) and **Compliance** (1.1 or later). If any are missing, the Store installs them first when you confirm. See [The App Store](https://docs.ligament.ai/guides/workspaces/app-store/index.md). 2. In **Settings › Access › Assignments**, give HR the **Onboarding: administrator (HR)** role, the payroll team **Onboarding: payroll**, IT and facilities **Onboarding: IT and facilities**, and everyone else **Onboarding: employee**. Managers need nothing extra: they see the journeys of their reporting line. 3. In **Onboarding › Settings**, choose who gets HR, IT, facilities and payroll tasks, how many days before the start the portal invite goes out, and the welcome text the new hire sees. 4. Check the templates in **Onboarding › Templates**. Change task names, owners, offsets and conditions to match how you work, or add a template for a department or location (the most specific match wins). 5. For identity checks, add an identity verification connection in **Settings › Connections** and install **Verify** from the App Store. Without them, the portal asks for a photo of the document and HR reviews it. 6. In **Onboarding › Right-to-work rules**, say for each country (and employment type, if it differs) whether a copy of the document must be kept and for how many years after the person leaves. 7. Add your offices: an HR location, then **Floors** (attach the floor plan image) and **Desks**. 8. For kit, give the role a standard kit in **Assets › Standard kits**. For suggested access, map departments or positions to groups and app roles in **Onboarding › Role → access map**. ## Who sees what | Role | Sees and does | | --- | --- | | Onboarding: administrator (HR) | Everything in the app: templates, journeys, tasks, portal invites, right-to-work checks and their document copies, desks, settings. Not bank numbers | | Onboarding: payroll | Bank accounts in full, verifying new and changed accounts, the payroll export; journeys (read) and payroll tasks | | Onboarding: IT and facilities | Journeys and tasks (read), their own IT and facilities tasks, desks and floors, the role → access map | | Manager | The journeys of people in their reporting line and the tasks assigned to them; check-ins and exit interviews | | Employee | Their own journey and tasks, their own bank account (changing it sends it back to payroll for verification) | | Owner, workspace admin | Administer the workspace as usual, but bank numbers stay masked: payroll and the account holder only | The new hire is not a member of the workspace before day 1. The portal gives them access to their own journey only, through a guest session. See [The new hire portal](https://docs.ligament.ai/guides/onboarding/portal/index.md). --- # Journeys and tasks > How joiner, mover and leaver journeys start from HR, how templates pick the tasks and their due dates, and how overdue work is chased. Source: https://docs.ligament.ai/guides/onboarding/journeys/ A journey is the list of things that must happen for one person joining, changing role or leaving. Onboarding starts it from HR: nobody has to remember to. | Journey | Starts when HR… | Due dates count from | | --- | --- | --- | | Joiner | records a hire: an employee with a start date (or gives an existing one a start date) | the start date (day 1 = 0) | | Mover | records a dated change to the job (department, position or location) and the date arrives | the date of the change | | Leaver | sets an end date (or the status *terminated*) | the last day | A person has at most one open journey of each kind. A hire whose start date is more than a week in the past, or who already has an open joiner journey, doesn’t get another one. ## Templates A template is an ordered list of tasks. Onboarding picks the template for each journey by matching the person’s HR record against each active template of that kind: department, position, location, employment type (staff, contractor), remote or office, and directors only. A template matches when every field it sets matches; among the matches, the highest **Priority** wins, then the most specific (the one that sets the most fields). Four templates are seeded: | Template | For | | --- | --- | | Joiner (staff) | Employees, office or remote: 20 tasks from the portal invite (−14 days) to the 90-day check-in | | Joiner (contractor) | Contractors: a shorter list with a time-limited login | | Mover | Access review, kit changes, desk move, compliance check, the manager’s goals for the new role | | Leaver | Handover, exit interview, leaver declaration, final pay, equipment return, licences, access removal and its confirmation, desk | Each template task has: - **Owner**: HR, IT, facilities, payroll, the manager, the buddy or the new hire. HR, IT, facilities and payroll go to the people named in **Onboarding › Settings**; the manager is the person’s manager in HR; new hire tasks are done in the portal. - **Due**: days from the journey’s date. −10 is ten days before the start, 0 is day 1, 30 is a month in. - **Waits for**: the code of another task. The task stays *waiting* until that one is done or skipped, then opens and its owner is told. - **Applies when**: *always*, *office* or *remote*, *staff* or *contractor*, *director*, *has kit* (the role has a standard kit), *has groups* (the role → access map suggests groups), *right-to-work check* or *copy required* (from the right-to-work rule for the person’s country). Tasks that don’t apply aren’t created. - **Optional**: the owner may skip it. Changing a template changes the journeys started after the change, not the ones already running. ## Working the tasks Each owner gets a notification when their task opens, with its due date and the person it’s for. **My onboarding tasks** lists everyone’s own; the journey page lists them all with who has them. Marking a task **Done** (or **Skipped**, if it’s optional) opens the tasks that waited for it and updates the journey’s progress. Some tasks do their part of the job for you: | Task | What happens | | --- | --- | | Send the portal invite | HR selects **Send the portal invite** on the journey page; it also goes out by itself on the invite day in Settings. **Close the portal** stops the hire’s links and sessions | | Send the contract for e-signature | Attach the contract and offer letter (PDF) to the journey and select **Send documents for signature**: one envelope, the new hire signs in the portal, the sealed copy comes back to the journey. See [E-signatures](https://docs.ligament.ai/guides/e-signatures/index.md) | | Prepare the standard kit | Onboarding raises the role’s kit in the Service Catalog for the new hire (pre-approved) once they’ve chosen their options, or 10 days before the start. IT assigns units from stock; the new hire acknowledges receipt in the portal | | Assign a desk | Facilities picks a free desk on the journey page; the desk list shows who sits there | | Accounts and access | The task lists the groups and app roles the role → access map suggests. An admin applies them in **Settings › Access**: Onboarding never grants access by itself | | Check-ins | Each check-in task comes with a short form for the manager (how it’s going, concerns, next steps) | | Exit interview | A form for HR, kept with the leaver’s journey | | Confirm all access is removed | Only IT can confirm it, not the manager. The journey records who confirmed and when | ## Chasing Every night Onboarding: - reminds owners of overdue tasks (every three days by default, **Chase overdue tasks every (days)** in Settings); - sends portal invites that are due and raises kit requests that are due; - marks a joiner journey **at risk** when a task due before the start date is overdue; - for leavers past their last day, lists the equipment still checked out to them and chases the manager, IT and the leaver; - reminds HR before a right-to-work document expires; - deletes right-to-work document copies whose retention has run out (see [Bank details, identity and right to work](https://docs.ligament.ai/guides/onboarding/bank-and-identity/index.md)). A journey completes when all its tasks are done or skipped. ## The dashboard **Onboarding dashboard** shows joiners starting this month, journeys at risk, leavers with equipment still out and leavers whose access isn’t confirmed removed, with the tasks due this week. Payroll has its own page with accounts to verify and the export. --- # The new hire portal > What the new hire sees before day 1: the emailed invite, the steps they complete on their phone, and how the portal keeps them to their own journey. Source: https://docs.ligament.ai/guides/onboarding/portal/ Before day 1 a new hire has no login. The onboarding portal lets them do their part from their phone: one step per screen, large buttons, light theme, no third-party scripts or fonts. ## The invite HR sends the invite from the journey page (**Send the portal invite**), or it goes out by itself the number of days before the start set in **Onboarding › Settings** (14 by default). It goes to the personal email HR recorded on the employee. The invite link: - **works once**: after the new hire has used it, it’s spent. A forwarded or leaked link that was already used does nothing; - **is bound to the email**: opening it asks for the email address the invite was sent to, and only that address (in any case) opens the portal; - **expires** a week after the start date at the latest (sooner if HR sends a new link: the old one stops working); - **never signs anyone in by being opened**: link previews in chat and email apps, and security scanners that follow links, see a page with a form, nothing more. The form is protected against cross-site requests. Confirming the email starts a **guest session** in that browser: a cookie that reaches the portal pages of this one journey and nothing else in the workspace. It lasts until the portal closes (a week after the start date) or HR selects **Close the portal**. A new hire who switches phone or clears their cookies uses **Email me a new link** on the portal’s sign-in page; the answer is the same whether or not the address has a journey, so the page can’t be used to find out who is joining. ## The steps | Step | What the new hire does | Where it goes | | --- | --- | --- | | Your details | Preferred name, phone, home address, emergency contact, date of birth | Their HR employee record | | Bank account | IBAN (and BIC), a UK account number and sort code, or a US account and routing number; the format and check digits are checked when they save | A bank account record payroll verifies. See [Bank details](https://docs.ligament.ai/guides/onboarding/bank-and-identity/index.md#bank-details) | | Identity and right to work | Read what is collected and why, agree, then do the check on their phone (or upload a photo of the document if your workspace has no identity connection) | A right-to-work check. See [Identity and right to work](https://docs.ligament.ai/guides/onboarding/bank-and-identity/index.md#identity-and-right-to-work) | | Sign your contract | Read and sign the documents HR sent, with a one-time code by email | The journey: the sealed PDF and its certificate | | Policies and training | Read and confirm each Compliance obligation for new joiners (Code of Conduct, anti-bribery, information security, acceptable use, training) | Compliance assignments, signed through Compliance’s own signing page | | Your equipment | See the role’s standard kit and choose the optional items, then acknowledge each item when it arrives | Service Catalog requests for the new hire; the Assets check-out and its acknowledgement | | Your first day | When and where, their desk, their manager and buddy, the welcome text from Settings | Read only | Steps that don’t apply aren’t shown: no identity step if the right-to-work rule doesn’t need a check, no equipment step if the role has no standard kit. Each finished step shows on the journey page for HR. ## What the portal can’t do The guest session reads and writes only through the portal’s own pages, as the system, and only this journey: - it is not a member session: the workspace’s pages, the records API, MCP and the CLI refuse it; - it can’t see other journeys, other people’s records, or HR’s notes on the journey; - it can’t confirm its own bank account, approve its own right-to-work check or mark HR’s tasks done. On day 1 the new hire gets a normal login (an IT task on the journey), and the portal closes a week later. --- # Bank details, identity and right to work > Who sees bank details and how a change is controlled; the identity and right-to-work check through your identity verification provider, what is kept, and when document copies are deleted. Source: https://docs.ligament.ai/guides/onboarding/bank-and-identity/ ## Bank details Changing the account a salary is paid into is a favourite fraud: someone emails payroll pretending to be an employee. Onboarding makes it hard. **Who sees the numbers.** The full account number, IBAN, sort code, routing number and BIC are visible to **payroll** (the **Onboarding: payroll** role) and to **the account holder**. Everyone else, workspace owners and admins included, sees the last four digits (`••••1234`). This can’t be lifted with a reveal button or a role override: only payroll’s permission (`hr.payroll`) shows them. Every time someone opens a bank account record, the read is written to the [access audit log](https://docs.ligament.ai/guides/access/index.md). **Checks when saved.** An IBAN must pass its check digits; a BIC has 8 or 11 characters; a UK sort code has 6 digits and the account 8; a US routing number has 9. A mistyped account is refused before it’s saved. Onboarding doesn’t check with the bank that the account exists or belongs to the person (no bank verification service in this version). **A new account** (from the portal, or from the employee’s own record once they have a login) is *pending verification*. Payroll is told, calls the person on a number they already hold, and selects **Verify**. Only payroll can verify: not the manager, not HR, not an admin, not the account holder. **A change to an existing account**: 1. sends the account back to *pending verification*, keeps the last four digits of the old account and counts the change; 2. emails the person at the contact details they had **before** the change (“your bank details were changed… if this wasn’t you, contact payroll straight away”), so an attacker who also changed the email address doesn’t get the warning; 3. asks payroll to verify the change before the next pay run. **The payroll export** (payroll only, from the payroll page) is a CSV of every active account with columns for *verified* and *changed since the last export*. An unverified or changed account says so on its row. Each download is written to the access audit log. ## Identity and right to work The identity step checks that the new hire is who they say they are and records their right to work. It runs through the workspace’s **identity verification connection**, in the new hire’s portal. **Set up.** Install **Verify** from the App Store and add an **identity verification** connection in **Settings › Connections** (its API URL and key; with the webhook secret the provider reports results straight away, without it they’re fetched every few minutes). Use **Test** to check it answers. A sandbox key gives sandbox results, which never count as a right-to-work check. In **Onboarding › Settings** you can name the provider’s verification profile to use. Without a connection the portal asks for a photo of the document and HR reviews it (see *Without an identity connection* below). **Consent first.** Before the check, the portal shows what is collected (a photo of the identity document, a short selfie video for the liveness check, the document’s chip where the phone can read it), why (to confirm identity and the right to work), what is kept (the result only, unless a copy is required), for how long, and who sees it (HR only). The check starts only after the new hire agrees; the time and the version of the consent text are recorded on the check. **The check.** The provider’s check runs on the new hire’s phone: from a laptop, it shows a QR code to continue on the phone (the chip can only be read by a phone). When it’s done, the provider tells Onboarding the result. **What is kept** on the right-to-work check (HR only): the decision, the verified name, date of birth, nationality, the document type, country and expiry date, the assurance level, the provider’s session reference and when the check finished. The images stay with the provider; the verification case in Verify holds only the decision. | Result | What happens | | --- | --- | | Approved, no copy needed | The check is *confirmed* and the journey step is done | | Approved, copy needed | The check waits in *HR review* until the new hire uploads the photo page and HR confirms | | Not approved | The check is *not confirmed* with the provider’s reason; HR gets a task to ask the new hire to try again or check the original document in person | **Re-verification.** When the document expires within the notice period (60 days by default, in Settings), HR gets a task to ask for a follow-up check. ### Document copies and how long they’re kept Some countries require an employer to keep a copy of the document that proved the right to work. Onboarding keeps one **only where a right-to-work rule says so**: **Onboarding › Right-to-work rules** lists, per country of the work location (and employment type, if it differs), whether a check is needed, whether a copy must be kept and for how many years after the person leaves. Two rules are seeded: a default (check, no copy) and the United Kingdom (keep a copy for two years after the employment ends; confirm this with your adviser). When a copy is kept: - it’s an attachment on the right-to-work check, visible to HR only (**Onboarding: administrator (HR)**), owners and admins included in the restriction; - every view or download of it is written to the access audit log; - when the person leaves, the check records the leaving date and the date the copy is due for deletion (last day + the rule’s years); - the nightly run deletes copies past that date and writes an audit record saying why. The check keeps its result and the date the copy was deleted. ### Without an identity connection The portal asks the new hire to agree to the same consent and upload a photo of their document. HR reviews it, checks the original on day 1 and confirms the right to work on the check. The same copy rules apply. --- # E-signatures > Send documents for signature, sign them on any device, check a signed PDF, and manage envelopes, templates, legal holds and the document seal. Source: https://docs.ligament.ai/guides/e-signatures/ E-signatures let your apps and workflows ask people to sign PDFs. Each request is an **envelope**: one or more documents, the people who sign (or get a copy), and the fields they fill in. When everyone has signed, Ligament writes the values onto the pages, adds a certificate page and the full audit trail, and **seals** the PDF so any later change shows. The sealed PDF is saved on the record the envelope is about, so it follows that record’s access and retention. Apps use it for you (the Compliance app’s click-to-sign, for example). You can also send envelopes from workflows, the API, MCP and the CLI: see [E-signatures for developers](https://docs.ligament.ai/developers/e-signatures/index.md). ## Who signs, and how Signing is always done by the person, never on their behalf. API keys, agents and workflows can create, send, remind and withdraw envelopes, but no key, agent or workflow can sign or decline. | Signer | How they sign | | --- | --- | | A member of your workspace | In the app, signed in. They get an in-app notification that opens the signing page. | | Anyone else | A link sent to their email. Opening it does nothing on its own; they ask for a 6-digit code, which goes to the same email address, and enter it before they see the document. | | Anyone else, by text | The same, with the code sent by SMS. Needs the Twilio channel in Notifications. | Links work once and expire with the envelope (14 days unless the sender sets up to 30). A reminder sends a fresh link and the old one stops working. Five wrong codes lock the code; the person asks for a new one. ## Signing The signing page works on a phone. The signer: 1. Asks for a code and enters it (external signers only). 2. Reads the document. **Open full screen** shows it in the phone’s PDF viewer. 3. Fills in their fields: initials, text, tick boxes. The date, their name and email are filled in for them, and some fields may already carry a value from the record. 4. Types their name or draws a signature, ticks the consent statement and selects **Sign**. They can also **Decline to sign** with a reason. Declining closes the envelope for everyone, and the sender sees the reason. When the signing order is **one after another**, each person is invited only when the people before them have signed. ## The sealed PDF When the last person signs, the sealed PDF has: - the documents, with the field values written onto the pages; - a **certificate page**: each signer, how they proved who they were, when they signed (UTC and your workspace’s time zone), from which IP address, the fingerprint (sha256) of each original, the audit trail and a QR code to the verification page; - the audit trail as an attached file (`audit-trail.json`), so it can be checked without Ligament; - a **digital seal** over the whole file with a trusted timestamp. PDF readers such as Adobe Reader show it in their signature panel, and changing a single byte of the file breaks it. Signers outside your workspace get a download link by email; members get an in-app notice and find the PDF on the record. ## Checking a signed PDF Anyone can check a sealed PDF at `https://app.ligament.ai/verify` (the QR code on the certificate page opens the page for that certificate): - **With only the certificate id** the page shows the company, the document title, when it was completed, how many people signed and whether it is sealed. No names, emails or fingerprints. - **With the file**: choose the PDF and the page computes its fingerprint in the browser (the file isn’t uploaded). If it matches, the page shows the full certificate: who signed and when, how they signed, the fingerprints, the seal and whether the audit trail is intact. A changed file doesn’t match. ## Settings › E-signatures Workspace owners and admins, and roles with the **E-signature admin** capability, see Settings › E-signatures: - **Envelopes**: every envelope with its status, signers and record. Open one for the recipients, the seal and the audit trail with its check (“Hash chain intact … matches the trail sealed into the PDF”). From there you can remind signers, void an envelope (the reason is shown to the signers), download the sealed PDF and place or lift a legal hold. - **Templates**: a PDF, the roles who sign it and the fields each role fills in (page and position in PDF points from the bottom-left corner of the page; 72 points make an inch). A field can take its value from the record, for example `{{record.candidate_name}}`. - **Seal & timestamps**: the seal key id, the seal certificate and when it expires, the time-stamping service and whether the last seal got a timestamp. Senders always see the envelopes they sent, and signers the ones sent to them. Other members see neither. Signers’ IP addresses and browsers are shown only to e-signature admins. To give someone the E-signature admin capability without making them a workspace admin, add `esign.admin` to a permission set their role holds (Settings › Access). `esign.admin@` limits it to one app’s envelopes. ## Legal hold An e-signature admin can place a **legal hold** on an envelope, with a reason. While it is on hold, nobody can delete the envelope, the record it is about or its sealed PDF. Placing and lifting a hold are both recorded in the audit trail. ## Retention The sealed PDF and the audit trail belong to the record. Deleting the record (when no legal hold applies) deletes the sealed PDF with the record’s other files. ## The provider The built-in provider is the default and needs no setup. The **E-signature** connection in the Plugins hub lets an admin choose the time-stamping service and run **Test**, which seals a sample PDF and checks it. DocuSign is listed but not available yet. ## What the built-in signature is It is a simple electronic signature with strong evidence: who signed (a signed-in member, or someone who controlled the email inbox and entered the code), what they saw (each document’s fingerprint), that they agreed (the consent statement and **Sign**), when (a trusted timestamp) and that nothing changed since (the seal and the audit trail). Whether that is enough for a given document depends on the law that applies and on what the other party accepts; some documents, such as wills or property transfers in many places, need more than an electronic signature. This page is not legal advice. --- # The spec store > Pages and access definitions are versioned artefacts in one spec store: read, plan and apply them the same way from the builders, the API, the CLI and MCP. Source: https://docs.ligament.ai/guides/building-apps/ 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](https://docs.ligament.ai/reference/rest-api/index.md#spec-store), the [CLI](https://docs.ligament.ai/reference/cli/index.md) or [MCP](https://docs.ligament.ai/reference/mcp-tools/index.md). Knowing how it works helps you script changes, review them, and read what the builders show you. ## 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](https://docs.ligament.ai/guides/access/index.md). 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/` returns the JSON Schema of a type. ## Addresses Every artefact has an address of the form `//`: | 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 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](https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/index.md). 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 ```bash curl -s -H "Authorization: Bearer $LIGAMENT_API_KEY" \ https://app.ligament.ai/api/spec/page/loans_desk ``` ```json { "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 Every change goes through the same three steps, whoever or whatever makes it: 1. **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. 2. **Plan** compares the document with what’s live and says what applying it would do: the action (`create`, `update`, `delete`, `reset` or `noop`), 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. 3. **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. ```bash 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": { … } } ] }' ``` ```json { "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 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: ```json { "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: ```json { "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 Every applied change is a version. The page builder’s **History** tab lists them with a diff of each; from the API or CLI: ```bash ligament spec history __tenant__/page/loans_desk ``` ```text VERSION ACTION LAYER HASH BY WHEN CHANGESET v7 update source 7b4300da2d088767 Ada Admin via API key Loans desk agent (…MT63) 2026-12-02T16:04:02.270Z v6 update source eac62db87de8a464 Ada Admin via API key Loans desk agent (…MT63) 2026-12-02T15:56:33.192Z v4 update source 7b4300da2d088767 Ada Admin 2026-12-02T15:56:10.852Z cmx6b3gff00n06x6sqhzg1crm v2 update source e99e59f23c85ced0 Ada Admin 2026-12-02T15:51:08.954Z cmx6awxp700ll6x6s05ufdigw v1 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/
?version=4` returns the document as it was at version 4. \[Screenshot: The History tab of the page builder, showing version 1 of the Loans desk page created by Ada Admin, with the added blocks and the document\] ## 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. ```bash ligament spec pull __tenant__/page/loans_desk -d spec ligament spec plan spec/page.loans_desk.json ligament spec apply spec/page.loans_desk.json ``` Every command is in the [CLI reference](https://docs.ligament.ai/reference/cli/index.md#spec-pull). ## 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](https://docs.ligament.ai/guides/building-apps/changesets/index.md) 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](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md). --- # Changesets > Group changes into a changeset, review the plan, and apply every change together or discard them. Source: https://docs.ligament.ai/guides/building-apps/changesets/ A changeset is a named draft of one or more changes to pages or access artefacts. It lets one person (or an agent) prepare a change and another review and apply it, and it applies everything in it together: either every item goes live, or none does. Use one when the person making a change can’t or shouldn’t apply it alone, when a change spans several artefacts, or when an AI agent proposes it. Changesets live in **Build › Changes**. ## The life of a changeset | Status | Shown as | What can happen next | | --- | --- | --- | | `open` | **Draft** | Add or replace items, mark it ready, apply it, discard it | | `ready` | **Ready for review** | Reopen it, apply it, discard it | | `applied` | **Applied** | Nothing: it’s read-only and records who applied it and when | | `discarded` | **Discarded** | Nothing: it’s kept read-only with its activity, and nothing in it was applied | Marking a changeset ready is a signal to reviewers, not a lock: a ready changeset can still be applied by anyone allowed to, and reopened for more edits. ## Propose a change **From a builder.** In the page builder, select **Save as changeset** (or **Plan**, then **Save as changeset** in the plan dialog). The builder creates a changeset called *Draft:* and stays open on it: the header shows **Draft · 1 change** and the changeset’s name, and its buttons become **Save to changeset** and **Apply changeset**. Further edits go into the same changeset until you apply it or leave. **From the API, CLI or MCP.** Create the changeset with its items in one call: ```bash curl -s -X POST -H "Authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ https://app.ligament.ai/api/changesets \ -d '{ "title": "Loans desk: show up to 25 loans", "note": "The desk has more than 10 loans out most weeks.", "ready": true, "items": [ { "address": "page/loans_desk", "baseHash": "7b4300da2d088767", "doc": { … } } ] }' ``` The response is `201` with the changeset, including its `id`, `status` (`ready` here), who created it and its `url` (`/build/changes/`). An item without `baseHash` starts from the artefact’s current version. The [CLI](https://docs.ligament.ai/reference/cli/index.md) has the same operations as `ligament changeset create | add | ready | plan | apply | discard`, and MCP clients get the `changeset_*` tools. A changeset holds one item per artefact; adding an item for an artefact that’s already in it replaces that item. `PATCH /api/changesets/` changes the title, note or status (`open` or `ready`). ## Review it Open the changeset in **Build › Changes**. The **Open & ready** filter shows what’s waiting. \[Screenshot: A changeset titled Loans desk: show the due-back date, Ready for review, proposed by Max Maker, with its plan and the Impact panel\] - The **Plan** tab plans every item against what’s live now: create, update, delete or reset, which layer it writes (*This workspace*, or a customisation of an app’s shipped version), and a line per change. The note the proposer wrote is shown above it. **Re-plan** refreshes it. - The **Impact** panel lists the permissions applying needs and whether you hold them, whether the change touches access rules or code, the workspace’s policy for changes made with API keys, and the layers involved. A plan that changes access artefacts also shows who gains or loses access (see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)). - The **Artefacts** tab lists the items, each with the hash it started from. - The **Activity** tab records every step: created, each change proposed, marked ready, applied or discarded, and refused applies. If someone changed an artefact after the changeset started from it, the plan shows the item merged with those newer changes, which is what **Apply** writes. If the same values changed on both sides, the plan shows the conflict, and nothing is applied until it’s resolved. ## Apply or discard it Select **Apply** to apply every item together. If any item fails (it no longer validates, conflicts, or needs a permission you don’t hold), nothing is applied and the changeset stays as it was. **Discard** closes it without applying anything. Each applied artefact gets a new version that names the changeset, so its history leads back to the review. \[Screenshot: The Activity tab of an applied changeset: created by Max Maker, change proposed, marked ready for review, applied by Ada Admin\] ## Who may do what | Action | Who | | --- | --- | | See changesets | Anyone with access to Build | | Propose: create, edit, mark ready, discard | Anyone with access to Build, except viewers; API keys with `spec:propose` | | Apply | People who hold the build permission for every item (`build:pages`, `build:access`); API keys with `spec:apply` whose creator holds them, within the workspace’s [agent policy](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md) | Proposing is free: it changes nothing live. Owners and admins hold every build permission; owners can grant them to other roles in **Settings › Access › Roles**. When someone without the permission opens a changeset, the review page says so and **Apply** is disabled: \[Screenshot: The same changeset seen by Max, whose role lacks build:pages: a notice says he can't apply it, the Impact panel shows build missing and Apply is disabled\] ## API | Method and path | Scope | Does | | --- | --- | --- | | `GET /changesets?status=open,ready` | `spec:read` | Changesets, newest first | | `POST /changesets` | `spec:propose` | Create one: `{ title, note?, items?, ready? }` | | `GET /changesets/` | `spec:read` | Items, base hashes and activity | | `PATCH /changesets/` | `spec:propose` | `{ title?, note?, status: "open" | "ready" }` | | `PUT /changesets//items` | `spec:propose` | Add or replace `{ items }` | | `DELETE /changesets//items?address=` | `spec:propose` | Remove one item | | `POST /changesets//plan` | `spec:read` | Plan every item against what’s live | | `POST /changesets//apply` | `spec:apply` | Apply every item, all or nothing (`{ onConflict?: "merge" }`) | | `POST /changesets//discard` | `spec:propose` | Discard it | Paths are relative to `https://app.ligament.ai/api`. Request and response shapes are in the [REST API reference](https://docs.ligament.ai/reference/rest-api/index.md#changesets). --- # Agents propose, people approve > Let AI agents and scripts draft changes with an API key while people keep the final say. Source: https://docs.ligament.ai/guides/building-apps/agents-propose/ AI assistants connected over [MCP](https://docs.ligament.ai/developers/mcp/index.md), scripts and the [CLI](https://docs.ligament.ai/developers/cli/index.md) change your workspace with an API key. They use the same spec store as the builders, so everything they do is planned, versioned and attributed to the key. You decide two things: what each key may do (its scopes), and which key-made changes go live by themselves and which wait for a person to apply them (a workspace setting). ## Choose what a key may do Three scopes cover the spec store: | Scope | Lets the key | | --- | --- | | `spec:read` | Read artefacts, their history, schemas and the catalog, and plan changes | | `spec:propose` | Create and edit changesets for a person to review. It never applies anything. | | `spec:apply` | Apply changes directly and apply changesets, within what the key’s creator may do and the workspace setting below | A key acts as the person who created it, and never with more rights than that person has today. A key with `spec:apply` created by someone without `build:access` can’t apply access changes, whatever the setting says. Every spec scope also needs the creator’s role to have the Build capability: create agent keys as someone who uses Build (an admin, or a role whose permission set has `build:use`). For an AI assistant that should only ever suggest changes, give it `spec:read` and `spec:propose`. Its attempt to apply is refused: ```json { "error": "This API key lacks the \"spec:apply\" scope.", "code": "insufficient_scope", "required": ["spec:apply"], "route": "/api/spec/apply" } ``` Create keys in **Settings › API keys**; see [API keys](https://docs.ligament.ai/developers/api-keys/index.md) and the [scope reference](https://docs.ligament.ai/reference/scopes/index.md). ## Decide which changes need a person Open **Settings › Building and agents**. Under **Changes made with API keys**, pick one: | Option | Value | Effect | | --- | --- | --- | | **Access and code changes need a person to apply them** (default) | `review_access_code` | A key with `spec:apply` applies pages directly. Changes to roles, permission sets, restrictions, group mappings, hierarchies and shares wait in Build › Changes. | | **Every change an API key makes needs a person to apply it** | `review_all` | Every key-made change waits as a changeset marked Ready for review, whatever scopes the key has. | | **API keys with spec:apply may apply anything their creator may** | `allow_all` | Nothing waits. Use this only for keys you trust as much as their creators. | \[Screenshot: Settings › Building and agents, with the three options for changes made with API keys and the default selected\] Only a signed-in admin can change this setting. An API key can read it (`GET /api/spec/policy`) but can’t change it, so a key can’t lift its own review: ```json { "error": "PUT /api/spec/policy only accepts a signed-in browser session, not an API key.", "code": "session_required" } ``` ## What the agent sees When a key applies a change the setting holds back, nothing is applied. Ligament turns the change into a changeset marked ready for review and answers with `202`: ```bash curl -s -X POST -H "Authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ https://app.ligament.ai/api/spec/apply \ -d '{ "title": "New role: Loans coordinator", "items": [ { "address": "role/loans_coordinator", "baseHash": null, "doc": { "key": "loans_coordinator", "name": "Loans coordinator", "description": "Runs the IT equipment loans desk.", "permissionSets": [], "params": {} } } ] }' ``` ```json { "ok": true, "proposed": true, "applied": false, "code": "spec.human_apply_required", "message": "Nothing was applied: a person must apply this change. It is waiting in Build → Changes.", "changeset": { "id": "cmx6b346y00mo6x6srbbxd3g1", "url": "/build/changes/cmx6b346y00mo6x6srbbxd3g1", "status": "ready" } } ``` The optional `title` names the changeset; without it the title is *Proposed via API:* followed by the addresses. An agent should treat `proposed: true` as a normal result: tell the user that the change is waiting for review and where. The other clients report it the same way: - The MCP tool `spec_apply` returns `proposed: true` with the changeset link in its message. - The CLI prints the changeset and exits with code 3: ```text Proposed, waiting for a person: this workspace requires a person to apply this change. Nothing was applied. Changeset cmx6bg3rz00ro6x6sxldk2kuu: https://app.ligament.ai/build/changes/cmx6bg3rz00ro6x6sxldk2kuu ``` The key can’t then apply the changeset itself: `POST /api/changesets//apply` with a key answers `403 spec.human_apply_required`. Changes the setting lets through apply as usual (`200` with the new versions), and each version names the key: *Ada Admin via API key Loans desk agent (…MT63)*. ## Review what an agent proposed Proposals from keys appear in **Build › Changes** like any other changeset. The header says who proposed it and through which key, and the plan carries the reason it’s waiting: \[Screenshot: A changeset New role: Loans coordinator, Ready for review, proposed by Ada Admin via API key Loans desk agent, with the notice that the workspace requires a person to apply access and code changes made with an API key\] Read the plan and the Impact panel, then **Apply** it or **Discard** it. Applying it in the app makes you the person who applied it; the activity keeps the key as the proposer. See [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md) for the review page in detail. ## A setup that works - Give each agent its own key, named after what it does (“Loans desk agent”), so its changes are easy to spot in history and in Build › Changes. - Start agents on `spec:read` and `spec:propose`. Add `spec:apply` only when you’re happy for their page changes to go live without review. - Keep the default setting, so access changes always wait for a person, or choose `review_all` while you’re trying an agent out. - Revoke a key in **Settings › API keys** when the agent no longer needs it. Its past changes keep their attribution. --- # Page builder > Build pages from blocks bound to your data, preview them, and save them as a change. Source: https://docs.ligament.ai/guides/building-apps/page-builder/ The page builder makes pages such as dashboards, desk overviews and team homes from blocks: metrics, charts, lists of records, text, callouts, buttons and images. Each data block reads records live, as the person looking at the page, so everyone sees only what their access allows. A page is an artefact in the [spec store](https://docs.ligament.ai/guides/building-apps/index.md), so it is planned, versioned and reviewable like any other change. To start a page, open **Build › Pages** and select **New page**. To change an existing one, open it in Build › Pages and select **Edit**. Anyone with access to Build can edit pages and save the result as a changeset; applying needs the `build:pages` permission. \[Screenshot: The page builder with the Loans desk page: the outline and block library on the left, four blocks on the canvas, and the Data tab of the selected list block on the right\] ## Find your way around - The header holds **Preview**, **Plan**, **Save as changeset** and **Apply**, and badges for the page’s state: **New page**, **Live · v3**, **Draft · 1 change**, or **Customised · shipped by office\_moves 1.0.0** for an app’s page you’ve changed. - The **Design** tab is the visual editor. **JSON** shows the same page as a document, and **History** lists every applied version. - On the left, the **Outline** lists the page and its blocks in order (select one to edit it, move it up or down, duplicate or delete it), and the **Library** below lists the blocks you can add. - The canvas lays blocks out on a 12-column grid. The **−** and **+** on a block make it narrower or wider. - On the right, the properties panel edits the page, or the selected block. Undo and redo are the arrows at the right of the tab bar. ## Page settings Select **Page** at the top of the outline: | Setting | What it does | | --- | --- | | Key | The page’s permanent identifier, in lower\_snake\_case. You can’t change it after the first apply. | | Title, Description | Shown at the top of the page. | | App | The app the page belongs to: it shows in that app’s section of the navigation. The list has the apps installed in this workspace and the apps you’re building in **Build › Apps** (their pages show in the navigation before the app is published). **No app (URL only)** makes it a workspace page. | | Shown to | The roles that can open the page. None ticked means everyone in the workspace; owners and admins always see it. | | Show in the app’s navigation, Nav label | Adds the page to its app’s section in the navigation. | | Density | Compact or comfortable spacing. | ## Blocks | Block | Shows | | --- | --- | | Metric | One number: a count of records, or the sum or average of a numeric field | | Chart | Records grouped by a field (dates by day, week or month), as bars, lines, a pie or a table | | List | A table of records with the columns, filters, sort and number of rows you choose | | Rich text | Markdown. `{{viewer.name}}`, `{{viewer.role}}` and `{{today}}` are filled in for the viewer. | | Heading, Callout, Button, Image, Divider | Page structure and links | The library also lists approved custom components, and blocks that aren’t available yet together with what to use instead today. Each block has four tabs: - **Content**: its title, width (out of 12 columns) and the block’s own settings, such as a heading’s text. - **Data** (metric, chart and list): the **Entity** it reads; the measure or the columns (up to 8); **Filters**, where every condition must match and values can use `@me` and relative dates such as `@today-14d`; and for lists the sort and the number of rows (1 to 50). A note at the bottom lists the fields the block reads. - **Visibility**: roles that see this block. None ticked means everyone who can see the page. - **JSON**: the block as a document, for settings the form doesn’t cover. ## Preview Switch the canvas from **Layout** to **Preview** to see the page with live data while you edit. Pick a width (1440, 1024 or 390 px) and whose view to show: **As you**, or as any role in the workspace. **Preview** in the header opens the draft in its own browser tab, at full size, without saving anything. ## Save your work Nothing you do in the builder is live until you apply it. - **Plan** shows what applying would change, for example `Create __tenant__/page/loans_desk` with `+ add heading`, `+ add metric`, and whether you hold `build:pages`. - **Apply** puts the page live. Each apply is a new version on the **History** tab. - **Save as changeset** saves the draft for review instead. The builder stays on that changeset (**Save to changeset**, **Apply changeset**) until it’s applied. See [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md). \[Screenshot: The Plan dialog for a new page: Create tenant/page/loans\_desk, with the four blocks it adds and the Close, Save as changeset and Apply buttons\] If someone else changed the page while you were editing, **Apply** shows either **Merged with newer changes** (your edits and theirs touch different parts: review and **Apply merged**) or **Conflicting changes** (you both changed the same value: choose a value for each, then plan again). Nothing is overwritten without you seeing it. See [Base hashes and merges](https://docs.ligament.ai/guides/building-apps/index.md#base-hashes-and-merges). If your role doesn’t hold `build:pages`, the plan says so and offers **Save as changeset**, so someone who holds it can apply your page. ## The JSON tab The **JSON** tab shows exactly the document that `GET /api/spec/page/` returns, so what you see here is what an agent or the [CLI](https://docs.ligament.ai/reference/cli/index.md#spec-pull) reads and applies. You can edit it directly: the tab validates as you type, marks it **Valid** or lists each problem with its path, and your edits show up in the Design tab. \[Screenshot: The JSON tab of the Loans desk page, showing the page document with its heading, metric and list blocks, marked Valid\] ## Custom components A custom component is a block a developer writes and uploads; it runs in a sandbox and can only read the data it was approved for. A new component version waits until someone with the **Approve custom components** permission approves it in **Build › Components**. Owners have it, and can grant it to other roles in **Settings › Access › Roles**. In the library, **Custom components** lists each component’s latest approved version. A component with a new version waiting shows “v1.1.0 needs approval”; one with no approved version shows “Needs approval (Build → Components)” and can’t be added yet. On a custom block’s **Data** tab, each dataset shows whether the component is approved to read the entity you pick. ## Pages that apps ship Pages that come with an installed app open in the same builder. Your changes are stored as your customisation of the app’s page, and an upgrade of the app keeps them. If the app’s author made the app additive-only or locked, the plan tells you what you can’t change. See [Upgrades and your customisations](https://docs.ligament.ai/guides/building-apps/upgrades/index.md). --- # Upgrades and your customisations > How app upgrades keep your changes, how to review the values that clash, and how an app author limits what installers may change. Source: https://docs.ligament.ai/guides/building-apps/upgrades/ When you change a page that an installed app ships, Ligament keeps your change separate from the app’s version of the page. When you upgrade the app, it combines the new version with your change instead of replacing it. When you both changed the same value, yours is kept and flagged for you to review. ## Two layers Every page an installed app ships has a `base` layer, the app’s version, which you can’t edit. The first time you change it, your version is saved as a `custom` layer on top, and that’s what runs. The page builder then shows the page as **Customised · shipped by office\_moves 1.0.0**, and the plan describes your edits as a *Customisation of the shipped office\_moves version*. To go back to the app’s version, apply the shipped document again, or send the item with `"delete": true`. The plan calls that a reset: *reset to the shipped office\_moves version*. ## Upgrade an app Open the **App Store** and select **Updates available**. Each app with a newer version has an **Update to v1.1.0** button. It opens a summary of the upgrade: the version change, the author’s release notes, every change the new version makes, and whether it changes fields that hold data. Select **Update** to upgrade. If an upgrade would remove or reshape fields that hold data, the summary lists what’s at risk and asks you to confirm. Over the API, `POST /api/apps/upgrade` with `{ "appKey": "office_moves", "preview": true }` returns the same assessment without changing anything; an upgrade at risk answers `409` until you send `"confirm": true`. Upgrading needs a workspace admin, or a key with the `apps:install` scope. ### What the summary lists The summary lists every change the new version makes, grouped by what it changes: the app’s settings and store listing, navigation, dependencies, entities, fields, form and panel options, form layouts, states, transitions, business rules, ACLs, SLAs, seed records, hierarchies, effective dating, workflows, scripts, agents, connectors, widgets, saved views, reports, dashboards, pages, fields the app adds to other apps’ entities, and its access model (one line per permission set, role and restriction). A change that fits none of these is listed under **Other**, so nothing a version changes is left out. When the upgrade touches something you can edit in your workspace, the line says what happens to your copy: | Label | Meaning | | --- | --- | | **Added** | The workspace doesn’t have it yet; the upgrade creates it (for example the default form layout of an entity that had none). | | **Takes new** | You never changed your copy, so it follows the app. | | **Kept yours** | You changed your copy, so the upgrade leaves it as it is. | | **Merged with yours** | A page you customised is re-based, as described below. | In the API response, each line is an item of `assessment.diff.changes`, with `category`, `target`, `op` (`add`, `remove` or `change`), the changed `paths`, a `summary`, and `customised` and `resolution` when your copy is involved. ### Form layouts, views, reports and dashboards An upgrade never overwrites an entity’s default form layout that you edited. The summary lists it as **Kept yours**, with a **Take new** checkbox: tick it to replace your layout with the new version’s. Over the API, send the entity keys in `takeLayouts`, for example `{ "appKey": "csm", "takeLayouts": ["success_signal"] }`. Where the record page shows Activity and Attachments is kept either way, and on a kept layout the app’s default placement still updates. The same goes for the shared saved views, reports and dashboards an app ships: one you edited is kept, and one you never changed takes the new version. A kept layout can miss a field the new version made required, or one an earlier layout left out. The create form never blocks on that: every required field that the layout leaves out (and that has no default and isn’t filled in automatically) appears in a **Required** section at the top of the form. Admins see a link to the form layout there, so they can place the field properly. If a save still fails on a field the form doesn’t show, the message names the field and says how to add it to the layout. App authors: publishing refuses a manifest whose `layout` leaves out a required field, or whose `formOptions.hiddenFields` hides one, unless the field is filled in automatically (an auto-number, a calculated field, or a before-create rule that sets it). The error names the entity and the field. ### Connectors A connector an app ships keeps the connection settings you gave it: its base URL, allowed hosts and authentication (which secret, which header). The upgrade takes the new version’s value only for a setting you left as the previous version shipped it; its operations always follow the new version. If the upgrade can’t tell what the previous version shipped, your settings are kept. ### Access An app that ships its access model in its manifest upgrades it the same way: your changes to its permission sets, roles and restrictions are kept, and a change in the new version that would give anyone more access isn’t applied until you approve it. The summary lists those under **These changes widen access**; tick the ones to approve, and the others stay as they are and are offered again next time. Over the API, an upgrade with an undecided widening change answers `409` (`access_widening`); send `approveAccess`, `keepAccess` or `holdAccess`. See [Access in the manifest](https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/index.md#upgrade). ### Seed records The default records an app ships with an entity (its `seed`) are created once. An upgrade creates only the rows the workspace doesn’t have yet, matched by the entity’s `seedKey` field, or else by the row’s `key`, `code` or `name`. A seed row with none of these is created on the first install only. An upgrade never changes or deletes a record created from a seed row. ## What happens to your changes For every page the new version ships, Ligament compares three documents: the old shipped page, your customised page and the new shipped page. | Situation | Result | | --- | --- | | You never changed the page | The new shipped page goes live. | | You and the app changed different things | Your page is re-based: it gets the app’s changes and keeps yours. | | You and the app changed the same value | Your value is kept, and the clash is listed for review in Build › Changes. | | The combined page no longer validates | Your page stays exactly as it was, and that is listed for review too. | | The new version no longer ships the page | A page you customised stays, as the workspace’s own page. A page you never changed is removed. | An example: Northwind customised the Office moves home page, changing the heading from “Desk moves” to “Desk moves at Northwind HQ”. Version 1.1.0 of the app changed the same heading to “Desk moves and floor changes” and showed 20 upcoming moves instead of 10. After the upgrade, the page shows 20 moves and keeps Northwind’s heading, and the heading is listed as a conflict. The page’s history records the upgrade as *office\_moves 1.1.0 re-based (1 conflict kept your value)*. ## Review the conflicts **Build › Changes** lists **Upgrade conflicts** above the changesets: one line per page, with the number of values to review. Select a page to open its review: \[Screenshot: Upgrade conflicts for the Office moves page: the path blocks\[id=intro\].props.text with the old shipped value Desk moves, your kept value Desk moves at Northwind HQ and the new shipped value Desk moves and floor changes\] For each value you see the old shipped value, your value (kept) and the new shipped value. - Every value starts on **Keep my value**. Select **Keep my values** to mark the list reviewed: nothing on the page changes. - Switch a value to **Take the shipped value**, and the button becomes **Take 1 shipped value and mark reviewed**. That applies a new version of your customisation with the shipped value; values you left on Keep my value stay as they are. Either way, the page leaves the Upgrade conflicts list. Make all your choices for a page before you save: saving clears that page’s whole list. From the API, `GET /api/spec/
` returns the open conflicts of a customised artefact in `conflicts`, and `GET /api/spec/conflicts` lists every artefact with conflicts. ## How much installers may change An app’s author decides how much the workspaces that install it may change, with the app’s edit policy. For an app you build in Build › Apps, it’s **How much installers can customize it** on the app’s Overview; in an [app manifest](https://docs.ligament.ai/developers/app-spec/index.md) it’s `editPolicy`. It applies to the app’s pages, entities, fields and workflows. | Policy | Installers can | | --- | --- | | `full` (default) | Change anything: add fields, edit labels, customise pages, override workflows | | `additive` | Add their own fields, entities and page blocks, but not change or remove what the app ships | | `locked` | Change nothing the app ships | Under `additive`, a page change that keeps everything the app ships and adds to it plans fine. A change to something shipped is refused in the plan: ```text spec.additive: the "office_moves" app is additive-only: you can add to office_moves/page/office_moves_home but not change or remove what it ships ``` The comparison is with the shipped page, so a page you customised before the author switched to `additive` has to be reset to the shipped version before you can add to it. Under `locked` the plan answers `spec.locked`. The policy is read from the version you have installed, so it changes when you upgrade. Fields follow the same rule. Under `additive`, renaming a field the app ships (or changing whether it’s required) is refused with `403` and the code `app_edit_policy`; adding your own field works. Under `locked`, every field change is refused, including removing a field you added: ```json { "error": "This is part of the \"office_moves\" app, which is additive-only (you can add your own fields, but not modify what the app ships).", "code": "app_edit_policy", "message": "This is part of the \"office_moves\" app, which is additive-only (you can add your own fields, but not modify what the app ships).", "fix": "Add your own field (or entity) instead of changing the one the app ships, or ask the app's author for a version that changes it.", "policy": "additive", "app": "office_moves", "doc_url": "https://docs.ligament.ai/guides/building-apps/upgrades/#how-much-installers-may-change" } ``` Overriding a workflow the app ships answers the same way under `additive` and `locked`. --- # Money and currencies > Exact amounts with a currency, decimal numbers, totals per currency, exchange rates and convert(), and converting existing number fields. Source: https://docs.ligament.ai/guides/building-apps/money/ Ligament stores amounts exactly. A **money** field holds an amount and its currency, and a **decimal** field holds an exact number without a currency, such as a quantity, a rate or a percentage. Neither ever goes through a floating-point number, so `0.1 + 0.2` is `0.3`, and a total over 10,000 rows is right to the last cent. For the JSON, CSV and API details, see [Money in the API](https://docs.ligament.ai/developers/money/index.md). ## Field types | Type | Use it for | Example value | | --- | --- | --- | | Money | Prices, deal amounts, salaries, invoice totals | 1,234.50 USD | | Decimal | Quantities, unit rates, percentages, scores | 0.125 | | Number | Counts and other whole numbers you don’t add up as money | 42 | Pick the type in **Build › Data** when you add a field, or set `type: 'money'` or `type: 'decimal'` in an app manifest. ### Currency A money field gets its currency in one of two ways: - **A fixed currency**: every record uses the same one. A US sales pipeline might use USD. - **The record’s currency field**: a text or choice field on the same record holds an ISO 4217 code, so each record can have its own currency. The HR app’s salary works this way: the employee’s **Currency** field says THB, SGD, EUR or USD. When an amount is saved and the record’s currency field is empty, it’s filled in from the amount. An amount in a different currency from the field’s is refused, never converted silently. To convert, use [`convert()`](#converting-between-currencies). ### Decimal places Money uses the currency’s minor units: JPY has 0 places, USD and EUR 2, KWD 3. Unit prices and rates often need more, so a field can declare a larger **scale** (places), for example 4 for a per-unit price. Decimal fields default to 2 places. Ligament never rounds what you type. If you enter more places than the field allows, it tells you, for example “USD amounts have at most 2 decimal places”, and nothing is saved. ### Rounding Rounding only applies to values Ligament computes: formulas, averages and conversions. The default is **half-even**, also called banker’s rounding: 0.125 becomes 0.12 and 0.135 becomes 0.14. It avoids drifting upwards over many rows. A field can choose **half-up** instead, where 0.125 becomes 0.13, if your rules require it. ## How amounts look Amounts are shown in your browser’s language and region, with the currency symbol or code. The same 1234.50 USD reads `$1,234.50` in American English, `1.234,50 $` in German, `US$1,234.50` in British English and `USD 1,234.50` in Australian English. Table columns of amounts are right-aligned with figures of equal width so they line up. Inputs accept the field’s places only, and you can type or paste grouping separators: they’re removed before the value is saved. ## Totals and reports Amounts in different currencies are never added together. - **List totals and group subtotals** show one line per currency, such as `120,000.00 USD · 85,500.00 EUR`. - **Reports and dashboard blocks** (KPIs, charts) show a figure per currency. A chart that mixes currencies labels its bars with the currency, for example `Won (EUR)`. - **Rollups** (a parent’s sum of its children’s amounts) are exact. If the children are in more than one currency, the rollup is left empty rather than mixing them. - **Averages** are computed exactly and rounded to the field’s places with its rounding mode. To compare across currencies, convert first: add a calculated money field with a fixed currency whose formula uses `convert()`. The totals of that field are then in one currency. ### Masked amounts Money fields follow the same [field levels and masks](https://docs.ligament.ai/guides/access/index.md) as any other field. If you can’t read an amount in clear on every row of a list, that list shows **no total** for it, and reports show no figure. With rules that depend on the record (a manager reads the pay of the people below them), a list whose rows are all in clear for you, such as a manager’s own team, does show its total. A total never reveals a masked amount. Filtering on an amount you can’t read returns nothing, so a filter can’t be used to guess values either. ## Exchange rates Exchange rates live in the **Exchange rates** module, which installs itself the first time an admin enters a rate. Each currency pair, such as EUR → USD, is one record, and its rate is [effective-dated](https://docs.ligament.ai/guides/effective-dating/index.md). Entering a new rate from a date adds a dated change, so every past rate stays available, and a conversion “as of” any date uses the rate that was in force then. - **Enter rates by hand.** Open **Exchange rates** in the data browser, or use the API or CLI below. Admins and owners can set rates, and everyone else can read them. - **Pull rates from a source.** The curated *Frankfurter* connector (European Central Bank reference rates) is **off by default**. An admin can enable it in **Build › Extensions › Connectors** and run a sync. Each rate that changed is written as a dated change with the source’s name. A rate reads “1 base = rate quote”: EUR → USD 1.0845 means 1 EUR = 1.0845 USD. If only the opposite pair exists, Ligament uses its inverse (1 ÷ rate) and says so. ### Converting between currencies In a calculated field’s formula: ```plaintext convert({{amount}}, "USD") // today's rate convert({{amount}}, "USD", {{close_date}}) // the rate in force on the close date ``` The result is rounded half-even to the target currency’s places. Every conversion records the rate and the date it took effect, and the record shows them under the value, for example *Converted from €1,250.00 at 1.0845 (manual rate of Nov 1, 2026)*. Converting to the same currency uses rate 1. If there’s no rate for the pair on that date, the formula reports “No exchange rate from EUR to USD on 2026-10-01” instead of guessing. ## Importing and exporting - **CSV export** writes a money field as two columns: the plain amount (`1234.50`, with no symbol or grouping and `.` for decimals) and `_currency` (`USD`) right after it. Decimal fields are written exactly as stored. - **Imports** read amounts such as `$1,234.50`, `1.234,50 €`, `USD 1,234.50` or `(12.00)` for a negative amount. Every row is checked before anything is written. Rows that don’t fit are listed with the row number and the reason (“Row 14, Amount: USD amounts have at most 2 decimal places”), and nothing is imported until they’re fixed. - A spreadsheet cell stored as a number keeps only about 15 significant digits. If a longer number arrives, the import asks you to store that column as text in the spreadsheet. ## Converting existing number fields Older apps may hold amounts in **Number** or **Currency** fields as plain numbers. Admins convert them in **Settings › Data › Money fields**: 1. The page lists fields that look like amounts: every Currency field, and Number fields named like money (amount, price, cost, salary, revenue, fee, budget, total and similar). 2. Pick a field, then choose a fixed currency or a currency field. **Check conversion** runs a dry run over every record and every dated version. It shows how many values convert exactly and lists any that wouldn’t, such as a value with more places than the currency allows, or text that isn’t a number. 3. If the check is clean, **Convert** applies it in one step. Values are copied exactly; nothing is rounded. If anything changed since the check, the conversion is refused and you run the check again. Fix any listed values first (or pick a currency with more places). A conversion is never applied with values that would change. First-party apps such as CRM, HR and Customers core already use money fields. Upgrading one converts its existing values the same way. The upgrade preview shows the plan, and the upgrade stops if any value wouldn’t convert exactly. --- # Access in the manifest > Ship your app's permission sets, roles and restrictions in its manifest: the install creates them in one step, upgrades keep the workspace's edits and never widen access without an admin's approval, and uninstalling removes them. Source: https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/ An app can ship its **access model** in its manifest, under `access`: the permission sets, roles and restrictions that decide who sees and does what in the app. Installing the app creates them in the workspace’s [spec store](https://docs.ligament.ai/guides/building-apps/index.md), owned by the app, in the same step as its records, pages and workflows. Nobody has to apply anything after the install. The HR app is built this way: its sets, roles and restrictions (pay for HR and the managers above an employee, leave reasons for the employee and HR only, no approving your own leave) are in its manifest. See [HR › Set it up](https://docs.ligament.ai/guides/hr/index.md#set-it-up). ## What goes in it | Key | What it holds | | --- | --- | | `permissionSets` | Grants on the app’s entities and fields, and capabilities. Keys are `.`, for example `hr.employee` | | `roles` | Roles that hold permission sets. Keys are `_`, for example `hr_admin` | | `restrictions` | Rules that take access away whatever grants it: forbidden actions, field caps, and field caps per record with `unlessWhere` (for example: pay is masked except on your own record) | | `appAdminRole` | The role whose holders administer the app’s access without being workspace admins. It must hold a set with the capability `app.admin@` | Field classifications stay on the fields (`classification: 'pii'` or `'sensitive'`), and follow the same rules as the rest of the access model. The documents have the same shape as the spec store’s `permissionSet`, `role` and `restriction` artefacts (`GET /api/spec/schema/`), without `app`: it’s the app that ships them. Every field is in the [manifest reference](https://docs.ligament.ai/reference/app-manifest/index.md#field-access). ```ts export default defineApp({ key: 'leave', version: '1.0.0', releaseNotes: '1.0: leave requests with manager approval.', entities: [/* leave_request … */], access: { permissionSets: [ { key: 'leave.staff', label: 'Leave: my requests', grants: [{ entity: 'leave_request', ops: ['read', 'create', 'update'], where: { left: '{{employee_user}}', op: 'eq', right: '@me' } }] }, { key: 'leave.admin', label: 'Leave: administer', grants: [{ entity: 'leave_request', ops: ['read', 'update', 'delete', 'transition'] }], capabilities: ['app.admin@leave'] }, ], roles: [ { key: 'leave_staff', name: 'Leave: staff', permissionSets: ['leave.staff'] }, { key: 'leave_admin', name: 'Leave: admin', permissionSets: ['leave.staff', 'leave.admin'] }, ], restrictions: [ { key: 'leave.reason_private', entity: 'leave_request', fields: { reason: 'hidden' }, unlessWhere: { left: '{{employee_user}}', op: 'eq', right: '@me' }, enforceOnAdmins: true, message: 'The reason is for the employee only.' }, ], appAdminRole: 'leave_admin', }, }) ``` `ligament app validate` and publishing check the access model against the manifest: the keys carry the app’s name, a role’s sets exist, restrictions are on the app’s own entities, an app can’t ship `workspace.admin` or administer another app, and the app-admin role holds `app.admin@`. The install then checks every document against the workspace, as any apply would (entities, fields, conditions, capabilities), and refuses an access model that doesn’t fit. ## Install Installing the app (from the App Store, `POST /api/apps/install` or `ligament app install`) creates the access model in one step: - each set, role and restriction is applied through the spec store, with a version row and an access audit entry, and its address names the app: `leave/role/leave_admin`; - what this version shipped is kept as the artefact’s `base` layer, so the next upgrade knows what you changed; - deleting one of the app’s artefacts is refused (`spec.delete_base`): change it, or uninstall the app. After the install, give people the app’s roles in **Settings › Access › Assignments**. ## Change it in your workspace The app’s access model is yours to adjust like any access artefact: in **Settings › Access**, or by planning and applying it in the spec store. The artefact then shows as customised: what’s in effect differs from what the app shipped. ## Upgrade An upgrade compares three versions of every artefact: what the installed version shipped, what is in effect in your workspace, and what the new version ships. | Situation | Result | | --- | --- | | You never changed it | The new version applies. | | You changed it, the app changed something else | Your change is kept and the app’s change is merged in. | | You and the app changed the same value | Your value is kept, and the plan says so. | | You deleted it | It stays deleted. | | The new version no longer ships it | Removed if you never changed it; otherwise kept as the workspace’s own. | **Nothing widens access silently.** Every change is simulated against your members, the same way as the [effective-access diff](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md) of any access change, and also checked for what the simulation can’t see: a restriction removed or relaxed, a forbidden action or transition dropped, a capability or a permission set added, a classification removed. A change that would give anyone more access needs your approval: - the upgrade summary lists it under **Access** as *widens access: needs your approval*, with the reason; - `POST /api/apps/upgrade` answers `409` with `code: "access_widening"` and the `pending` addresses until you decide on each one; - send `approveAccess` (a list of addresses, or `"all"`) to apply them, or `keepAccess` to keep your version for good. `takeAccess` takes the new version of something you changed (still subject to approval if it widens). Changes that only take access away, or change nothing anyone can do, apply without asking. If an install runs without your decision (for example from the CLI), a widening change is held: nothing changes, and the next upgrade plan offers it again. ```json POST /api/apps/upgrade { "appKey": "leave", "version": "1.1.0", "approveAccess": ["permissionSet/leave.staff"], "keepAccess": ["restriction/leave.reason_private"] } ``` ## Uninstall Uninstalling the app removes its roles and permission sets. `{ "preview": true }` on the uninstall (`POST /api/store//unsubscribe` or `POST /api/apps/uninstall`) returns the plan first: who loses what, member by member. The app’s records stay after an uninstall, so nothing is removed that would open them up. These are kept, as the workspace’s own and held by nobody, unless you approve their removal with `approveAccess`: - restrictions (pay masked, leave reasons private, no approving your own leave); - permission sets that keep the app’s records closed to everyone else. Without any set granting on an entity, every seat would get the default access to it. A role that someone holds as their seat role is kept too, with the sets it holds. The plan’s diff shows only what is actually removed. Role assignments stay, and apply again if you install the app again; installing it again creates the access model afresh. ## Built-in modules Built-in modules such as People and Customers upgrade the same way, from **App Store › Updates available** or `POST /api/apps/upgrade` with the module’s key. The summary compares the module’s new version with what your workspace’s tables hold: its entities and fields, the money conversions with their dry run, and access. `"preview": true` changes nothing. --- # Single sign-on > Connect a SAML identity provider so people at your company sign in with their work account. Source: https://docs.ligament.ai/guides/identity/sso/ Single sign-on (SSO) lets your staff sign in to Ligament through your company’s identity provider (IdP), such as Microsoft Entra ID, Okta or Google Workspace. Set it up when you want your IdP, not Ligament, to decide who can sign in and how. Ligament is the SAML 2.0 service provider: it trusts what your IdP asserts about a person. SSO is configured per workspace, in **Settings › Single sign-on**, and only workspace admins can see that page. One workspace can use SSO while others keep email sign-in. ## Before you start - Verify your email domain first. Ligament only accepts an identity provider for a domain your workspace has proved it owns, in **Settings › Domains**. See [Verified domains](https://docs.ligament.ai/guides/identity/domains/index.md). - You need admin rights in your IdP to create an enterprise application. - Decide which role newcomers get. People who sign in for the first time join with the default role you set on the verified domain. ## How the setup fits together SAML is an exchange of identifiers in both directions: | From | Value | Where you find it | | --- | --- | --- | | Ligament | SP Entity ID: `https://app.ligament.ai/api/auth/sso/saml2/sp/metadata` | Settings › Single sign-on › Service provider details | | Ligament | ACS / Reply URL: `https://app.ligament.ai/api/auth/sso/saml2/sp/acs/` | On each configured provider, after you add it | | Ligament | SP metadata URL: `https://app.ligament.ai/api/auth/sso/saml2/sp/metadata?providerId=` | On each configured provider | | Your IdP | IdP Entity ID (issuer), SSO URL, signing certificate | The IdP’s federation metadata XML | The ACS URL contains a `providerId` that Ligament generates when you add the provider, so you create the app in your IdP first, add it to Ligament, then go back to the IdP to paste the ACS URL. ## Set up SSO with Microsoft Entra ID The steps below use Entra ID. Other SAML providers follow the same order; the field names differ. 1. In the Entra admin centre, open **Enterprise applications › New application › Create your own application**. Choose **Integrate any other application you don’t find in the gallery (Non-gallery)**, name it (for example “Ligament”) and select **Create**. 2. In the new app, open **Single sign-on** and choose **SAML**. Under **SAML Certificates**, download the **Federation Metadata XML**. 3. In Ligament, open **Settings › Single sign-on**. Under **Add a SAML identity provider**, enter your verified **Email domain** (for example `northwind-example.com`) and paste the metadata XML into **IdP metadata XML**. The XML fills the IdP Entity ID, SSO URL and certificate for you. You can also type those three fields by hand. 4. Select **Add provider**. The provider appears under **Configured providers** with its own **ACS / Reply URL** and **SP metadata URL**. 5. Back in Entra, open **Basic SAML Configuration › Edit** and set: - **Identifier (Entity ID)**: the SP Entity ID, `https://app.ligament.ai/api/auth/sso/saml2/sp/metadata` - **Reply URL (Assertion Consumer Service URL)**: the provider’s ACS / Reply URL, ending in `/sp/acs/` Leave Sign on URL, Relay State and Logout URL empty, then save. 6. Check which email address Entra sends (see [Attributes and claims](#attributes-and-claims) below). 7. Under **Users and groups**, assign the people or groups who should be able to sign in. \[Screenshot: The Add a SAML identity provider form in Settings › Single sign-on, with the Email domain, IdP metadata XML, IdP Entity ID, IdP SSO URL and IdP signing certificate fields\] If you add the provider before the domain is verified, Ligament refuses it with “Verify northwind-example.com under Settings → Domains before adding an SSO provider for it”. **Caution** Paste the **ACS / Reply URL** into Entra’s Reply URL, not the SP metadata URL. The two look alike on the settings page. Entra reports a wrong reply URL as error `AADSTS50011`. ## Attributes and claims Ligament requires the IdP to sign its assertions. From each assertion it reads: | Ligament uses | SAML attribute it looks for | If the attribute is missing | | --- | --- | --- | | Email address | `email` | The NameID | | Name | `givenName` and `surname`, else `displayName` | The NameID | Attribute names must match exactly. Entra’s default claims use long URI names, so with a default Entra app Ligament takes the email address from the NameID, which Entra sets to the user principal name. If your UPNs aren’t the same as people’s email addresses, change the **Unique User Identifier (Name ID)** claim to `user.mail`, or add a claim named `email` with no namespace. ## How people sign in On the sign-in page, a person enters their work email and selects **Sign in with SSO**. Ligament uses the email’s domain to find the provider of the workspace that verified that domain and sends them to the IdP. When the IdP signs them in, they land back in Ligament. Start sign-in from Ligament. Signing in from a tile in the IdP’s app portal (IdP-initiated SSO) isn’t supported. ### First sign-in creates the account The first time someone signs in with SSO, Ligament creates their account and adds them to the workspace that verified their email domain, with that domain’s default role. If the People app is installed, they also get a person record linked to their login. They don’t need an invitation. Someone who already has an account and an email invite to your workspace can accept it by signing in with SSO at the invited address (see [Inviting people](https://docs.ligament.ai/guides/workspaces/inviting-people/index.md)). To control access before the first sign-in, or to remove people automatically when they leave, add [SCIM provisioning](https://docs.ligament.ai/guides/identity/scim/index.md). ## SSO only accepts your own domains A provider can only sign people in at the domains it was added for, and only while your workspace holds the verified claim on that domain. Ligament checks this on the first sign-in and again on every sign-in after it, using the email address in the fresh assertion. If the IdP sends an address at any other domain, Ligament doesn’t sign the person in, doesn’t create an account and doesn’t add anyone to a workspace. The person sees this page: \[Screenshot: The Sign-in refused page: the identity provider signed you in with an email address outside the domains it is set up for, with error code sso\_domain\_mismatch and a Back to sign in button\] Every refusal is recorded. Find it in **Logs › Audit › Security & sign-ins** under the event type **SSO sign-in refused**, next to **SSO provider added** and **SSO provider removed**. ## Make SSO the only way in SSO works alongside the other sign-in methods. To stop people at your verified domain from using a password or a magic link, turn off **Allow password sign-in** and **Allow magic-link sign-in** in **Settings › Sign-in security › Policy**. Someone who then tries a password sees “Password sign-in is disabled for your organization. Use SSO or a passkey.” SSO and passkeys stay available. ## Groups and roles Roles for SSO users come from the domain’s default role and from what you assign in Ligament. To manage roles from your IdP’s groups, push the groups with [SCIM](https://docs.ligament.ai/guides/identity/scim/index.md) and map each group to roles in [Groups](https://docs.ligament.ai/guides/access/groups/index.md). Providers added in Settings › Single sign-on send only the email address and name, so Ligament doesn’t read group claims from them. ## Remove a provider Select **Remove** on the provider under **Configured providers**. People at that domain can no longer start an SSO sign-in; existing accounts stay, and they can sign in with any method your policy still allows. ## Troubleshooting | What you see | What to check | | --- | --- | | “No SSO provider found for this domain” after **Sign in with SSO** | The domain isn’t verified by any workspace, or no provider is configured for it. Check Settings › Domains and Settings › Single sign-on. The match is on the exact domain: `eu.northwind-example.com` is a different domain from `northwind-example.com`. | | Entra error `AADSTS50011` (reply URL mismatch) | The Reply URL in Entra must be the provider’s ACS URL ending in `/sp/acs/`, and only that one. Retry in a new private window: an open tab can replay the old request. | | “Sign-in refused” with error code `sso_domain_mismatch` | The IdP sent an email address at a domain the provider wasn’t added for, often a UPN like `priya.raman@northwind.onmicrosoft.com`. Fix the Name ID or `email` claim in the IdP, or verify that domain and add a provider for it. | | “Account not linked” | An account with this email address already exists and isn’t linked to the IdP. The person signs in the way they usually do. | | The person signs in but has the wrong role | New people get the default role of the verified domain. To change it for future sign-ins, claim the same domain again in Settings › Domains with a different role. Change the person’s own role in Admin › Members. | --- # SCIM provisioning > Create, update and remove people and groups from your identity provider. Source: https://docs.ligament.ai/guides/identity/scim/ SCIM lets your identity provider (IdP) manage who is in your workspace. When you assign someone to the Ligament app in Entra ID or Okta, the IdP adds them to the workspace; when you unassign them or they leave, it removes them. The IdP can also push groups, which you map to roles in Ligament. Use it with [single sign-on](https://docs.ligament.ai/guides/identity/sso/index.md) so that joining, role changes and offboarding all happen in the IdP. Ligament implements SCIM 2.0 at `https://app.ligament.ai/api/scim/v2`, with `Users` and `Groups` resources. ## Before you start - Verify your email domain in **Settings › Domains** (see [Verified domains](https://docs.ligament.ai/guides/identity/domains/index.md)). SCIM only adds people whose email address is at a domain your workspace has verified. - You need to be a workspace admin to create SCIM tokens. ## Connect your identity provider 1. In Ligament, open **Settings › Single sign-on** and scroll to **SCIM provisioning**. Copy the **Endpoint** (`https://app.ligament.ai/api/scim/v2`). 2. Select **Generate token**, give it a name you’ll recognise later (for example “Entra ID provisioning”) and select **Generate**. Copy the token now: it’s shown once. Tokens start with `scim_`. 3. In your IdP, open the provisioning settings of the Ligament app. In Entra ID that’s **Provisioning › Automatic**: paste the endpoint as **Tenant URL** and the token as **Secret Token**, then **Test Connection** and **Save**. 4. Turn provisioning on in the IdP. The token list shows each token’s name, when it was created and when the IdP last used it. To cut off an IdP, select its token and choose **Revoke**: provisioning with it stops at once and calls answer `401`. The token belongs to the workspace you created it in. Every call made with it reads and writes that workspace only. ## What the IdP can do | Resource | Operations | Notes | | --- | --- | --- | | `/Users` | `GET` (list, paged with `startIndex` and `count`, up to 200 a page), `POST`, `GET /Users/`, `PUT`, `PATCH`, `DELETE` | Filter by `userName eq ""`. Other filters return an empty list, so the IdP creates the user. | | `/Groups` | `GET`, `POST`, `GET /Groups/`, `PUT`, `PATCH`, `DELETE` | Filter by `displayName eq`, `externalId eq`, `id eq` or `members[value eq ""]`, joined with `and`. `excludedAttributes=members` leaves members out. | | `/ServiceProviderConfig`, `/Schemas`, `/ResourceTypes` | `GET` | What the IdP reads when it connects. | Bulk operations, sorting, ETags and password changes aren’t supported. The service provider config says so, and IdPs read it when you test the connection: ```json { "patch": { "supported": true }, "bulk": { "supported": false, "maxOperations": 0, "maxPayloadSize": 0 }, "filter": { "supported": true, "maxResults": 200 }, "changePassword": { "supported": false }, "sort": { "supported": false }, "etag": { "supported": false } } ``` ## Users The IdP identifies a user by `userName`, which must be their email address. A user resource looks like this: ```bash curl -s -G "https://app.ligament.ai/api/scim/v2/Users" \ -H "authorization: Bearer $SCIM_TOKEN" \ --data-urlencode 'filter=userName eq "agent@northwind-example.com"' ``` ```json { "schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"], "totalResults": 1, "startIndex": 1, "itemsPerPage": 1, "Resources": [ { "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], "id": "7y39vvpJhpSa1bmBIgKAzmhUMHYjyACg", "userName": "agent@northwind-example.com", "displayName": "Alex Agent", "active": true, "meta": { "resourceType": "User", "location": "https://app.ligament.ai/api/scim/v2/Users/7y39vvpJhpSa1bmBIgKAzmhUMHYjyACg" }, "name": { "formatted": "Alex Agent", "givenName": "Alex", "familyName": "Agent" }, "emails": [{ "value": "agent@northwind-example.com", "primary": true, "type": "work" }] } ] } ``` What each call does: | The IdP sends | Ligament does | | --- | --- | | `POST /Users` | Adds the person to the workspace with the role Member. If they already have a Ligament account (from another workspace, or an earlier sign-up), that account joins; otherwise a new one is created. If the People app is installed, they also get a person record. If they are already a member, the existing resource comes back unchanged. | | `PATCH` or `PUT` with a new name | Sets the person’s display name in this workspace. Their name in other workspaces they belong to doesn’t change. | | `active: false`, or `DELETE /Users/` | Removes the person from the workspace (deprovisioning) and from every group in it. Their Ligament account itself isn’t deleted. | | `active: true` again | Adds them back, with no groups until the IdP pushes them again. | The workspace owner is never removed by SCIM. A `GET` for someone who isn’t a member of this workspace returns `404`. Role changes don’t come through `/Users`. Give people roles with groups (below) or in **Admin › Members**. ### Only people at your verified domains SCIM can only add someone, new or existing, if their email domain is verified by this workspace. For any other address the call fails and nothing is written: ```json { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "status": "403", "detail": "Can't provision or link a user at northwind-example.com: it isn't a domain this workspace has verified. Verify it under Settings → Domains first." } ``` If you see this in the IdP’s provisioning log, verify the domain in **Settings › Domains**, or remove people at other domains (contractors with personal addresses, for example) from the app’s assignment. ## Groups and roles A group pushed by the IdP appears in **Settings › Access › Groups** with the source **SCIM** and its external ID. Its members are the people the IdP lists, and you change membership in the IdP, not in Ligament. A group gives nothing until you map it to roles. Open the group and select **Edit role mapping**. From then on, everyone the IdP puts in the group holds those roles, and loses them as soon as the IdP takes them out. See [Groups](https://docs.ligament.ai/guides/access/groups/index.md) for mapping roles to groups. \[Screenshot: A SCIM group named IT Field Engineers in Settings › Access › Groups: its badge shows the external ID, it is not mapped to a role yet, and Alex Agent is listed as a member added by SCIM\] Rules the group endpoints follow: - A member’s `value` is the Ligament user `id` that `/Users` returns. Every member must already be in the workspace. If one isn’t, the whole request fails with `400` (`scimType: invalidValue`) and names the user: `Not a user of this workspace: "usr_doesnotexist"`. - `PATCH` supports `add`, `remove` and `replace` on `members`, `displayName` and `externalId`, including the `members[value eq ""]` path that Entra ID and Okta send to remove one member. - The IdP only sees groups it created. Groups you made by hand in Ligament aren’t visible or editable over SCIM. - Every group change is recorded in **Settings › Access › Audit**, with the token as the source. Adding a member to a group: ```bash curl -s -X PATCH "https://app.ligament.ai/api/scim/v2/Groups/grp_9c640a1a82f9169609ea8c69" \ -H "authorization: Bearer $SCIM_TOKEN" \ -H 'content-type: application/scim+json' \ -d '{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations": [{ "op": "add", "path": "members", "value": [{ "value": "ixO3gz5g8e3XQY4PvpXkT6dQD32DlB5P" }] }] }' ``` The response is the full group, now with both members. ## Errors SCIM errors use the standard error envelope (`urn:ietf:params:scim:api:messages:2.0:Error`) with `status` and `detail`: | Status | Detail | Meaning | | --- | --- | --- | | 401 | Invalid or missing SCIM bearer token | The token is wrong or was revoked. | | 401 | This workspace has been suspended | Provisioning is paused while the workspace is suspended. | | 403 | Can’t provision or link a user at … | The email domain isn’t verified by this workspace. | | 400 | userName is required | `POST /Users` without `userName`. | | 400 | Not a user of this workspace: ”…” | A group member isn’t in the workspace. | | 404 | User not found / Group not found | Not in this workspace. | The SCIM endpoints are listed with the rest of the API in the [REST API reference](https://docs.ligament.ai/reference/rest-api/index.md#scim). --- # Verified domains > Prove you own an email domain so sign-ups, SSO and SCIM for it reach your workspace. Source: https://docs.ligament.ai/guides/identity/domains/ A verified domain tells Ligament that addresses like `priya.raman@northwind-example.com` belong to your workspace. You verify a domain by publishing a DNS TXT record. Until you do, the domain does nothing: claiming it alone routes no one to your workspace. Verify a domain when you want any of these: - New people at the domain join your workspace when they first sign in or sign up, instead of getting a workspace of their own. - Your [sign-in policy](#what-a-verified-domain-does) applies to everyone at the domain. - Email sent to an address at the domain can become tickets through Email intake. - You can connect [single sign-on](https://docs.ligament.ai/guides/identity/sso/index.md) and [SCIM](https://docs.ligament.ai/guides/identity/scim/index.md) for the domain. Both require it. Only workspace admins can claim, verify and remove domains. ## Claim and verify a domain 1. Open **Settings › Domains**. 2. Enter the **Email domain**, for example `northwind-example.com`, without `@` or `www`. 3. Under **New members get**, choose the role for people who join through this domain: **Member (agent)** or **Viewer (end user)**. A domain can’t hand out the owner or admin role. 4. Select **Claim**. The domain appears as **Pending verification** with the TXT record to publish. 5. At your DNS provider, add the TXT record shown: | Type | Name | Value | | --- | --- | --- | | TXT | `_ligament-verify.` | `ligament-verify=` | The token is different for every claim. Copy both lines from the settings page. 6. Back in Ligament, select **Verify**. When Ligament finds the record, the badge changes to **Verified**. \[Screenshot: Settings › Domains with northwind-example.com pending verification, with the TXT record Name and Value to publish\] If the record isn’t there yet, nothing changes and Ligament tells you which record it looked for: ```text No TXT record "ligament-verify=f5366abface39fb58a4c9495eae23b86" found at _ligament-verify.northwind-example.com yet. DNS changes can take a while to appear. ``` DNS changes can take from a few minutes to a few hours to reach every resolver. Select **Verify** again later. You can leave the TXT record in place after verification. ## What a verified domain does | Feature | Effect once the domain is verified | | --- | --- | | Sign-up and first sign-in | Someone with an address at the domain who signs up, or signs in for the first time with SSO or a magic link, joins your workspace with the domain’s role. They also get a person record if the People app is installed. Email and password sign-ups join after they confirm their address. | | Sign-in policy | The **Allow password sign-in** and **Allow magic-link sign-in** switches in **Settings › Sign-in security › Policy** apply to everyone signing in with an address at the domain, whichever workspace they belong to. | | Inbound email | Mail to any address at the domain that your mail provider forwards to Ligament is routed to your workspace by **Settings › Email intake**. | | Single sign-on | You can add an identity provider for the domain, and that provider may only sign in people at your verified domains. See [Single sign-on](https://docs.ligament.ai/guides/identity/sso/index.md). | | SCIM | Your identity provider can add people at the domain. Addresses at unverified domains are refused. See [SCIM provisioning](https://docs.ligament.ai/guides/identity/scim/index.md). | To change the role new people get, claim the same domain again with a different role under **New members get**. This only affects people who join from then on; change existing members in **Admin › Members**. A verified domain also lets you create an invite link that only people at the domain can use, for example to bring in colleagues who already have an account in another workspace. See [Inviting people](https://docs.ligament.ai/guides/workspaces/inviting-people/index.md#create-a-link-for-a-verified-domain). ## One workspace per domain Several workspaces can hold a pending claim on the same domain, because a pending claim proves nothing. The first workspace to verify it owns it. After that, other workspaces can’t claim or verify the domain and see “That domain is already verified by another workspace”. If your company runs several workspaces (for example a group and its [subsidiaries](https://docs.ligament.ai/guides/workspaces/subsidiaries/index.md)), verify each domain in the workspace where new people should land. ## Remove a domain Select the bin icon (**Unclaim**) on the domain’s row. From then on, people at the domain no longer join your workspace automatically, the sign-in policy no longer applies to them, and SSO and SCIM for the domain stop working. People who already joined stay members. ## Use the API The same actions are available to an API key with the `sso:write` scope; listing needs `settings:read`. | Action | Request | | --- | --- | | List claims and their TXT records | `GET /api/domains` | | Claim | `POST /api/domains` with `{"domain": "northwind-example.com", "defaultRole": "member"}` | | Verify | `POST /api/domains/verify` with `{"id": ""}` | | Remove | `DELETE /api/domains?id=` | ```bash curl -s -X POST "https://app.ligament.ai/api/domains" \ -H "authorization: Bearer $LIGAMENT_API_KEY" \ -H 'content-type: application/json' \ -d '{"domain": "northwind-example.com", "defaultRole": "member"}' ``` ```json { "domain": { "id": "cmx6alxti00bz6x6smslbpf2n", "workspaceId": "cmx1vqasf0038emmiqvf4d7u9", "domain": "northwind-example.com", "defaultRole": "member", "verificationToken": "f5366abface39fb58a4c9495eae23b86", "verifiedAt": null, "createdAt": "2026-12-02T15:40:44.022Z" } } ``` `GET /api/domains` adds a `txtRecord` object with the `name` and `value` to publish. The verification token and the TXT record are secrets until the domain is verified, so only a key with `sso:write` or `settings:write` (or a signed-in admin) sees them. A key with only `settings:read` gets every claim with `"verificationToken": null`, `"txtRecord": null` and `"tokenRedacted": true`. A claim with `"defaultRole": "admin"` fails with `422`. See [Domains](https://docs.ligament.ai/reference/rest-api/index.md#domains) in the API reference. --- # Security overview > Who can get into your workspace, how invites, domains, SSO and SCIM keep it that way, and where to see what happened. Source: https://docs.ligament.ai/guides/identity/security/ This page sums up how people get into a workspace and what stops anyone else. Each section links to the page with the details. ## Who can join There are four ways in. Apart from an open link, which you create on purpose, none of them works for an address you haven’t invited or a domain you haven’t verified. | Way in | Who it lets in | Details | | --- | --- | --- | | Email invite | Only the invited address, signed in and verified, once | [Inviting people](https://docs.ligament.ai/guides/workspaces/inviting-people/index.md) | | Domain or open link | Verified addresses at one of your verified domains, or anyone with an open link, until the link expires (30 days at most), runs out of uses or is revoked | [Inviting people](https://docs.ligament.ai/guides/workspaces/inviting-people/index.md#create-a-link-for-a-verified-domain) | | Verified domain | People who sign up or first sign in with an address at the domain, with the domain’s default role (never owner or admin) | [Verified domains](https://docs.ligament.ai/guides/identity/domains/index.md) | | SCIM | People your identity provider adds, at your verified domains | [SCIM provisioning](https://docs.ligament.ai/guides/identity/scim/index.md) | ### Invites are bound to the invited address An invite link isn’t a key that works for whoever holds it. An email invite only works for the person it was sent to: they must be signed in with that address, and the address must be verified (confirmed by email, a magic link, or a sign-in through your workspace’s single sign-on). If the link is forwarded, the person who opens it is refused and sees only the partly hidden address it was meant for, never your workspace’s name, the role or who invited them. Open links are the exception, so you have to choose one on purpose, confirm a warning, and give it an expiry and a usage limit. ### Verified means verified Ligament only trusts an email address it has verified: - **Email and password:** the person doesn’t join any workspace until they open the link Ligament emails to the address. - **Magic link:** opening the emailed link proves the address. - **Single sign-on:** your identity provider can only sign people in at the domains your workspace has verified. An assertion for any other address is refused. See [SSO only accepts your own domains](https://docs.ligament.ai/guides/identity/sso/index.md#sso-only-accepts-your-own-domains). ## Keys and tokens - An API key can only reach the workspace it was created in, with the scopes it was given. See [API keys](https://docs.ligament.ai/developers/api-keys/index.md). - Read-only keys, including `*` and `settings:read`, never see credentials such as invite tokens, webhook signing secrets or domain verification tokens. See [Credentials need an admin scope](https://docs.ligament.ai/developers/api-keys/index.md#credentials-need-an-admin-scope). ## See what happened **Logs › Audit › Security & sign-ins** lists the security events for your workspace and its members, with who, when and the IP address. Filter by **Event type** and export them as CSV or JSON. | Event type | Recorded when | | --- | --- | | **Signed in**, **Signed out** | Every sign-in and sign-out | | **Invite accepted** | Someone joined with an invite or link | | **Invite refused** | Someone opened an invite meant for another address or domain, or a link that was used, expired, used up or revoked | | **SSO sign-in refused** | Your identity provider asserted an address outside your verified domains | | **Password reset**, **2FA enabled**, **2FA disabled**, **Passkey added**, **Passkey removed**, **Profile updated**, **Other sessions revoked** | A member changed how they sign in | | **SSO provider added**, **SSO provider removed**, **OIDC client created** | An admin changed single sign-on | --- # Inviting people > Invite one person by email, or create a link for a verified domain or, deliberately, for anyone. How each kind is protected. Source: https://docs.ligament.ai/guides/workspaces/inviting-people/ Admins invite people from **Settings › Members** with **Invite member**. There are three kinds of invite. Pick the narrowest one that works: | Kind | Who can accept | Limits | | --- | --- | --- | | **One person, by email** (the default) | Only the invited address, signed in and verified | Works once; expires after 14 days (you can change this, up to 30); can be resent | | **Anyone at a verified domain** | Anyone signed in with a verified address at one of your [verified domains](https://docs.ligament.ai/guides/identity/domains/index.md) | Expires within 30 days; optional usage limit | | **Open link** | Anyone who has the link | Expires within 30 days, and has a usage limit | Only owners and admins can create and revoke invites, and only an owner can invite another owner. Links (domain and open) can’t give the owner or admin role: invite admins by email. ## Invite one person by email 1. Open **Settings › Members** and select **Invite member**. 2. Keep **One person, by email** selected and enter their address. 3. Choose a **Role** and select **Send invite**. Ligament emails them a link and shows it to you too, so you can send it another way if the email doesn’t arrive. The email says the link only works for that address. The invite is bound to that address. To accept it, the person must be signed in with that email address (upper or lower case doesn’t matter), and the address must be verified: - they confirmed it with the link Ligament emailed when they signed up, or signed in with a magic link, or - they signed in with [single sign-on](https://docs.ligament.ai/guides/identity/sso/index.md) through your workspace’s identity provider, at your verified domain. The invite works once, and it expires 14 days after you send it. If it expires before they accept it, resend it (see [Expired invites and Resend](#expired-invites-and-resend)). To change how long email invites last, select **Change** under the address in the **Invite member** panel and enter 1 to 30 days. The new length applies to invites you send or resend from then on; invites already sent keep their date. When the right person opens the link, they see the **Join** page (see [Opening an invite](#opening-an-invite)). Once they select **Join**, they’re in with the role you chose and the invite moves to **Accepted**. Opening it again later just offers to open the workspace. ## Opening an invite Opening an invite link never joins anyone by itself. Chat apps and email clients fetch links to show a preview, and browsers sometimes load pages ahead of time: none of that can make someone a member. The person first signs in (or signs up) if they aren’t signed in yet, then sees a page that shows: - your workspace’s name and logo (the logo set in **Settings › Portal**, if any); - the role they’ll get and who invited them; - the address they’re signed in with. They select **Join** to accept. If it’s the wrong account, **Not you? Switch account** signs them out and brings them back to the invite after they sign in again. \[Screenshot: The Join page: Join Northwind Group, Ada Admin invited you to join as Member, Signed in as uma.lindqvist@northwind-example.com, Role Member, the Join Northwind Group button and Not you? Switch account\] The page only shows your workspace to someone who can accept the invite. Anyone else gets the same refusal as before, which says nothing about your workspace (see [A forwarded invite doesn’t work](#a-forwarded-invite-doesnt-work)). ### A forwarded invite doesn’t work If anyone else opens the link (a colleague it was forwarded to, or the invitee signed in with a different account), Ligament doesn’t let them in. They see the address it was meant for, partly hidden, and nothing about your workspace: ```text This invite was sent to j***@acme.com. Sign in with that address or ask your admin for a new invite. ``` They can select **Sign in with another address** to sign out and come back to the invite with the right account. The invite stays valid for the right person. Every refused attempt is recorded as **Invite refused** in **Logs › Audit › Security & sign-ins**, with who tried, from which IP address and why (for example `expired`). Accepted invites are recorded as **Invite accepted**, and resent ones as **Invite resent**. ## Create a link for a verified domain Use this when you want a group of colleagues to join and they all have addresses at a domain you’ve verified, for example everyone at `@northwind-example.com` who should be a member rather than the domain’s default role. 1. Select **Invite member**, then **Anyone at a verified domain**. The option is only available once you have [verified a domain](https://docs.ligament.ai/guides/identity/domains/index.md). 2. Choose the **Domain**, the number of days until it **Expires** (1 to 30), and optionally a **Usage limit**. 3. Choose a **Role** and select **Create link**. Copy the link and share it. Someone signed in with a verified address at that domain joins when they open the link. Anyone else is refused: ```text This invite is for people with an @northwind-example.com email address. Sign in with that address or ask your admin for a new invite. ``` If you remove the domain or it stops being verified, the link stops working. ## Create an open link An open link lets anyone who has it join, whoever passed it on to them. Use it only when you can’t name the people, for example a link you read out at a training session. 1. Select **Invite member**, then **Open link: anyone with the link**. 2. Read the warning and tick **I understand: create an open link**. 3. Set **Expires after (days)**, from 1 to 30, and a **Usage limit**, up to 1,000. Both are required. 4. Choose a **Role** and select **Create link**. \[Screenshot: The Invite team member panel with Open link selected: the warning with the I understand checkbox, Expires after 7 days, Usage limit 10, Role Member, and the Create link button\] Each person who joins uses one use. Someone who is already a member doesn’t use one. When the link runs out or expires, people who open it see: ```text This invite link has reached its usage limit. Please ask your admin for a new invite. This invite link has expired. Please ask your admin for a new invite. ``` ## See and revoke invites Pending invites and links are listed with your members. Filter **Status** by **Invitation sent** to see only them, or by **Accepted or revoked invites** to see the invites accepted or revoked in the last 30 days. | Status | Meaning | | --- | --- | | **Expires in 5 days** | An email invite nobody has accepted yet, and how many days it has left (rounded up) | | **Link** | A domain or open link that still works | | **Expired** | An email invite or a link past its expiry date | | **Used up** | A link with no uses left | | **Accepted** | An email invite the person accepted | | **Revoked** | An invite or a link an admin revoked (or replaced by inviting the same address again) | Select an invite to see when it expires, and for a link how many uses are left (for example **3 of 10 left**), and to copy it again. To revoke an invite or a link, select it and choose **Revoke invite** or **Revoke link**, or tick several and use **Revoke invite** in the toolbar. A revoked link stops working at once: ```text This invite was revoked. Please ask your admin for a new invite. ``` People who already joined with it stay members. Remove them from **Settings › Members** if you need to. ## Expired invites and Resend When an email invite expires, the person who opens it sees: ```text This invite has expired. Ask your admin to resend it. ``` The page says nothing about your workspace, and the attempt is recorded as **Invite refused** (reason `expired`). To resend an invite, pending or expired, select it in **Settings › Members** and choose **Resend invite**, or tick several and use **Resend invite** in the toolbar. Resending: - creates a new link and emails it to the same address again (the panel shows the new link too); - stops the old link working at once: whoever opens it is told the link isn’t valid; - starts the expiry again from now (14 days, or what you set). Links (domain and open) can’t be resent: create a new one and revoke the old one. When this feature arrived, invites that were still pending got 14 days from that day, not from when they were sent. ## People who don’t need an invite - People who sign up, or sign in for the first time with single sign-on or a magic link, with an address at one of your verified domains join automatically with the domain’s default role. See [Verified domains](https://docs.ligament.ai/guides/identity/domains/index.md). - People your identity provider adds through [SCIM provisioning](https://docs.ligament.ai/guides/identity/scim/index.md) are members as soon as it adds them. ## With the API Invites need the `members:write` scope (see [API keys](https://docs.ligament.ai/developers/api-keys/index.md)). Send `kind` to create a link; without it, the request is an email invite. | Body | Creates | | --- | --- | | `{"email": "jane@acme.com", "role": "member"}` | An email invite (emailed to that address) | | `{"kind": "domain", "domain": "acme.com", "role": "member", "expiresInDays": 14}` | A domain link; `maxUses` is optional | | `{"kind": "open", "role": "member", "expiresInDays": 14, "maxUses": 25}` | An open link | Use `expiresInDays` (1 to 30) or `expiresAt` (an ISO date-time at most 30 days ahead). ```bash curl -s -X POST "https://app.ligament.ai/api/invites" \ -H "authorization: Bearer $LIGAMENT_API_KEY" \ -H 'content-type: application/json' \ -d '{"kind": "open", "role": "member", "expiresInDays": 14, "maxUses": 25}' ``` ```json { "invite": { "id": "cmx6uqfeb0081fm80uy7ta73p", "kind": "open", "email": null, "domain": null, "role": "member", "token": "", "status": "pending", "expiresAt": "2026-12-17T01:04:05.747Z", "maxUses": 25, "useCount": 0, "remainingUses": 25 }, "link": "https://app.ligament.ai/invite/", "emailSent": false } ``` Invalid links are refused with `422`, for example: ```json { "error": "An invite link can last at most 30 days" } { "error": "An open invite link needs a usage limit" } { "error": "An invite link can't give the admin role: invite admins by email" } ``` `GET /api/invites` lists pending invites and links, expired ones included, with `state` (`pending`, `expired`, `used_up`, `accepted`, `revoked`), `expiresAt`, `expiresInDays`, `remainingUses` and `expired`. Add `?history=1` to include invites accepted or revoked in the last 30 days. The `token` is only returned to admins signed in to the app and to keys with `members:write`; any other key gets `"token": null`. Revoke with `DELETE /api/invites/{id}`. Resend an email invite (pending or expired) with `POST /api/invites/{id}/resend` and a `members:write` key. The response has the invite with its new `token` and `expiresAt`, the new `link`, and `emailSent`. Links answer `422`. How long email invites last is a workspace setting: `GET /api/settings/invites` (`settings:read`) returns `{"expiryDays": 14, "defaultExpiryDays": 14, "maxExpiryDays": 30}`; change it with `PUT /api/settings/invites` and `{"expiryDays": 7}` (`settings:write`). API keys can’t accept invites: a person accepts one in the browser with **Join**. ### With MCP A key with `members:write`, made by an owner or admin, also gets two tools on the [MCP server](https://docs.ligament.ai/developers/mcp/index.md): `invites_list` (the same list, with `history: true` for past invites) and `invites_resend` (`{"id": ""}`). --- # Workspaces and subsidiaries > Run several companies or business units as a tree of workspaces. Source: https://docs.ligament.ai/guides/workspaces/subsidiaries/ A workspace holds one organisation’s records, members, apps and settings. When your group runs several companies, regions or business units that need their own data and their own teams, give each one a **subsidiary**: a child workspace under yours. Subsidiaries can have subsidiaries of their own, so the whole group forms a tree. For example, Northwind Group runs its logistics company as a subsidiary called Northwind Logistics. Logistics has its own incidents, people and settings. Northwind Group’s admins can work in it and report across both. ## What is shared and what isn’t Each workspace in the tree keeps its own data. Records, apps, roles, verified domains, SSO, SCIM tokens, portal and API keys all belong to one workspace. What crosses the tree is limited to these: | Across the tree | How it works | | --- | --- | | Admins | An owner or admin of a workspace is also an admin of every workspace below it. They don’t need to be invited. | | Members you choose | A member with **Can see subsidiary workspaces** turned on holds the same role in every workspace below theirs. | | Reporting | Lists can show records from the workspace and its subsidiaries side by side, read-only (see [Report across subsidiaries](#report-across-subsidiaries)). | | Apps you build | An app listed for **Your organisation** in the App Store can be installed by any workspace in the group, once Ligament has reviewed it. | Access never flows upwards. A member of Northwind Logistics can’t open Northwind Group unless someone gives them a membership there. ## Create a subsidiary You need to be an owner or admin of the parent workspace. 1. Switch to the workspace that should be the parent, for example Northwind Group. 2. Open **Admin › Subsidiaries** and select **New subsidiary**. 3. Enter a **Name**, for example “Northwind Logistics”, and select **Create subsidiary**. \[Screenshot: The New subsidiary panel in Admin › Subsidiaries, with the name Northwind Logistics filled in and the Create subsidiary button\] You become the new workspace’s owner. It starts empty: the built-in roles are there, but no apps, records or other members. Install the apps it needs from the App Store and invite its team, the same as for any new workspace. The list in **Admin › Subsidiaries** shows each direct subsidiary with its number of members and its own subsidiaries. The same action is available to an API key with the `settings:write` scope: `POST /api/workspace/subsidiaries` with `{"name": "Northwind Logistics"}`. The subsidiary is created under the key’s workspace and the key’s creator becomes its owner. A request without a name fails with `422` (`"name is required"`), and a person without admin rights, or a key without the scope, gets `403`. ## Switch workspaces Select the workspace name at the top left. The menu lists every workspace you can work in, with subsidiaries indented under their parent and your role in each one on the right. A link icon marks a workspace you reach through a parent rather than a membership of your own. Choose one to switch; the app reloads in that workspace. ## Give a member access to the subsidiaries Admins cascade automatically. For anyone else: 1. In the parent workspace, open **Admin › Members** and select the person. 2. Turn on **Can see subsidiary workspaces** and select **Save access**. They now hold their role (for example member) in every workspace below this one. Turn it off to take it away. A membership they hold directly in a subsidiary always wins over the inherited one for that workspace. ## Report across subsidiaries When a workspace has subsidiaries, record lists offer an extra **Workspace** column. Add it with the column picker and the list becomes a read-only roll-up: records from this workspace and every subsidiary below it, newest first, each tagged with the workspace it came from. - Ligament reads each workspace with the role you hold there, so you see what you could see by switching to it. - A subsidiary that doesn’t have the app installed, or where you have no access to that table, is left out. - The roll-up shows up to 500 records. Remove the column to get back to the normal list with filters and editing. ## Share an app with your organisation In **Build › Apps**, open your app and set **Who can use this app** to **Your organisation**. The app needs a published version first. This lists it in the App Store for your organisation only and submits the version for Ligament‘s review, like any Store listing. Once it’s approved, an admin of any workspace in the group finds it under **App Store › Your organisation** and installs it like any other app. Workspaces outside your organisation never see it. Each new version is reviewed before the group gets it. See [The App Store](https://docs.ligament.ai/guides/workspaces/app-store/index.md#your-own-apps). ## Moving, removing and suspending workspaces There’s no screen for moving or deleting a workspace. To move a workspace out of its group, or into another group, the owner contacts Ligament support at hello@ligament.ai. If Ligament suspends a workspace, every subsidiary below it is suspended too. While a workspace is suspended, its members see “Workspace suspended” instead of the app and the portal, and API keys and SCIM calls are refused with `401` and “This workspace has been suspended”. Nothing is deleted; access returns when the suspension is lifted. --- # Portals > The self-service portal where employees find answers and raise requests, and the sites you publish for customers. Source: https://docs.ligament.ai/guides/workspaces/portals/ The portal is where people who don’t work the queue get help: they search answers, report a problem, request something from the catalogue and follow up on what they’ve asked for. It lives at `https://app.ligament.ai/portal` and uses the same records, forms and access rules as the rest of the workspace, so there’s nothing to sync. For people outside your organisation, such as customers, you publish an **App Site** instead (see [Sites for customers](#sites-for-customers)). ## Who uses the portal Every member of the workspace can open `/portal` after signing in; anyone who isn’t signed in is sent to the sign-in page first. What they see depends on their role: - **Viewers** are treated as end users: **My requests** shows only what they raised or what was raised for them. - **Everyone else** (members, agents, admins) also gets a **Staff view** link back to the app, and can open any request their role lets them read. To let everyone at your company use the portal without inviting them one by one, verify the company’s email domain and set **New members get** to **Viewer (end user)** (see [Verified domains](https://docs.ligament.ai/guides/identity/domains/index.md)). People at that domain then join as viewers the first time they sign in. ## What’s in the portal \[Screenshot: The Northwind Group Help Center portal home as Mia sees it: greeting, search box with suggested topics, a planned-maintenance notice, tiles for Report a problem, Request something, Knowledge and My requests, her open requests and the top knowledge answers\] | Page | Path | What it does | | --- | --- | --- | | Home | `/portal` | A search box over answers and requests, outage and maintenance notices, shortcuts, the person’s open requests and the most-read articles. | | Get help | `/portal/new` | The **Report a problem** form, which files an incident. Matching knowledge articles appear while the person types. | | Request something | `/portal/catalog` | The service catalogue, grouped by category. Each item has its own request form; items can need a manager’s approval. | | Knowledge | `/portal/knowledge` | Published knowledge articles. | | My requests | `/portal/requests` | Everything the person raised or that was raised for them, open and closed, with the state and who is working on it. They can add comments and confirm a resolution. | | Manager | `/portal/manager` | Appears only for people with approvals waiting for them or with direct reports. | Outage and maintenance notices come from the service desk’s **Announcements**. ## Which records count as requests **My requests** lists the record types that an app declares as portal requests, plus service requests when the catalogue is on (the catalogue creates service requests). In Northwind that’s incidents and service requests. An app makes one of its entities a request type in its manifest: ```json { "entities": [ { "key": "incident", "portal": { "request": true, "titleField": "title" } } ] } ``` `titleField` is the field shown as the request’s title on the portal. A record counts as someone’s request when they created it, or when a user field such as **Requested for** or **Caller** points at them. See the [app manifest reference](https://docs.ligament.ai/reference/app-manifest/index.md) for the other entity options. ## Brand the portal Admins customise the portal in **Settings › Portal**. Changes apply when you select **Save changes**; **View portal** opens it in a new tab. \[Screenshot: Settings › Portal with the Branding section (Title Northwind Group Help Center, Tagline, Logo URL, Accent color) and the Sections switches for Knowledge base, Service catalog, My requests and Report an issue\] | Setting | What it does | | --- | --- | | Title | Shown in the portal header and footer. Defaults to “ Help Center”. | | Tagline | A line under the greeting. | | Logo URL | An image shown in the header instead of the title. | | Accent color | A hex colour such as `#0F6CBD`, used for links, buttons and highlights. | | Sections | Turns Knowledge base, Service catalog, My requests and Report an issue on or off. A section only appears when the app behind it is installed: knowledge articles, the service catalogue, or incidents. | | Custom CSS | Your own styles, scoped to the portal. Start selectors with `.portal-root`. Up to 20,000 characters. | The same settings are available at `GET` and `PUT /api/portal`; see [Portal](https://docs.ligament.ai/reference/rest-api/index.md#portal) in the API reference. ## Sites for customers An App Site publishes pages over an app’s data for people who aren’t members of your workspace: customers, partners or the public. A site is a set of routes, each mapping a path to an entity and a stack of blocks (a list, a record’s details, a form, a conversation). You build pages from blocks, not HTML, and they read data through the same access rules as the app. Northwind’s customer support site is one example. Bob, a contact at Kestrel Freight, signs in and sees his own cases, opens new ones and reads help articles. He isn’t a member of Northwind and doesn’t take a seat: \[Screenshot: Northwind's Customer support site as Bob sees it, with My cases, New case and Help articles, and two of his cases: one New, one Closed\] Set a site up in **Build › Apps**, on the app’s **Site** tab: | Setting | Options | | --- | --- | | Mount | **In the portal**, at `/portal/s/` inside the portal’s header and menu, or **Standalone**, at `/s/` with its own minimal header. | | Visibility | **Internal** (workspace members), **Authenticated** (anyone who signs in) or **Public** (no sign-in). A public site also gets a public address, `/public/`. | | Logo URL, Accent color, Menu | The site’s own branding and navigation. | | Show in the portal menu | Adds a portal-mounted site to the portal’s top menu. | Each route also has an access level: **Member (staff)**, **Role**, **Authenticated (any signed-in end user)** or **Public (anonymous)**. For a public page, set both the site and the route to public. On a site’s case conversations, customers see your agents as “Alex · Support”, or only “Support” if you turn off **Show agents’ first names** in **Settings › Service desk** (Agent names on the customer portal). Surnames and email addresses are never shown, and automated replies always show “Support”. ### Embed a site in your own website Standalone and public sites (`/s/…` and `/public/…`) refuse to load inside another website’s iframe by default. To embed one, add your website’s origin to **Settings › Embed › Allowed embed domains**: one `https://` origin per line, for example `https://www.northwind-example.com`, up to 20. Leave the list empty to keep framing blocked. ## Requests by email People can also raise requests by email. In **Settings › Email intake**, turn on **Email intake** and copy **Your inbound address** (it looks like `@inbound.ligament.ai`). Point your support mailbox’s forwarding at it. Each new email becomes an incident with the sender, subject and body; replies that keep the incident number in the subject (for example `[INC0000042]`) are added to that incident instead. If you’ve verified your domain, mail your provider forwards for any address at it, such as `support@northwind-example.com`, is routed to your workspace too. --- # The App Store > Install apps into your workspace from the App Store: Ligament apps such as HR, ITSM and CRM, the apps they need, updates, and apps that ship an access model. Source: https://docs.ligament.ai/guides/workspaces/app-store/ The **App Store** lists everything you can add to a workspace: Ligament’s apps (HR, IT Service Management, Problem and Change, CRM, Customer Service, People, Knowledge and more), apps listed for your organisation only (under **Your organisation**), and plugins. Owners and workspace admins install and remove apps; everyone else sees what’s installed. A plugin that holds the workspace’s credentials (an email, storage or AI provider, or a connector’s token) is connected, tested and made the default by an owner or admin only; anyone else who opens it is told to ask an admin. ## Install an app 1. Open **App Store** and find the app, for example **HR**. 2. Open it to see what it adds, what it **Requires**, and its plans. 3. Select **Install** on a plan. Ligament’s apps are in the Store for every workspace: there’s nothing to publish first. Each one is published by Ligament at its current version. ## Apps that need other apps Some apps can’t run on their own. HR keeps departments in the **People** app, so it requires People; Problem and Change requires IT Service Management. The app’s page lists these under **Requires**, with what’s already installed. When something it needs isn’t installed yet, **Install** shows the whole plan once: “This also installs: People 1.3.0, CMDB 1.1.0, Service Catalog 1.3.0”, in the order they’ll be installed, each with its plan and price. Confirm once and the Store installs them one at a time, the deepest dependency first, showing each step. - **If a step fails,** the install stops there. What’s already installed stays installed, and the dialog says which step failed and why. Fix the cause and select **Retry from …**: the install carries on from the failed step. - **A dependency that costs money** shows its price, and **Install** stays off until you tick “I accept … at $…/mo”. A free plan is always chosen when the app has one; the Store never picks a paid plan for you. - **With the API, MCP or CLI** an install that needs other apps is refused by default (`422`, with the same plan), so automation doesn’t install more than it asked for. Pass `dependencies: "install"` (CLI `--with-dependencies`) to install them, and `acceptPaid: ["service_catalog"]` (CLI `--accept-paid`) for a paid one. `ligament app resume ` continues a failed install. You can’t uninstall an app while an installed app depends on it: “CMDB is used by Assets, ITSM. Uninstall them first.” Uninstalling keeps the app’s records. ## Apps that ship an access model Installing an app adds its records, pages and automation. Some apps also ship an **access model** in their manifest: the permission sets, roles and restrictions that decide who sees what (for HR: pay for HR and the employee’s managers, leave reasons for the employee and HR). Installing the app creates it, in the same step: there’s nothing to apply afterwards. The app’s **Access** section in the App Store says what it contains. 1. Install the app. 2. Give people its roles in **Settings › Access › Assignments**. The access model belongs to the app (its spec store addresses start with the app’s key, for example `hr/role/hr_admin`). You can change it like any access setting. An update keeps your changes, and a change in the new version that would give anyone more access waits for your approval in the update summary. Uninstalling the app shows who loses what before it removes the app’s roles; restrictions and sets that keep its records closed stay unless you approve their removal. See [Access in the manifest](https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/index.md). ## Updates When Ligament ships a new version of an app, or of a built-in module such as People or Customers, it shows under **Updates available** with an **Update to v…** button. The update keeps your changes to what the app ships, and asks before it widens anyone’s access. See [Upgrades and your customisations](https://docs.ligament.ai/guides/building-apps/upgrades/index.md). To update several apps at once, select **Updates available (n)**, choose the apps and select **Preview**. The preview lists, per app, the fields and record types each update adds or removes. An update that would remove something that holds data is **blocked** until you tick its own confirm box; the others go ahead. Apps are updated in dependency order (People before HR), with a result per app, and the whole run is one entry in the audit log. The same is `POST /api/apps/upgrade/bulk` with `dryRun`, the MCP tool `store_upgrade`, and `ligament app upgrade --dry-run`. **Automatic patch updates.** The workspace owner can turn on **Settings › Apps › Auto-apply patch updates** (off by default). Once a day, patch releases (1.3.0 → 1.3.1) are applied when they remove nothing and give nobody more access; anything else still waits for you. ## Apps leaving the Store Ligament sometimes takes an app out of the Store: - **Deprecated:** workspaces that have it keep using and updating it, but nobody can newly install it. - **Retired:** it’s hidden from the Store. Where it’s installed it keeps working and keeps its records; it gets no further updates. Admins of a workspace that has such an app see a banner on its Store page and on its screens, with the reason and, when there is one, what replaces it. **Uninstall** stays available. Nothing is removed unless you uninstall it. ## Your own apps Apps you build in **Build**, or publish with `ligament app publish`, belong to your workspace. They’re private to it. The App Store is the only way they reach another workspace, in your organisation or outside it, and Ligament reviews every version first: - **Your organisation:** a listing only the workspaces in your organisation (your group and its subsidiaries) see, under **App Store › Your organisation**. - **App Store:** the public listing, for every workspace. In **Build**, open the app and choose the audience under **Who can use this app**, or select **Submit to the App Store**. That submits the latest published version for review; until it’s approved no other workspace can see the app. Each new version you publish is submitted too, and other workspaces keep the approved version until the new one passes review. Build shows where the listing stands, and the reasons if a version isn’t approved. The keys of Ligament’s apps (`hr`, `itsm`, `itsm_problem_change`, `crm`, `csm`) are taken: publishing under one is refused. --- # Your notifications > Choose which events reach you on which channel, set quiet hours, get a digest, turn on browser push, and approve requests straight from a message. Source: https://docs.ligament.ai/guides/notifications/ Ligament tells you when something needs you: a record is assigned to you, someone comments, an approval is waiting, an SLA is at risk, a workflow fails. You decide where each kind of event reaches you and how often, in **Settings › Notifications**. ## Channels | Channel | What you get | What it needs | | --- | --- | --- | | In-app | The bell at the top of every page, live | Nothing: always on | | Email | A message to your account address, or another address you give | Nothing | | Browser push | A notification from your browser, even when Ligament isn’t open | Turn it on in each browser you use | | Slack, Microsoft Teams | A direct message from the Ligament app | Your admin connects the workspace and links your account | | SMS, WhatsApp | A short text with a link | Your admin turns the channel on; you add your number | | Other connected apps (Telegram, Discord, …) | A message to the address you give | Your admin installs the connector | Only the channels your workspace has set up appear on the page. ## Choose events and channels The **Events and channels** table has one row per kind of event and one column per channel. For each cell pick: - **Instant**: send it as it happens. - **Digest**: collect it into your daily or weekly digest. - **Off**: don’t send it on this channel. In-app is on for every event until you change it. Every other channel starts off, unless your admin set a default. The exception is **Workflow message** (a message one of your workspace’s workflows sends you): it also comes by email until you change it. Your admin may set a default for some cells. When a cell says “Your admin set this to at most Instant” (or Digest), you can lower it but not raise it. Events marked **Urgent** ignore your quiet hours. ## Addresses Some channels need an address: your phone number for SMS and WhatsApp (in international format, such as `+66812345678`), or a chat id for a connected app. A channel with no address sends you nothing. Email goes to your account address unless you enter another one. Slack and Teams find you through your linked account, shown under **Linked accounts**. If yours says “Not linked”, ask an admin, or for Teams open the Ligament app in Teams once. ## Quiet hours Turn on **Quiet hours** and pick a start and an end time, for example 22:00 to 07:00. During that window Ligament holds messages for every channel except in-app, and sends them when the window ends. In-app notifications still arrive in the bell. Events your admin marked urgent are sent straight away. Quiet hours and the digest use your **time zone**. It starts as the workspace’s time zone; change it if you work somewhere else. ## Digest Choose **Daily** or **Weekly**, the hour, and for weekly the day. Everything you set to **Digest** since the last one arrives as one message per channel at that time, in your time zone. ## Browser push Under **Browser push**, select **Turn on for this browser** and allow notifications when your browser asks. The browser then appears in the list, and **Send a test** sends it a test notification. Turn it on in each browser and device you want; remove one you no longer use. Push notifications for approval requests have **Approve** and **Reject** buttons where your browser supports them. ## Approve or reject from a message Approval requests (a leave request, a change waiting for review, a record waiting for a decision) come with **Approve**, **Reject** and **Open in app** buttons in email, Slack, Teams and browser push. - You act as yourself. Ligament checks the same rules as in the app: who may approve this record, and that nobody approves their own request. - In email, the button opens a page that asks you to confirm, so a link checker can’t approve anything by opening the link. - In Slack and Teams, Ligament uses the person who pressed the button. In a shared channel, anyone can press it, and each press is checked as that person. If your Slack or Teams account isn’t linked to Ligament, you get a short reply saying so, with a link to open the request in the app. - A button works once. If the request was already decided, by you or someone else, the reply says so and nothing changes. Buttons stop working when the request expires, and after seven days at most. - If you can’t approve the request, the reply says why and links to the app. Nothing changes. Every press is recorded, whatever its outcome. ## What a message contains Messages that leave Ligament (email, Slack, Teams, push, SMS) are written for you, with what you’re allowed to see: - By default they’re short: the kind of event, the record’s name as you see it, and a link. Open the link to see the details in the app. - A field you can’t read, or see only masked (a salary, a medical note), never appears in a message to you, even if your admin chose longer messages. - If you can’t open the record at all, the message only says that something happened, with a link. ## Related - [Workspace notification settings](https://docs.ligament.ai/guides/notifications/admin/index.md) (for admins) - [Connect Slack and Microsoft Teams](https://docs.ligament.ai/guides/notifications/slack-teams-setup/index.md) - [Separation of duties](https://docs.ligament.ai/guides/access/separation-of-duties/index.md) --- # Connect Slack and Microsoft Teams > Send notifications to Slack and Microsoft Teams as direct messages, with Approve and Reject buttons. Source: https://docs.ligament.ai/guides/notifications/slack-teams-setup/ When you connect Slack or Microsoft Teams, Ligament sends notifications there as direct messages to each person, and as posts in the channels your routing rules name. Approval requests come with **Approve**, **Reject** and **Open in app** buttons. A button press counts as the person who pressed it, with the same access rules as in the app. Only workspace admins can connect a provider and link people. ## Slack You create a Slack app in your own Slack workspace, install it, and give Ligament its bot token and signing secret. The app posts the messages and sends button presses back to Ligament. ### Create the Slack app 1. Go to [api.slack.com/apps](https://api.slack.com/apps) and select **Create New App** › **From a manifest**. 2. Pick the Slack workspace the app belongs to. 3. Paste this manifest (YAML). Replace the name if you like; keep the scopes and the request URL. ```yaml display_information: name: Ligament description: Notifications and approvals from Ligament features: bot_user: display_name: Ligament always_online: true oauth_config: scopes: bot: - chat:write - im:write - users:read - users:read.email settings: interactivity: is_enabled: true request_url: https://app.ligament.ai/api/notify/slack/interactions org_deploy_enabled: false socket_mode_enabled: false token_rotation_enabled: false ``` What the scopes are for: | Scope | Used for | | --- | --- | | `chat:write` | Posting notifications and updating a message after someone approves | | `im:write` | Direct messages to a person | | `users:read`, `users:read.email` | Finding each member’s Slack account by their email address | 4. Select **Create**, then **Install to Workspace** and allow the app. ### Connect it to Ligament 1. In Slack’s app settings, open **OAuth & Permissions** and copy the **Bot User OAuth Token** (it starts with `xoxb-`). 2. Open **Basic Information** › **App Credentials** and copy the **Signing Secret**. 3. In Ligament, open **Settings › Notifications › Connections › Slack**, paste both values and save. Ligament stores them encrypted and never shows them again. 4. Select **Test**. You should see your Slack workspace and the app’s name, for example: ```text Slack workspace Northwind as @Ligament ``` **Test** also records which Slack workspace this is. Buttons only work after a successful test, so run it again if you install the app in a different Slack workspace. If **Test** fails, the message names Slack’s reason: `invalid_auth` means the token is wrong or was revoked; reinstall the app and copy the token again. ### Link people to their Slack accounts Select **Sync people** on the same page. Ligament looks up every member’s account email in Slack and links the matching Slack user. The sync reports how many people it matched and how many it couldn’t find. - Links you set by hand are kept. Set or change one in the people list when someone uses a different email in Slack. - Slack limits how fast an app may look people up. A large workspace may stop part way and say so: run the sync again a minute later to continue. - Someone who isn’t linked gets no direct messages. If they press a button in a channel post, Slack shows them a private note that their account isn’t linked, with an **Open in app** link, and nothing changes. ### Choose Slack for your notifications Each person decides where their notifications go. In **Settings › Notifications › Preferences**, turn on **Slack** for the events you want, for example **Approval request**. Linked people don’t need to type an address. To send to a channel instead, type its ID (for example `C0123ABCD`) as your Slack address and invite the app to that channel with `/invite @Ligament`. ### Try it 1. Turn on Slack for **Approval request** in your own preferences. 2. Start something that asks you for an approval, for example a workflow with an approval step assigned to you. 3. Within a minute you get a direct message from the app with **Approve**, **Reject** and **Open in app**. 4. Press **Approve**. The message updates to show `✅ Approved by @you` and the buttons disappear. The approval shows as approved in Ligament. 5. Press the same button in another copy of the message, or ask a colleague who isn’t linked to press it: Slack shows a private note (`Already approved by …`, or that the account isn’t linked) and nothing changes. Every press is recorded in the action log under **Settings › Notifications**, and each message’s delivery log shows when it was sent, delivered, clicked and acted on. ### Troubleshooting | What you see | What to do | | --- | --- | | No message arrives | Check that the person is linked and has Slack turned on for the event. **Deliveries** shows the Slack error, if any. | | `channel_not_found` or `not_in_channel` | Invite the app to the channel, or check the channel ID. | | Buttons answer “This button isn’t valid here” | The press came from a Slack workspace that isn’t connected to this Ligament workspace. Run **Test** again. | | Buttons do nothing | Check the Interactivity request URL in the Slack app settings and that the signing secret in Ligament matches. | ## Microsoft Teams To connect Microsoft Teams you register a bot in Azure, add it to Teams with an app package, and enter the bot’s details in Ligament. You need an Azure subscription where you can create resources, and permission to upload custom apps to Teams (or a Teams admin who can do it for you). ### Register an Azure Bot 1. In the Azure portal, create an **Azure Bot** resource. 2. Under **Type of App**, choose **Single Tenant**. Under **Creation type**, choose **Create new Microsoft App ID**. 3. When the resource is created, open **Settings › Configuration** and note the **Microsoft App ID** and the **App Tenant ID**. 4. Next to **Microsoft App ID**, select **Manage Password**. Under **Client secrets**, select **New client secret**, and copy the secret’s **Value**. Azure shows it only once. 5. Back in **Configuration**, set **Messaging endpoint** to: ```text https://app.ligament.ai/api/notify/teams/messages ``` 6. Open **Channels** and add the **Microsoft Teams** channel. Accept the terms and save. ### Create the Teams app package Teams installs bots from an app package: a zip file with a `manifest.json` and two icons. Start from this manifest. Replace `` (twice) with your Microsoft App ID and `` with the host name of your Ligament address, without `https://`. ```json { "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json", "manifestVersion": "1.17", "version": "1.0.0", "id": "", "developer": { "name": "", "websiteUrl": "https://", "privacyUrl": "https:///privacy", "termsOfUseUrl": "https:///terms" }, "name": { "short": "Ligament", "full": "Ligament notifications" }, "description": { "short": "Notifications and approvals from Ligament.", "full": "Get the Ligament notifications you choose in Microsoft Teams, and approve or reject requests from the message." }, "icons": { "color": "color.png", "outline": "outline.png" }, "accentColor": "#FFFFFF", "bots": [ { "botId": "", "scopes": ["personal", "team"], "supportsFiles": false, "isNotificationOnly": false } ], "permissions": ["identity", "messageTeamMembers"], "validDomains": [""] } ``` Add a 192 × 192 pixel colour icon named `color.png` and a 32 × 32 pixel white outline icon on a transparent background named `outline.png`. Zip the three files together, with no folder inside the zip. The `personal` scope lets each person chat with the bot and get their own notifications. The `team` scope lets you add the bot to a team so it can post in that team’s channels. ### Upload the app to Teams Upload the zip in one of these ways: - In Teams, open **Apps › Manage your apps › Upload an app › Upload a custom app**. This needs custom app upload to be allowed for you. - In the Teams admin center, open **Teams apps › Manage apps › Upload new app**. Then use a setup policy to install it for the people who should get notifications, so nobody has to find it themselves. To post in a team’s channels, open the team, select **Apps**, and add the app to that team. ### Connect the bot in Ligament 1. Open **Settings › Notifications › Connections › Microsoft Teams**. 2. Enter the **App ID**, the **Tenant ID**, and the client secret as the **App password**. 3. Select **Save Teams**, then **Test**. A working connection shows **Azure Bot** followed by your App ID. If the test fails, check the App ID, the tenant and that the secret hasn’t expired. When Microsoft Teams is connected, the Microsoft Teams channel in notification preferences sends cards from the bot instead of plain text. ### Link people to their Teams account Ligament needs to know which Teams user is which member before it can message them or accept their button presses. Each person links themselves by **opening the Ligament app in Teams once**: when the bot is added to their personal chat, Ligament matches their Teams email address to their Ligament account. If someone says hello to the bot later, it tells them whether they’re linked. You can see who is linked under **Settings › Notifications › People**. **Sync by email** refreshes the people already linked, and links the members of teams the bot was added to when their Teams email matches their Ligament email. Teams doesn’t let a bot look people up by email, so anyone else still needs to open the app once. An admin can also link a member by hand with their Microsoft Entra object ID. People who aren’t linked get no Teams messages. If they press a button in a channel post, nothing changes and the card tells them to open the request in Ligament. ### Post to a team channel Add the bot to the team first. Then, under **Settings › Notifications › Workspace › Team channels**, add a rule with the Microsoft Teams channel and the channel’s ID as the target. The channel ID looks like `19:a1b2c3d4e5f6@thread.tacv2`. To find it, open the channel’s **…** menu in Teams, select **Get link to channel**, and copy the part between `/channel/` and the channel name (URL-decoded). Channel posts are short: the event and the record’s number, with an **Open in app** button. Anyone in a channel can read them, so they never include field values. ### Approve and reject from Teams Approval requests sent to a person show **Approve**, **Reject** and **Open in app**. Pressing **Approve** or **Reject** decides as the linked member, with the same rules as in the app: if they can’t decide this request, nothing changes and the card says why. When it works, the card changes to show who decided, for example **✅ Approved by Sam Chen**. A second press says it’s already decided. ### Check that it works 1. Open the Ligament app in Teams so your account is linked. 2. In your notification preferences, turn on Microsoft Teams for **Approval request**. 3. Start a workflow with an approval step assigned to you. 4. The card arrives in your chat with the bot within a minute. Press **Approve** and check the request in Ligament. The delivery log under **Settings › Notifications › Deliveries** shows each message and why one failed. If a message fails with “The person has not opened the Ligament bot in Microsoft Teams yet”, ask them to open the app once. ### Incoming webhooks People who typed a Teams incoming webhook URL as their Microsoft Teams address keep getting messages there. A webhook can’t receive button presses, so those messages only have **Open in app**. --- # Workspace notification settings > For admins: defaults people can narrow, urgent events, message length, escalation, rate limits, templates, connections, linked accounts and the delivery log. Source: https://docs.ligament.ai/guides/notifications/admin/ Owners and admins see more tabs in **Settings › Notifications**: **Workspace**, **Templates**, **Connections**, **People** and **Deliveries**. Members only see their own page. ## Defaults for everyone **Workspace › Defaults for everyone** is the same event and channel table people see on their own page. A cell you set is the default for everyone who hasn’t chosen. Each cell offers a mode (Instant, Digest or Off) in two kinds: - **cap**, such as **Digest · cap**: the default, and the most people can choose. They can turn it down (Instant to Digest to Off) but not up. Use it to keep a noisy channel quiet. - **default**, such as **Instant · default**: only the starting point; people can choose anything. A cell left on **Not set** keeps the built-in default: in-app on, every other channel off until the person turns it on. ## Event policy Per kind of event: - **Urgent: ignores quiet hours**: sent even during a person’s quiet hours. Use it for things that can’t wait, such as SLA breaches. - **Message body outside the app**: what leaves Ligament on email, Slack, Teams, push and SMS. - **Minimal** (the default, except for **Workflow message**): the event and the record’s name, and a link. Safe for any channel. - **Full** (the default for **Workflow message**): the title and text of the event, with every field the recipient can’t see removed. - **Template**: your own text from the **Templates** tab, with the same rule. In-app notifications always show the full title and text, with the same fields removed. - **Escalation**: if an approval is still waiting after a number of hours, either **Send it again on another channel** (for example SMS) to the same person, or **Tell their manager** (from the reporting line in People). Nothing is sent when it was decided in the meantime. ### Fields people can’t see never leave Each message is written for the person it goes to. Ligament reads the record as that person: a field that is hidden from them, or that they see masked, is removed from the text, in every spelling (`130000`, `130,000`). If they can’t open the record at all, they get a message that only says something happened, with a link. A post to a shared channel (a team channel) names the record by its number and nothing else, because anyone in the channel may read it. In the HR app, for example, a manager’s notification never shows the salary of someone outside their team, and a leave approval never shows the medical note, unless the person reading it is allowed to see it in the app. Text that quotes values from another record (not the one the notification is about) isn’t checked. Keep **Minimal** for events whose text you don’t control. **Workflow message** is the event your workflows’ notify steps send. Its text is whatever the workflow’s author wrote, on purpose, so it goes out **Full** by default: email and Slack get the author’s text, checked against the record the workflow is about, with every field the reader can’t see removed. Choose **Minimal** if your workflows quote values from other records, so email and Slack get only the record’s name and a link (see [Notify from a workflow](https://docs.ligament.ai/developers/notifications/index.md#notify-from-a-workflow)). ## Rate limits Messages per minute for the whole workspace, per channel. Over the limit, messages wait for the next minute; none are dropped. The defaults are 50 a minute for Slack and Teams, 120 for email and push, and 30 for SMS and WhatsApp. `0` means no limit. ## Team channels **Workspace › Team channels** sends an event to one shared destination, whoever else is notified: every SLA breach to your operations channel in Slack, for example. Approval requests posted to a Slack or Teams channel have buttons; each press is checked as the person who pressed it. ## Templates On **Templates**, pick an event and a channel (or **Any channel outside the app**) and write a title and text. Use these placeholders: | Placeholder | Becomes | | --- | --- | | `{{event.label}}` | The kind of event, such as “Approval request” | | `{{event.title}}`, `{{event.body}}` | The event’s own title and text | | `{{record.label}}` | The record’s name as the recipient sees it | | `{{record.}}` | A field of the record, as the recipient sees it (masked fields stay masked, hidden ones are empty) | | `{{recipient.name}}` | The person’s name | | `{{workspace.name}}` | The workspace’s name | The preview shows the message the way the channel sends it (the email, the Slack message, the Teams card or the push notification), rendered for you with your own access. A template is used when the event’s **Message body outside the app** is set to **Template**. ## Connections **Connections** links your workspace to Slack, Microsoft Teams and Twilio (SMS and WhatsApp). Secrets are never shown again after you save them; leave a secret field empty to keep the saved one. **Test** checks the saved details with the provider. - Slack and Teams: see [Connect Slack and Microsoft Teams](https://docs.ligament.ai/guides/notifications/slack-teams-setup/index.md). - SMS and WhatsApp: enter your Twilio account SID, auth token, the number messages come from (and the WhatsApp sender, if you use WhatsApp), then turn the connection on. It’s off until you do. People add their own number on their notifications page. SMS messages are short: the minimal text and a link, no buttons. ## People **People** lists every member with their linked Slack and Teams accounts. **Sync by email** links members whose account email matches a Slack account. In Teams, people link themselves by opening the Ligament app once. You can also link or unlink someone by hand; a link you set by hand is kept by later syncs. Slack and Teams use these links to send direct messages, and to know who pressed a button. An unlinked person gets no direct messages, and a press from them is refused politely. ## Deliveries **Deliveries** is the delivery log: one row per message and channel, newest first, with its status: | Status | Meaning | | --- | --- | | Pending | Waiting to be sent | | Held | Waiting for the end of the person’s quiet hours | | Sent | Handed to the provider | | Delivered | The provider confirmed it reached the person (Slack, Teams and in-app confirm straight away; push, SMS and WhatsApp confirm later) | | Failed | The last attempt failed; another is scheduled | | Dead | Gave up after 6 attempts, or the provider refused it for good (a revoked token, an unknown channel) | Failed sends are retried after about 30 seconds, then 1, 2, 4 and 8 minutes. Filter by status, channel or event; **Dead letters** shows the messages that gave up, and **Retry** queues one again. Open a row to see the message as it was sent, every attempt, when it was opened, and any button presses on it with their outcome. The list shows email addresses and phone numbers partly masked; a row’s details show them in full. ## Related - [Your notifications](https://docs.ligament.ai/guides/notifications/index.md) - [Notifications API](https://docs.ligament.ai/developers/notifications/index.md) - [Separation of duties](https://docs.ligament.ai/guides/access/separation-of-duties/index.md) --- # API overview > Base URL, authentication, request and response conventions, and a first call. Source: https://docs.ligament.ai/developers/ The Ligament API lets your own code read and change the same records, workflows and app definitions that people use in the app. Use it to sync records with another system, build a dashboard, run a nightly export or give an AI agent controlled access to your workspace. This page covers what every call has in common. The full list of endpoints is in the [REST API reference](https://docs.ligament.ai/reference/rest-api/index.md), and the same API is published as an OpenAPI document at [/openapi.json](https://docs.ligament.ai/openapi.json). ## Base URL The API lives on the same origin as the app, under `/api`: ```plaintext https://app.ligament.ai/api ``` ## Authentication Send an API key as a Bearer token on every request: ```plaintext Authorization: Bearer ``` You create keys in the app under **Settings › API keys** (see [API keys and scopes](https://docs.ligament.ai/developers/api-keys/index.md)). The key is shown once, when you create it. Keep it in a secret store or an environment variable; the examples in these docs read it from `$LIGAMENT_API_KEY`. The app itself calls the same endpoints with a signed-in browser session instead of a key. The two are not interchangeable: | Question | API key | Signed-in session | | --- | --- | --- | | Who it acts as | The person who created the key, capped at their current role | The signed-in person | | What limits it | The key’s scopes, then that person’s access | That person’s role and access | | Where it works | Every endpoint that declares a scope | Every endpoint, including the session-only ones | A few areas only accept a signed-in session: managing API keys, SSO providers, the security policy and OIDC clients among them. A key gets `403 session_required` there. The [scopes reference](https://docs.ligament.ai/reference/scopes/index.md#session-only) lists them. ## Requests and responses Request and response bodies are JSON. Send `Content-Type: application/json` on `POST`, `PUT` and `PATCH`. Timestamps are ISO 8601 in UTC (`2026-11-30T13:57:30.540Z`). Errors are JSON too, with an HTTP status that tells you what kind of problem it is. Most permission errors carry a machine-readable `code` and a `fix` you can show to a person or feed back to an agent. See [Errors](https://docs.ligament.ai/developers/errors/index.md). ## A first call: list records Records are addressed by entity key, for example `incident`, `person` or `case`. This lists the newest incident in the workspace: ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=1" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` The response has the rows, the total number of matching records and what to send for the next page (trimmed to a few fields here): ```json { "rows": [ { "id": "cmx3c1hkc010fxjg0ona7p9j5", "number": "INC0000050", "title": "Verification API: elevated latency on document checks", "priority": "high", "state": "new", "createdAt": "2026-11-30T13:57:30.540Z", "updatedAt": "2026-11-30T14:30:03.676Z" } ], "total": 39, "nextCursor": "MjAyNi0xMS0zMFQxMzo1NzozMC41NDBafGNteDNjMWhrYzAxMGZ4amcwb25hN3A5ajU" } ``` Each row has the record’s fields plus `id`, `state`, `createdAt`, `updatedAt`, `createdBy` and `updatedBy`. Fields the key’s creator isn’t allowed to see are left out. [Lists, filters and pagination](https://docs.ligament.ai/developers/pagination/index.md) covers filtering, sorting, search and paging. To create a record, `POST` the field values to the same path: ```sh curl -s -X POST "https://app.ligament.ai/api/records/incident" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"title": "Printer on 3rd floor offline", "priority": "medium"}' ``` A successful create answers `201 Created` with the new record: ```json {"record":{"id":"cmx6au3qf00kd6x6suwxls72s","state":"new","title":"Printer on 3rd floor offline","number":"INC0000119","priority":"medium","time_worked_hours":null}} ``` The workspace fills in defaults and numbering (`state`, `number`) as it would for a record created in the app. ## Which workspace a key works in A key belongs to the workspace you were working in when you created it, and it only ever sees that workspace. There’s no workspace parameter on API calls. If your organisation has subsidiaries, create a key in each workspace your integration needs. To check what a key acts as, call `GET /api/access/whoami` (needs `records:read`): ```json { "userId": "vtvYBRvkNm4bYx6I0D9xqXS1lxzj7rBJ", "role": "admin", "admin": true, "keyId": "cmx6aqk0b00ef6x6sdme04cmc", "scopes": ["records:read", "records:write:incident"], "evaluator": "v2", "accessVersion": 468, "canExplainOthers": true } ``` `role` is the role the key acts with: its creator’s current role, at most `admin`. ## Other ways in - The [MCP server](https://docs.ligament.ai/developers/mcp/index.md) at `https://app.ligament.ai/api/mcp` gives AI clients the same records, access and spec tools over JSON-RPC. - The [CLI](https://docs.ligament.ai/developers/cli/index.md) wraps the API for scripts and terminals. - [Inbound hooks and run callbacks](https://docs.ligament.ai/developers/webhooks/index.md) cover calls that come from other systems into your workspace, and callbacks your workspace sends when a workflow run finishes. --- # API keys and scopes > Create keys, pick scopes, use read-only keys, and what a key can never do. Source: https://docs.ligament.ai/developers/api-keys/ Every API, MCP and CLI call authenticates with an API key. Create one key per integration, give it only the scopes that integration needs, and revoke it when the integration goes away. A read-only key for a reporting tool can’t change anything even if it leaks. ## Create a key 1. In the app, open **Settings › API keys** and select **New key**. 2. Give the key a name that says what uses it, for example “Service desk dashboard”. The name is how you’ll recognise the key in the list later, and it appears in the audit trail next to everything the key does. 3. Pick the scopes (see below). A new key starts with **Read records** only. 4. Select **Create key**, then copy the key from the banner above the list. It’s shown once. If you lose it, revoke the key and create a new one. \[Screenshot: The New API key panel in Settings › API keys: name "Service desk dashboard", Read records ticked, Write records set to specific entities with Incident selected, and the admin scopes section below\] The list shows each key’s name, the last four characters of the key, its scopes, when it was last used and when it was created. Admin scopes are highlighted. Anyone in the workspace can create keys for themselves. Only workspace admins and owners can create keys with admin scopes. ## Scopes A key holds a list of scopes. Each endpoint declares the scope it needs, and a request with a key that lacks it gets `403 insufficient_scope`, which names the missing scope. | Scope | Lets the key | | --- | --- | | `records:read` | Read records of any entity, exports, search, attachments and reports | | `records:write` | Create, update, transition, merge and delete records of any entity | | `schema:read` / `schema:write` | Read or change entity definitions: fields, forms, views, lifecycle, rules | | `apps:read` / `apps:write` | Read or build apps and their parts (scripts, connectors, pages, prompts, endpoints and so on). `apps:read` never reads the credentials among them: see [Credentials need an admin scope](#credentials-need-an-admin-scope) | | `workflows:read` / `workflows:write` | Read or change workflow definitions and automations | | `workflows:run` | Start, cancel and replay workflow runs | | `spec:read` | Read the app spec and plan changes | | `spec:propose` | Create and edit changesets for a person to review. Never applies anything | | `spec:apply` | Apply spec changes, within the creator’s build permissions | | `endpoints:invoke` | Call your workspace’s endpoints and API-key hooks, and its own tools on the MCP server | | `ai:use` | Use AI models and agents, and run the local agent from the CLI | | `import:write` | Run data imports | | `audit:read` | Read and export the audit logs | | `settings:read` | Read workspace settings: members, roles, access rules, invites, integrations, domains and so on. Never the credentials among them: see [Credentials need an admin scope](#credentials-need-an-admin-scope) | | `*` | Every scope above. Shown as **Full access** in the app | The [scopes reference](https://docs.ligament.ai/reference/scopes/index.md) has the full wording for each scope. ### Per-entity record scopes `records:read` and `records:write` cover every entity. To narrow a key to some entities, add the entity key: `records:read:incident`, `records:write:incident`. In the **New key** panel, set **Write records** to **Specific entities…** and pick them. The key in the screenshot above has `records:read` and `records:write:incident`. It can read anything the creator can read, but writing to another entity is refused: ```json { "error": "This API key lacks the \"records:write:problem\" scope.", "code": "insufficient_scope", "message": "This API key lacks the \"records:write:problem\" scope.", "fix": "Use a key that has \"records:write:problem\" (or \"*\"). Create one in Settings → API keys; the scopes are listed at https://docs.ligament.ai/reference/scopes/.", "required": ["records:write:problem"], "route": "/api/records/[entityKey]", "doc_url": "https://docs.ligament.ai/reference/scopes/" } ``` ### Read-only keys A key with only `records:read` reads records and nothing else. It’s the right key for dashboards, exports and BI tools. On the MCP server it sees the record and access tools that only read (`records_query`, `records_get`, `access_explain` and so on) and none that write. ### Admin scopes Six scopes are admin scopes. `*` does **not** include them: a key has an admin scope only if it names it. | Admin scope | Lets the key | | --- | --- | | `settings:write` | Change workspace settings: secrets, integrations, webhooks, embed tokens, portal, AI and notification settings, subsidiaries | | `members:write` | Change who is in the workspace and what they can do: members, invites, roles, access rules | | `sso:write` | Change identity provisioning: SCIM tokens and claimed email domains | | `apps:install` | Install, upgrade, uninstall and delete apps, modules and plugins | | `approvals:decide` | List and decide approvals | | `components:approve` | Approve custom component versions and grant them data scopes. The creator also needs the “Approve custom components” role permission | Anyone holding a key with an admin scope is effectively a workspace admin, so add only the admin scopes the key needs and store it like a password. A `*` key that calls an admin endpoint gets a `403` that says so: ```json { "error": "This API key lacks the \"settings:write\" scope.", "code": "insufficient_scope", "fix": "\"settings:write\" is an admin scope: \"*\" does not grant it. A workspace admin must create a key that names \"settings:write\" explicitly (Settings → API keys → Admin scopes); see https://docs.ligament.ai/developers/api-keys/#admin-scopes.", "required": ["settings:write"], "route": "/api/settings/webhook", "doc_url": "https://docs.ligament.ai/developers/api-keys/#admin-scopes" } ``` If someone who isn’t an admin tries to create a key with an admin scope, the request is refused with `403 admin_required`. ### Credentials need an admin scope `settings:read`, `apps:read` and `*` read settings and app parts, but never the credentials among them. Reading a credential needs an admin scope: | Credential | Needs | With `*` or `settings:read` | | --- | --- | --- | | Webhook signing secret (`GET /api/settings/webhook`) | `settings:write` | `403 insufficient_scope` | | Integration config (`GET /api/integrations`) | `settings:write` | The integrations without their config: `"config": null, "configRedacted": true` | | Pending invite and invite link tokens (`GET /api/invites`) | `members:write` | The invites with `"token": null, "tokenRedacted": true` | | Domain verification tokens (`GET /api/domains`) | `settings:write` or `sso:write` | The domains with `"verificationToken": null, "tokenRedacted": true` | | Plugin header values (`GET /api/plugins`) | `settings:write` | The header names with `"••••"` as each value, and `"headersRedacted": true` | | Script endpoint tokens (`GET /api/scripts`, `GET /api/scripts/{key}`) | `settings:write` | The scripts with `"token": null, "tokenRedacted": true` | | Connector endpoint tokens (`GET /api/connectors`, `GET /api/connectors/{key}`) | `settings:write` | The connectors with `"endpointToken": null, "endpointTokenRedacted": true` | Passwords, API keys, private keys and auth headers stored in an integration are never returned at all, whatever the key or session: they show as `"••••"`. A plugin’s OAuth connection is a credential too. Three requests change it, and each needs `settings:write` from a key (whose creator is an admin) and an admin from a browser session: | Request | What it does | | --- | --- | | `POST /api/plugins/{key}/oauth/client` | Saves the OAuth app’s client ID, client secret and scopes | | `DELETE /api/plugins/{key}/oauth/client` | Disconnects: removes the stored access and refresh tokens | | `GET /api/plugins/{key}/oauth/start` | Connects an account: stores that account’s tokens for the workspace | With `apps:write` or `*` these get `403 insufficient_scope`. People with Build but without admin rights get `403 capability_required`. `GET /api/plugins/{key}/oauth/client` returns only the connection status (configured, connected, client ID), never the secret or tokens, so `apps:read` and Build are enough for it. In **Build › Plugins** those people see the status, not the credential form or the **Connect** and **Disconnect** buttons. A signed-in person who can open the page that edits a credential (an admin, or someone with Build for plugins, scripts and connectors) still sees it there. If you send a plugin’s config back with a header still set to `"••••"`, the stored value is kept. ### What no key can do Some areas have no scope at all and only work from a signed-in browser session: creating and revoking API keys, SSO providers, the security policy, OIDC clients and moving a workspace in the hierarchy. A key gets `403 session_required` there. See [Areas no API key can reach](https://docs.ligament.ai/reference/scopes/index.md#session-only). ## A key is capped at its creator A key acts for the person who created it. Every request is checked against that person’s **current** role in the workspace, so a key can never do more than its creator can do right now: - An owner’s or admin’s key keeps its scopes. - A member’s key (or a key made by someone with a custom role) loses any admin scope. - A viewer’s key keeps only read scopes. `*` on a viewer’s key means “read everything the viewer can read”. - Record access rules and hidden fields apply to the key as they apply to its creator. A rule that says “me” (for example “assigned to me”) means the creator, and the roles the creator holds through assignments and groups count too. - The Build, AI, Admin, Logs and App store areas need the same capability for a key as for its creator in the app. A member’s key can’t propose spec changes (`spec:propose`) unless the member’s role has the Build capability. Without it the key gets `403 capability_required` (see [Errors](https://docs.ligament.ai/developers/errors/index.md#capability_required)). The cap is worked out on every request, not when the key is created. If you demote someone, their keys narrow straight away. Here a `*` key whose creator has the viewer role tries to create an incident: ```json { "error": "This API key has \"records:write:incident\", but its creator is now \"viewer\" in this workspace, and a key is capped at its creator's current role.", "code": "insufficient_scope", "fix": "Use a key created by a workspace member with write access, or ask an admin to restore the creator's role.", "required": ["records:write:incident"], "route": "/api/records/[entityKey]" } ``` Records a key creates or changes are attributed to its creator, and the activity history also names the key. If the creator leaves the workspace or is removed, all their keys stop working with `403 key_owner_inactive`. Create integration keys as a person who will stay in the workspace, and replace them before that person leaves. Admin areas also check the creator’s role, on top of the scope: a key created by someone who is no longer an owner or admin gets `403` there even when it names the scope. ## Revoke a key In **Settings › API keys**, tick the key (or several), choose **Revoke** and confirm. The key leaves the list, and any client still using it fails on its next request: ```plaintext HTTP/1.1 401 Unauthorized {"error":"Invalid or revoked API key"} ``` Anyone can revoke their own keys. Admins can revoke anyone’s. Revoked keys stay on record, so audit entries and request logs still show which key did what. ## Keys and the CLI `ligament login` creates a key for you through the browser, with full access (`*`) and any admin scopes you tick. See [CLI](https://docs.ligament.ai/developers/cli/index.md#sign-in). --- # Errors > Status codes and error bodies, and what to do about each. Source: https://docs.ligament.ai/developers/errors/ When a call fails, the HTTP status tells you what kind of problem it is and the JSON body tells you which one. Permission errors carry a stable `code` your code can branch on, a `message` for logs and a `fix` written for the person (or agent) who has to sort it out. Show the `fix` to whoever can act on it rather than swallowing it. All bodies on this page are real responses, with the host swapped for `https://app.ligament.ai`. ## Status codes | Status | Meaning | What to do | | --- | --- | --- | | `400` | The request body isn’t valid JSON, or a header value is malformed | Fix the request | | `401` | No usable credential: the key is wrong, revoked or missing | Check the `Authorization` header and the key | | `403` | The credential is valid but not allowed to do this | Read `code` and `fix` (below) | | `404` | The entity, record, workflow or endpoint doesn’t exist in this workspace | Check the key or id, and that the key belongs to the right workspace | | `409` | The request conflicts with the record’s current state | Re-read the record, then retry with a valid change | | `413` | The body is too large (inbound hooks accept up to 256 KB) | Send less | | `422` | The body is understood but the values aren’t valid | Fix the values named in `error` | | `429` | Too many calls to a rate-limited endpoint, such as starting workflow runs | Wait for the number of seconds in `Retry-After`, then retry | | `5xx` | Something went wrong on our side | Retry with backoff; contact support if it persists | ## 401: no usable key A key that doesn’t exist or has been revoked: ```plaintext HTTP/1.1 401 Unauthorized {"error":"Invalid or revoked API key"} ``` If you leave the `Authorization` header out entirely (and aren’t signed in), the answer is a `401` with a code and a fix: ```plaintext HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer {"error":"This request has no credential: send an API key, or sign in.","code":"unauthenticated","message":"This request has no credential: send an API key, or sign in.","fix":"Send the header \"Authorization: Bearer \". Create a key in Settings → API keys.","doc_url":"https://docs.ligament.ai/developers/api-keys/"} ``` Pages in the app (anything outside `/api`) still redirect to the sign-in page. ## 403: the four kinds Every `403` from the key check has the same shape: ```json { "error": "…", "code": "…", "message": "…", "fix": "…", "required": ["…"], "route": "…" } ``` `error` and `message` hold the same text. `required` lists the scope or capability that was missing, and `route` is the endpoint pattern that refused the call. A missing scope also carries `doc_url`, a link to the page that explains the scope. ### insufficient\_scope The key doesn’t have the scope this endpoint needs. Here a read-only key tries to create an incident: ```json { "error": "This API key lacks the \"records:write:incident\" scope.", "code": "insufficient_scope", "message": "This API key lacks the \"records:write:incident\" scope.", "fix": "Use a key that has \"records:write:incident\" (or \"*\"). Create one in Settings → API keys; the scopes are listed at https://docs.ligament.ai/reference/scopes/.", "required": ["records:write:incident"], "route": "/api/records/[entityKey]", "doc_url": "https://docs.ligament.ai/reference/scopes/" } ``` Fix: use a key with the scope in `required`. If it’s an admin scope, the `fix` says so: `*` doesn’t include admin scopes, so the key must name it. The same code also appears when the key has the scope but its creator’s current role doesn’t allow it; the message then says the key is capped at its creator’s role. See [API keys and scopes](https://docs.ligament.ai/developers/api-keys/index.md#a-key-is-capped-at-its-creator). ### session\_required The endpoint only accepts a signed-in browser session. Here a key with every admin scope tries to create another key: ```json { "error": "POST /api/keys only accepts a signed-in browser session, not an API key.", "code": "session_required", "message": "POST /api/keys only accepts a signed-in browser session, not an API key.", "fix": "Do this from the Ligament web app while signed in. API keys cannot manage keys, per-user state or platform settings.", "route": "/api/keys" } ``` Fix: do it in the app. No scope opens these endpoints to a key. ### key\_owner\_inactive The person who created the key is no longer a member of the workspace (they left or were removed), so the key no longer works. The message says so, and the `fix` asks a current member to create a new key in **Settings › API keys** and revoke this one. ### capability\_required People need a capability from their role to use the Build, AI, Admin, Logs and App store areas, and so do API keys: a key has the capabilities of the person who created it. A member without the Build capability who calls a Build endpoint from the app gets: ```json { "error": "Only workspace admins, or roles with the Build capability, can use Build", "code": "capability_required", "message": "Only workspace admins, or roles with the Build capability, can use Build", "fix": "Ask a workspace admin for a role whose permission set has the build:use capability.", "required": ["build:use"], "route": "/api/scripts" } ``` Some endpoints accept any one of several capabilities. Listing workflow runs (`GET /api/workflows/runs`) works with Build or Read logs, and `required` then lists both. For an API key the `fix` says the key can do what its creator can do. Fix: an admin gives the person (or the key’s creator) a role with that capability, or you use a key created by someone who has it. See [Roles and permission sets](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md). ## 403: access to records When the key has the right scope but its creator’s role doesn’t grant access to the entity, the record service refuses with an access code and a link to an explanation: ```json { "error": "Role \"member\" is not permitted to read \"equipment_loan\"", "code": "no_grant", "message": "Role \"member\" is not permitted to read \"equipment_loan\"", "fix": "… an admin can open it to staff …, or grant it in a permission set.", "explain": "/api/access/explain?entity=equipment_loan&action=read", "doc_url": "https://docs.ligament.ai/guides/access/why-can-i-see-this/" } ``` (The `fix` is shortened here.) Call the `explain` path with the same key to see every step of the decision: which roles were considered, which rule matched and which fields would be hidden. [Why can I see this?](https://docs.ligament.ai/guides/access/why-can-i-see-this/index.md) explains the answer. Some endpoints check the creator’s role directly and answer with a short body, for example `{"error":"Admins only"}`. ## 404: not found ```plaintext HTTP/1.1 404 Not Found {"error":"Entity \"incidents\" not found in this workspace"} ``` ```plaintext HTTP/1.1 404 Not Found {"error":"Record not found"} ``` Entity keys are singular (`incident`, not `incidents`). ## 409: conflict A state change that the record’s lifecycle doesn’t allow: ```plaintext HTTP/1.1 409 Conflict {"error":"Transition not allowed: in_progress → bogus_state"} ``` Spec and changeset calls answer `409` with the code `spec.conflict` when someone changed the artefact since you read it, and nothing is applied. The [CLI](https://docs.ligament.ai/developers/cli/index.md#exit-codes) turns this into exit code `2`. ## 422: validation A required field is missing: ```plaintext HTTP/1.1 422 Unprocessable Entity {"error":"Field \"title\" is required"} ``` A request body that doesn’t match the endpoint’s shape lists the problem per field: ```plaintext HTTP/1.1 422 Unprocessable Entity {"error":{"formErrors":[],"fieldErrors":{"workflowId":["Required"]}}} ``` Creating a key with a scope that doesn’t exist is also a `422`, so a typo never turns into a broader key than you meant: ```json {"error":"Unknown scope(s): record:read","code":"invalid_scope","invalid":["record:read"]} ``` ## MCP errors The [MCP server](https://docs.ligament.ai/developers/mcp/index.md#errors) wraps the same problems in JSON-RPC. A missing scope for one tool is a tool result with `isError: true`, not a failed request, so an agent can read the reason and carry on. --- # Lists, filters and pagination > Filter, sort, search and page through records. Source: https://docs.ligament.ai/developers/pagination/ `GET /api/records/` lists records. With query parameters you can filter, combine filters with AND or OR, sort, search, group with totals and page through any number of rows. Use it for exports, syncs and dashboards. Every example on this page lists incidents with a read-only key, and every response is real (rows trimmed). The list only ever returns records the key’s creator can read, and leaves out fields they can’t see. Filters, sorting and grouping on a hidden field match nothing rather than revealing what’s in it. ## Parameters | Parameter | Example | What it does | | --- | --- | --- | | `limit` | `limit=50` | Rows per page. Default 100, at most 1000 | | `cursor` | `cursor=MjAy…` | Fetch the page after this cursor (keyset paging) | | `offset` | `offset=100` | Skip this many rows (offset paging) | | `filters` | `filters=[{"field":"priority","op":"eq","value":"high"}]` | JSON array of filters, URL-encoded | | `filterField`, `filterValue` | `filterField=state&filterValue=in_progress` | Shorthand for one `eq` filter | | `match` | `match=any` | Combine `filters` with OR instead of AND | | `sort` | `sort=-priority,createdAt` | Sort by up to five fields; `-` means descending | | `q` | `q=vpn` | Free-text search across the fields you can read | | `groupBy` | `groupBy=priority` | Order rows by a field’s groups and add per-group counts | | `count` | `count=0` | Skip counting the total | Dated entities also take `asOf` and `knownAt`; see [Reading records as of a date](https://docs.ligament.ai/developers/as-of/index.md). ## The response ```json { "rows": [ … ], "total": 39, "nextCursor": "MjAyNi0xMS0zMFQwNTozOTo1Mi40MDJafGNteDJ1OWl2bDAwMzdqdzFoZ2h2ZWxpYm8", "nextOffset": 3 } ``` | Field | Meaning | | --- | --- | | `rows` | The records on this page | | `total` | How many records match, or `null` when it wasn’t counted (cursor pages and `count=0`) | | `nextCursor` | Pass as `cursor` to get the next page. `null` on the last page, and when you sort, search or group | | `nextOffset` | Pass as `offset` to get the next page, when you page by offset. `null` on the last page | | `summary` | Only with `groupBy` (or `summary=1`), on the first page: counts and numeric totals | ## Paging The default order is newest first. In that order, page with the cursor. It’s fast at any depth, and rows created while you page don’t shift the pages you haven’t fetched yet. ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=3" -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "rows": [ { "number": "INC0000050", "priority": "high", "state": "new", … }, { "number": "INC0000049", "priority": "low", "state": "new", … }, { "number": "INC0000042", "priority": "medium", "state": "new", … } ], "total": 39, "nextCursor": "MjAyNi0xMS0zMFQwNTozOTo1Mi40MDJafGNteDJ1OWl2bDAwMzdqdzFoZ2h2ZWxpYm8" } ``` Send the cursor back for the next page, with the same filters: ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=3&cursor=MjAyNi0xMS0zMFQwNTozOTo1Mi40MDJafGNteDJ1OWl2bDAwMzdqdzFoZ2h2ZWxpYm8" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "rows": [ { "number": "INC0000035", "priority": "critical", "state": "in_progress", … }, { "number": "INC0000034", "priority": "critical", "state": "in_progress", … }, { "number": "INC0000033", "priority": "low", "state": "new", … } ], "total": null, "nextCursor": "MjAyNi0xMS0yOVQxMzozNjo1My40NjVafGNteDF2djRkNDAxMXFmZXV0Z2lxanZwM2I" } ``` Cursor pages don’t count the total (`total: null`), so keep the one from the first page. Stop when `nextCursor` is `null`. As soon as you `sort`, search with `q` or `groupBy`, paging switches to offsets: `nextCursor` is `null` and `nextOffset` tells you where the next page starts. You can also use `offset` in the default order. To save a count on every page of a long offset scroll, add `count=0` after the first page: ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=3&offset=3&count=0" -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "rows": [ … 3 rows … ], "total": null, "nextOffset": 6, … } ``` ## Filters `filters` is a JSON array, URL-encoded. Each filter has a `field`, an `op` and a `value` (or `values` for `in`): | `op` | Matches when the field | | --- | --- | | `eq` / `ne` | equals / doesn’t equal `value` | | `contains` | contains `value`, ignoring case | | `in` | equals one of `values` | | `lt`, `lte`, `gt`, `gte` | is less / greater than `value`. Numbers compare as numbers, dates and date-times as dates, anything else as text | | `empty` / `not_empty` | has no value / has a value | You can filter on any field you can read, and on `id`, `state`, `createdAt`, `updatedAt`, `createdBy` and `updatedBy`. Values are compared as text, so send `"true"` for a checkbox and `"2026-11-30"` for a date. Open incidents that are critical or high: ```sh curl -s -G "https://app.ligament.ai/api/records/incident" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ --data-urlencode 'filters=[{"field":"priority","op":"in","values":["critical","high"]},{"field":"state","op":"ne","value":"closed"}]' \ --data-urlencode 'limit=3' ``` ```json { "rows": [ { "number": "INC0000050", "priority": "high", "state": "new", … }, { "number": "INC0000035", "priority": "critical", "state": "in_progress", … }, { "number": "INC0000034", "priority": "critical", "state": "in_progress", … } ], "total": 17, "nextCursor": "MjAyNi0xMS0yOVQxMzozNjo1My41MTFafGNteDF2djRlZjAxMXZmZXV0b3ZhbHNjZDg" } ``` Incidents created on or after 30 November: ```sh --data-urlencode 'filters=[{"field":"createdAt","op":"gte","value":"2026-11-30"}]' ``` Filters on a field that doesn’t exist are ignored, and so is a `filters` value that isn’t valid JSON. If a list comes back larger than you expected, check the field keys and the JSON first. ### `@me` `@me` as a `value` (or one of the `values`) means the person the key acts for, its creator. With a key Ada created, the incidents assigned to her: ```sh --data-urlencode 'filters=[{"field":"assigneeId","op":"eq","value":"@me"}]' ``` `@me` only changes what your filter asks for. What the key may read is still decided by its scopes and its creator’s role. The same applies to `filters` in a report spec (`POST /api/reports/run`). ### Any instead of all Filters are combined with AND. Add `match=any` to combine them with OR. The same two filters, critical **and** escalated, then critical **or** escalated: ```sh --data-urlencode 'filters=[{"field":"priority","op":"eq","value":"critical"},{"field":"escalated","op":"eq","value":"true"}]' ``` | Matching | `total` | | --- | --- | | default (all) | 12 | | `match=any` | 24 | ## Sorting `sort` takes a comma-separated list of up to five fields, each optionally prefixed with `-` for descending. Choice fields sort in the order their options are defined, and lifecycle states in lifecycle order, so `-priority` puts critical first: ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=3&sort=-priority,createdAt" -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "rows": [ { "number": "INC0000056", "priority": "critical", "title": "VPN drops every 15-20 minutes for the Ba…", … }, { "number": "INC0000005", "priority": "critical", "title": "Inference latency p95 above 2s", … }, { "number": "INC0000012", "priority": "critical", "title": "Staging cluster nodes NotReady", … } ], "total": 39, "nextCursor": null, "nextOffset": 3 } ``` Empty values sort last. ## Search `q` searches the text of the fields you can read, ignoring case. It combines with filters. ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=3&q=vpn" -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "rows": [ { "number": "INC0000042", "title": "VPN keeps disconnecting on macOS", … }, { "number": "INC0000031", "title": "VPN disconnects every 10 minutes (#30)", … }, { "number": "INC0000016", "title": "VPN disconnects every 10 minutes (#15)", … } ], "total": 5, "nextCursor": null, "nextOffset": 3 } ``` ## Grouping and totals `groupBy=` orders the rows group by group and, on the first page, adds a `summary` with the count per group and the sum of each number field, overall and per group. It’s what you need for a chart or a board without fetching every row: ```sh curl -s "https://app.ligament.ai/api/records/incident?limit=2&groupBy=priority" -H "Authorization: Bearer $LIGAMENT_API_KEY" ``` ```json { "rows": [ … ], "total": 39, "nextCursor": null, "nextOffset": 2, "summary": { "total": 39, "sums": { "resolution_minutes": null, "reopen_count": 6 }, "groups": [ { "key": "low", "count": 10, "sums": { "resolution_minutes": null, "reopen_count": 2 } }, { "key": "medium", "count": 10, "sums": { "resolution_minutes": null, "reopen_count": 2 } }, { "key": "high", "count": 6, "sums": { "resolution_minutes": null, "reopen_count": 2 } }, { "key": "critical", "count": 13, "sums": { "resolution_minutes": null, "reopen_count": null } } ] } } ``` A sum is `null` when no record in that group has a value for the field. Add `summary=1` without `groupBy` to get the overall totals only. ## The same from MCP and the CLI The MCP tool [`records_query`](https://docs.ligament.ai/reference/mcp-tools/index.md#records_query) takes the same filters, `match`, `sort`, `q`, `limit` and `offset` as JSON arguments. The CLI’s `ligament records list` takes filters as `field.op.value`: ```sh ligament records list incident -f priority.eq.critical -f state.eq.in_progress --sort=-createdAt -n 2 ``` --- # As-of parameters > Read and write effective-dated records over the API, MCP and the CLI: asOf, knownAt, effective, history, the changes feed and error codes. Source: https://docs.ligament.ai/developers/as-of/ This page lists every parameter for effective-dated records. For what the modes mean and when to use them, start with the guides: [Changes, corrections and rescinds](https://docs.ligament.ai/guides/effective-dating/changes-and-corrections/index.md) and [Reading as of a date](https://docs.ligament.ai/guides/effective-dating/as-of/index.md). The [worked example](https://docs.ligament.ai/guides/effective-dating/hr-example/index.md) shows real calls end to end. Effective dating is switched on per entity (see [Effective dating](https://docs.ligament.ai/guides/effective-dating/index.md#turning-it-on)). On an entity that isn’t dated, `asOf` returns today’s values. Send `effective` in writes to dated entities only. ## Scopes | Call | API key scope | | --- | --- | | Reads, history, changes feed | `records:read` or `records:read:` | | Writes, batch | `records:write` or `records:write:` | | `knownAt`, `include=corrections`, `before` values in the feed | `audit:read`, or a key whose creator holds `records.as_recorded` | A key acts as the person who created it, capped at their current role, so access rules and capabilities apply as they would to that person. See [API keys](https://docs.ligament.ai/developers/api-keys/index.md) and [Scopes](https://docs.ligament.ai/reference/scopes/index.md). ## Dates - A date `YYYY-MM-DD` means 00:00 on that day in the workspace’s time zone. - A version runs from its `from` date up to, not including, its `to` date. `to` is `null` (or `"infinity"` in write responses) when the version has no end. ## Reading: `asOf` and `knownAt` These query parameters work on `GET /api/records/` (with `filters`, `sort`, `q`, `groupBy` and `summary=1`) and on `GET /api/records//`. | Parameter | Accepts | Effect | | --- | --- | --- | | `asOf` | `YYYY-MM-DD`, an ISO instant, `@today`, `@today±N[d|w]`, `@end_of_last_month`, `@end_of_last_quarter`, `@end_of_last_year` | Dated fields show the version in force on that date; other fields show today’s value. Records not started on that date are left out of lists, and `GET` one returns 404 `effective_not_started`. Filters, sorting, grouping and summary sums use the as-of values. | | `knownAt` | An ISO instant, or a date (= the end of that day in the workspace’s zone) | Reads the versions as they were recorded at that moment. Combine with `asOf`; without `asOf`, the date is today. Needs `records.as_recorded` or an `audit:read` key, else 403 `effective_known_at_forbidden`. | Access is always decided now, on today’s data. In a URL, encode `+` in `@today+2w` as `%2B`. Each record read with either parameter has an `_effective` object: | Field | Contains | | --- | --- | | `asOf` | The resolved date. | | `knownAt` | The resolved instant, when asked for. | | `groups` | Per dated group: `{ from, to, seq, versionId, kind, reason }` of the version shown, or `null` when the group has no version on that date. Groups whose fields you can’t read are left out. | | `current` | The fields shown at today’s value (not dated). | | `dated` | `false` on an entity that isn’t dated. | ### Reports `POST /api/reports/run` takes `asOf` or `series` inside `spec`: | Field | Accepts | | --- | --- | | `spec.asOf` | The same values as the `asOf` parameter. | | `spec.series` | `{ every: "day"|"week"|"month"|"quarter"|"year", from, to, at?: "end"|"start" }`. `from` and `to` are `YYYY`, `YYYY-MM` or `YYYY-MM-DD`. Evaluates the report at each period’s end (or start), at most 120 points, else 422 `effective_bad_series`. | The answer has `data.buckets` (with `asOf`) or `data.series: [{ at, value }]` (or `{ at, buckets }` with `groupBy`), plus `data.effective: { asOf, knownAt, dated }`. ## Writing: `effective` `POST /api/records/` and `PATCH /api/records//` take an `effective` object next to the values. Send the values flat (`{ "salary": 90000, "effective": { … } }`) or in an envelope (`{ "values": { "salary": 90000 }, "effective": { … } }`). Use the envelope only together with `effective`. | Field | Type | Meaning | | --- | --- | --- | | `from` | `YYYY-MM-DD` | `change`: the date the values apply from (default today). `correction`: a date the version to correct is in force on, or with `version`, its new start date. `rescind`: a date the version to remove is in force on. On create: the record’s start date. | | `reason` | string | A reason slug from the group’s list for a change. Any text for a correction or rescind. | | `mode` | `change` | `correction` | `rescind` | Default `change`. A create takes only `change`. | | `version` | version id | The version to correct (re-time) or rescind, from the history. | | `group` | group key | The group of a rescind by date. | | `baseVersion` | version id | The version your client showed. If it was replaced meanwhile, 409 `effective_conflict` with the current versions in `details.current`. | Without `effective`, a write to dated fields is a change from today, unless a group requires an effective date. Only dated values that differ from today’s are recorded. Non-dated fields in the same request are always written as today. The response adds `effective`, one entry per group written: | Field | Contains | | --- | --- | | `group`, `mode`, `changeId` | What was written. `changeId` matches the history and the changes feed. | | `version` | `{ id, from, to, seq, status }` of the version written (`null` for a rescind). `status` is `scheduled`, `in_force` or `past`. | | `rescinded` | `{ id, from, to }` of the version a rescind removed. | | `propagated` | Later versions this write rewrote: `[{ from, fields }]`. | | `warnings` | Human-readable notes: a later change that now carries these values, a second change on the same day. | | `periods` | The date ranges whose values changed, with their fields. | | `past`, `retroPeriod` | Whether the write changed a date before today, and that past range. | | `retro` | The write went through a [locked period](https://docs.ligament.ai/guides/effective-dating/locked-periods/index.md). | `record` in the response always shows today’s values. ### Batch `POST /api/records/batch` writes several dated records as one change, all or nothing: ```json { "items": [ { "entity": "employee", "id": "", "values": { "location": "Chiang Mai" }, "effective": { "from": "2027-03-01", "reason": "transfer" } } ] } ``` Up to 200 items, dated fields only (`effective_batch_plain` otherwise). The key needs `records:write` and write access to each item’s entity. The answer is `{ items: [{ entity, id, record, effective }] }`. ## History `GET /api/records///history` | Parameter | Meaning | | --- | --- | | `group` | One group. Default: all. | | `include=corrections` | Also list superseded versions. Needs `records.as_recorded` or `audit:read`. | | `knownAt` | The history as recorded at that instant. Same rights. | Answer: `{ entity, recordId, groups: [{ key, label, fields }], entries, proposed: null, knownAt }`. Each entry has `versionId, group, from, to, seq, kind, reason, retro, changeId, by, recordedAt, supersededAt, supersededBy, status, values`, newest first. `status` is `scheduled`, `in_force`, `past`, `same_day` or `superseded`. Fields you can’t read are removed from `values`. ## Changes feed `GET /api/records//changes` | Parameter | Meaning | | --- | --- | | `recordedSince` | Required. An ISO instant: your last run’s `watermark`. | | `recordedUntil` | Optional upper bound. | | `group` | Comma-separated groups. | | `effectiveFrom`, `effectiveTo` | Only changes whose changed periods overlap these dates. | | `overlapsBefore` | Only changes touching a period that starts before this date (periods you’ve already exported). | | `cursor`, `limit` | Paging: pass `nextCursor` back as `cursor`. `limit` defaults to 100, at most 500. | Answer: `{ changes, nextCursor, watermark }`, oldest first. Each change has `changeId, recordId, group, mode, recordedAt, by, reason, retro, periods, after, before`. `before` is `null` unless you have `records.as_recorded` or an `audit:read` key. `watermark` is `null` when nothing changed. ## MCP tools The [MCP server](https://docs.ligament.ai/developers/mcp/index.md) has five record tools with dating built in. Each call needs the scope of the matching REST route for its entity. | Tool | Arguments | | --- | --- | | [`records_query`](https://docs.ligament.ai/reference/mcp-tools/index.md#records_query) | `entity`, `filters`, `match`, `sort`, `q`, `limit`, `offset`, `asOf`, `knownAt` | | [`records_get`](https://docs.ligament.ai/reference/mcp-tools/index.md#records_get) | `entity`, `id`, `asOf`, `knownAt` | | [`records_history`](https://docs.ligament.ai/reference/mcp-tools/index.md#records_history) | `entity`, `id`, `group`, `include` (`["corrections"]`), `knownAt` | | [`records_changes`](https://docs.ligament.ai/reference/mcp-tools/index.md#records_changes) | `entity`, `recordedSince`, `recordedUntil`, `group` (array), `effectiveFrom`, `effectiveTo`, `overlapsBefore`, `cursor`, `limit` | | [`records_change`](https://docs.ligament.ai/reference/mcp-tools/index.md#records_change) | `entity`, `id`, `values`, `effective` (as above) | Results come back as JSON text, the same shapes as the REST answers. Errors come back with `isError: true` and the error body, for example: ```json { "code": "effective_not_started", "message": "This employee didn't exist yet on 2026-01-01", "details": { "asOf": "2026-01-01" }, "status": 404 } ``` ## CLI The [`ligament records`](https://docs.ligament.ai/reference/cli/index.md#records) commands call the same API. Set `LIGAMENT_URL` and `LIGAMENT_API_KEY` first (see [CLI](https://docs.ligament.ai/developers/cli/index.md)). | Command | Options | | --- | --- | | `ligament records list ` | `--as-of`, `--known-at`, `-f, --filter field.op.value` (repeatable; `in` takes `a~b~c`), `--match`, `--sort`, `-q`, `-n, --limit`, `--json` | | `ligament records get ` | `--as-of`, `--known-at` | | `ligament records history ` | `-g, --group`, `--corrections`, `--known-at`, `--json` | | `ligament records changes ` | `--since` (required), `--until`, `-g, --group`, `--overlaps-before`, `--cursor`, `--json` | | `ligament records change ` | `-s, --set field=value` (repeatable), `--from`, `--reason`, `--mode`, `--version-id`, `--group` | ```bash ligament records change employee cmx6ai5t300816x6sb6mvjpvu --set salary=95000 --from 2027-02-01 ``` ```text Error: Pay changes need a reason (hire, merit, promotion, market_adjustment) (effective_reason_required) ``` The commands exit with 0 on success and 1 on an error. ## Errors Errors have the shape `{ error, code, path, message, fix?, details? }`. | Code | Status | When | | --- | --- | --- | | `effective_bad_as_of` | 422 | `asOf` isn’t a date, an instant or a token. | | `effective_bad_known_at` | 422 | `knownAt` isn’t an instant or a date. | | `effective_bad_series` | 422 | A report `series` is malformed or has more than 120 points. | | `effective_known_at_forbidden` | 403 | `knownAt` or `include=corrections` without `records.as_recorded` or `audit:read`. | | `effective_not_started` | 404 | `GET` one record with `asOf` before it started. | | `effective_not_dated` | 422 | History, changes feed or batch on an entity that isn’t dated. | | `effective_not_found` | 404 | History of, or a batch item for, a record you can’t read or that doesn’t exist. | | `effective_invalid` | 422 | A malformed `effective` object or feed parameter (see `path`). | | `effective_group_unknown` | 422 | `group` isn’t a dated group of the entity. | | `effective_group_required` | 422 | A rescind or re-time names neither `version` nor `group`. | | `effective_one_group` | 422 | A correction or rescind touches more than one group. | | `effective_no_values` | 422 | Nothing to write: no values of a dated group. | | `effective_date_required` | 422 | The group requires `effective.from`. | | `effective_reason_required` | 422 | A reason is missing (always required for corrections and rescinds). | | `effective_reason` | 422 | The reason isn’t in the group’s list (`details.reasons`). | | `effective_future_too_far` | 422 | `from` is further ahead than the group allows (`details.maxDays`). | | `effective_backdate_needs_capability` | 422 | The change reaches further back than the group allows without `effective.retro`. | | `effective_locked` | 422 | The change touches a locked period (`details.lockedThrough`, `setBy`, `reason`). | | `effective_no_version` | 422 | Nothing is in force on `from` (the record starts later). | | `effective_rescind_first` | 422 | The first version of a record can’t be rescinded. | | `effective_retime_conflict` | 422 | A version can’t move to that date (past the next version, or onto another change). | | `effective_batch_plain` | 422 | A batch item has fields that aren’t dated. | | `effective_conflict` | 409 | The version named in `version` or `baseVersion` was replaced meanwhile. | See [Errors](https://docs.ligament.ai/developers/errors/index.md) for the platform’s other error codes. --- # MCP server > Connect an MCP client to your workspace: records, access, spec and changeset tools. Source: https://docs.ligament.ai/developers/mcp/ Your workspace runs a Model Context Protocol (MCP) server. Point an AI client such as Claude Code or Cursor at it and the agent can query records, explain access decisions, read your app definitions and propose changes for a person to review. What the agent can do is decided by the API key you give it, so a key with `spec:propose` lets an agent suggest changes but never apply them. For step-by-step client setup, see [Connect an agent with MCP](https://docs.ligament.ai/build-with-ai/mcp-setup/index.md). This page describes the server itself. ## Endpoint and transport ```plaintext https://app.ligament.ai/api/mcp ``` The server speaks MCP’s streamable HTTP transport: JSON-RPC 2.0 over `POST`, one request (or a JSON array of requests) per call, answered with plain JSON. It doesn’t push messages to the client, so no event stream is needed. Authenticate with an API key: ```plaintext Authorization: Bearer Content-Type: application/json ``` The server reports protocol version `2025-03-26` and the server name `ligament`. ## What each scope allows `tools/list` returns only the tools the key’s scopes allow, and `tools/call` refuses the rest. A key needs at least one of `records:read`, `spec:read`, `spec:propose`, `spec:apply`, `members:write` or `endpoints:invoke` to connect at all. | Scope | Tools | | --- | --- | | `records:read` (or `records:read:`) | `records_query`, `records_get`, `records_history`, `records_changes`; `access_whoami`, `access_explain`, `access_effective` | | `records:write` (or `records:write:`) | `records_change` | | `spec:read` | `spec_catalog`, `spec_list`, `spec_get`, `spec_schema`, `spec_validate`, `spec_plan`, `spec_history`; `changeset_list`, `changeset_get`, `changeset_plan`; `access_plan`; and the spec resources | | `spec:propose` | `changeset_create`, `changeset_put_items`, `changeset_discard` | | `spec:apply` | `spec_apply`, `changeset_apply` | | `members:write` (admin scope) | `invites_list`, `invites_resend` (the key’s creator must be an owner or admin; see [Inviting people](https://docs.ligament.ai/guides/workspaces/inviting-people/index.md#with-mcp)) | | `endpoints:invoke` | One tool per connector operation and script your workspace exposes (`connector____`, `script__`) | `*` includes all of these except `members:write`, which a key only has when it names it (see [API keys](https://docs.ligament.ai/developers/api-keys/index.md)). For an agent, create a key with just the scopes it needs. A key with `spec:read`, `spec:propose` and `records:read` lists 21 tools; a key with only `records:read` lists 7. Tools act as the key’s creator with the key’s role, capped at the creator’s current role, the same as REST calls with that key. The spec and changeset tools, `access_plan` and the spec resources also need the creator to have the Build capability, as the matching REST routes do: a member’s key without it gets `capability_required`. One exception, also as in REST: an [app admin](https://docs.ligament.ai/guides/access/app-admins/index.md)’s key may call `access_plan` for their own app’s permission sets, roles and restrictions. Inputs and results for every tool are in the [MCP tools reference](https://docs.ligament.ai/reference/mcp-tools/index.md). ## Initialize ```sh curl -s "https://app.ligament.ai/api/mcp" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}' ``` ```json {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-03-26","capabilities":{"tools":{},"resources":{}},"serverInfo":{"name":"ligament","version":"1.0.0"}}} ``` Notifications such as `notifications/initialized` have no `id` and get an empty `202 Accepted`. ## List tools ```sh curl -s "https://app.ligament.ai/api/mcp" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' ``` With a read-only key (`records:read`) the answer lists seven tools. Each has a description and a JSON Schema for its input (one shown here): ```json { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "access_whoami", … }, { "name": "access_explain", … }, { "name": "access_effective", … }, { "name": "records_query", "description": "List records of an entity: filters ([{field, op, value|values}], ops eq ne contains empty not_empty in lt lte gt gte), match all|any, sort (\"-salary,name\"), q (search), limit (≤ 200), offset. …", "inputSchema": { "type": "object", "required": ["entity"], "properties": { "entity": { "type": "string", "description": "Entity key, e.g. person" }, "filters": { "type": "array", "items": { "type": "object" } }, "match": { "type": "string", "enum": ["all", "any"] }, "sort": { "type": "string" }, "q": { "type": "string" }, "limit": { "type": "number" }, "offset": { "type": "number" }, "asOf": { "type": "string", … }, "knownAt": { "type": "string", … } } } }, { "name": "records_get", … }, { "name": "records_history", … }, { "name": "records_changes", … } ] } } ``` ## Call a tool Critical incidents, two at a time: ```sh curl -s "https://app.ligament.ai/api/mcp" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"records_query","arguments":{"entity":"incident","filters":[{"field":"priority","op":"eq","value":"critical"}],"limit":2}}}' ``` The result is MCP text content holding JSON, the same shape as the [REST list](https://docs.ligament.ai/developers/pagination/index.md) (shortened here): ```json { "jsonrpc": "2.0", "id": 4, "result": { "content": [ { "type": "text", "text": "{\"rows\":[{\"title\":\"Payments API returning 500s\",\"number\":\"INC0000035\",\"priority\":\"critical\",\"state\":\"in_progress\",…},{\"title\":\"Laptop battery swelling (#33)\",\"number\":\"INC0000034\",…}],\"total\":13,\"nextCursor\":\"…\",\"nextOffset\":2}" } ] } } ``` In filters, `@me` means the key’s creator, so `{"field":"assigneeId","op":"eq","value":"@me"}` finds the records assigned to them. `access_whoami` shows who the key acts as: ```json {"userId":"vtvYBRvkNm4bYx6I0D9xqXS1lxzj7rBJ","role":"admin","admin":true,"keyId":"cmx1wize20131feutkwlgmkw1","scopes":["records:read"],"evaluator":"v2","accessVersion":427,"canExplainOthers":true} ``` ### Proposing a change With `spec:propose`, an agent creates a changeset that waits for a person to review. Nothing is applied: ```json {"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"changeset_create","arguments":{"title":"Service desk home: add a My open incidents list","note":"Proposed from Claude Code. Adds a list block filtered to the signed-in agent."}}} ``` The result (shortened) records who proposed it, through which key, and links to the review page: ```json { "id": "cmx6arke600je6x6ss0eskqy8", "title": "Service desk home: add a My open incidents list", "status": "open", "createdBy": { "kind": "key", "label": "Ada Admin via API key Claude Code (proposals only) (…4n9P)", … }, "items": [], "url": "https://app.ligament.ai/build/changes/cmx6arke600je6x6ss0eskqy8" } ``` A person then opens the changeset in **Build › Changes** and applies or discards it. The agent’s loop is `spec_get` → edit the doc → `spec_plan` → `changeset_create` or `changeset_put_items`. See [Let agents propose changes](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md) and [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md). Even a key with `spec:apply` can’t apply every change by itself: when the workspace requires a person to apply changes made with a key (access rules, by default), `spec_apply` and `changeset_apply` return `proposed: true, applied: false` with the changeset’s `url`, and the change waits for review. ## Resources With `spec:read`, and a key whose creator has the Build capability, `resources/list` serves the spec catalog and one JSON Schema per artefact type, and `resources/templates/list` returns the template `ligament://spec/schema/{type}`: | URI | Content | | --- | --- | | `ligament://spec/catalog` | Artefact types, entities and fields, roles, components and blocks (same as `spec_catalog`) | | `ligament://spec/schema/` | The JSON Schema of one artefact type, for example `page` | Read one with `resources/read` and `{"uri": "…"}`. Without the Build capability both lists are empty, and `resources/read` answers a JSON-RPC error: ```json {"jsonrpc":"2.0","id":3,"error":{"code":-32001,"message":"Only workspace admins, or roles with the Build capability, can use Build","data":{"uri":"ligament://spec/catalog","code":"capability_required","required":["build:use"],"message":"Only workspace admins, or roles with the Build capability, can use Build"}}} ``` ## Errors Problems with the request itself are JSON-RPC errors: | Situation | HTTP | Response | | --- | --- | --- | | No `Authorization` header | 401 | `{"jsonrpc":"2.0","id":null,"error":{"code":-32001,"message":"Missing Authorization header"}}` | | Invalid or revoked key | 401 | `error.code` `-32001`, `"Invalid or revoked API key"` | | Key without any MCP scope | 403 | `error.code` `-32001`, with the usual `insufficient_scope` body in `error.data`. It names `endpoints:invoke`, but `records:read`, `members:write` or a spec scope also let the key connect | | Body isn’t JSON | 400 | `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"parse error"}}` | | Unknown method | 200 | `{"jsonrpc":"2.0","id":7,"error":{"code":-32601,"message":"method not found: prompts/list"}}` | When a tool refuses a call, for example because the key lacks the tool’s scope or the creator can’t access the record, the request still succeeds and the tool result has `isError: true`. The text is JSON with `message`, `code` and the details: ```json {"jsonrpc":"2.0","id":5,"result":{"content":[{"type":"text","text":"{\"message\":\"API key lacks scope \\\"records:write:incident\\\" (needed for records_change)\",\"code\":\"insufficient_scope\",\"required\":[\"records:write:incident\"]}"}],"isError":true}} ``` An agent can read that and tell you which key it needs. ## Your workspace’s own tools With `endpoints:invoke`, `tools/list` also includes the connectors and scripts your workspace has chosen to expose: one tool per connector operation (`connector____`) and one per script (`script__`). They run as the key’s creator, at most with member rights. Only items marked as exposed appear, so nothing is published to agents by default. --- # CLI > Install the CLI, sign in, and manage apps, specs, changesets and records from a terminal. Source: https://docs.ligament.ai/developers/cli/ The `ligament` command line tool wraps the API for terminals, scripts and CI jobs. Use it to pull your app definitions into files, plan and propose changes as changesets, list and change records, and keep an eye on workflow runs and approvals. Every command authenticates with an API key, so a script can only do what its key allows. The full list of commands and options is in the [CLI reference](https://docs.ligament.ai/reference/cli/index.md). ## Get the CLI The CLI is the Node.js package `@ligament/cli`, which installs the `ligament` command. Publishing it on the public npm registry is **Coming**: until then `npm install` from the registry won’t find it. To get the package, contact hello@ligament.ai. Check it runs: ```sh ligament --version ``` ```plaintext 0.1.0 ``` ## Sign in The CLI reads two environment variables: | Variable | Value | | --- | --- | | `LIGAMENT_URL` | Your workspace’s address, for example `https://app.ligament.ai`. Required | | `LIGAMENT_API_KEY` | An API key | It also reads a `.env` file in the current directory, so you can keep both there for a project. Variables already set in your shell take precedence over the file. ### With a key you create 1. Create a key in **Settings › API keys** with the scopes your work needs (see [API keys and scopes](https://docs.ligament.ai/developers/api-keys/index.md)). For reading and proposing spec changes that’s `spec:read` and `spec:propose`; for records, `records:read` and maybe `records:write`. 2. Put it where the CLI looks: ```sh export LIGAMENT_URL=https://app.ligament.ai export LIGAMENT_API_KEY= ``` 3. Run any command, for example `ligament records list incident -n 2`. ### With `ligament login` `ligament login` creates a key for you through the browser. Set `LIGAMENT_URL` first: it opens the **Authorize the Ligament CLI** page at that address (or prints the address if no browser opens). You’re asked whether to add any admin scopes, then select **Authorize**. \[Screenshot: The Authorize the CLI page: the CLI gets a new API key with full access, with optional admin scopes listed below and an Authorize button\] The page creates a key named “CLI” with full access (`*`) plus the admin scopes you ticked, and hands it to the waiting terminal: ```plaintext ✔ Authentication successful! ✓ Saved API Key to .env ``` The key is appended to `.env` in the directory you ran `login` from. Keep that file out of version control. The key appears in **Settings › API keys** like any other, and you revoke it there. **Note** If the page that opens isn’t your workspace, check `LIGAMENT_URL` (in your shell or in `.env`). Older setups that set `LIGAMENT_APP_URL` for `login` still work; `LIGAMENT_URL` wins when both are set. ## Command families | Commands | Scopes | What they do | | --- | --- | --- | | `ligament records list`, `get`, `history`, `changes`, `change` | `records:read`, `records:write` | Read and change records, including effective-dated ones | | `ligament spec list`, `get`, `pull`, `validate`, `plan`, `apply`, `history`, `schema`, `catalog` | `spec:read`, `spec:apply` | Read app artefacts (pages, access rules and so on) as files, plan changes, apply them | | `ligament changeset list`, `show`, `create`, `add`, `remove`, `ready`, `plan`, `apply`, `discard` | `spec:read`, `spec:propose`, `spec:apply` | Propose several artefact changes for review, then apply them together | | `ligament app init`, `validate`, `publish`, `install`, `uninstall`, `list` | `apps:write`, `apps:install` | Author an app manifest locally and publish or install it | | `ligament workflows`, `runs`, `cancel`, `replay` | `workflows:read`, `workflows:run` | List workflows and runs, show a run’s stages, cancel or replay a run | | `ligament approvals`, `approve`, `reject` | `approvals:decide` | List and decide approvals waiting on a person | | `ligament secrets`, `prompts`, `endpoints`, `skills`, `rag` | varies | Manage workspace secrets, prompt templates, endpoints, skills and RAG collections | | `ligament agent start`, `tunnel`, `serve-tools` | `ai:use` for `agent start` | Run agents on your own machine with a local model and tools | `ligament --help` lists the options for each. ### Records Filters are `field.op.value` and repeat. The list prints one record per line, then a count: ```sh ligament records list incident -f priority.eq.critical -f state.eq.in_progress --sort=-createdAt -n 2 ``` ```plaintext cmx1ws1sh004rrszicroqvw7t {"title":"Payments API returning 500s","impact":"high","number":"INC0000035","urgency":"high",…} cmx1vv4ef011vfeutovalscd8 {"tags":["hardware"],"title":"Laptop battery swelling (#33)","impact":"low","number":"INC0000034",…} 2 of 13 ``` Add `--json` for the raw API response. Filters and sorting work as described in [Lists, filters and pagination](https://docs.ligament.ai/developers/pagination/index.md). ### Spec and changesets ```sh ligament spec list ``` ```plaintext ADDRESS LAYER CUSTOMISED CONFLICTS HASH UPDATED crm/page/crm_home custom yes 04c3e5a99107abb3 2026-12-01T09:21:04.590Z csm/page/csm_home custom yes ba3ac2c15c5ef956 2026-12-01T09:21:04.599Z … ``` ```sh ligament spec get crm/page/crm_home ``` ```plaintext crm/page/crm_home layer custom v0 hash 04c3e5a99107abb3 customised { "app": "crm", "key": "crm_home", "title": "Sales home", "blocks": [ … ``` The summary line goes to stderr and the doc to stdout, so `ligament spec get … > page.json` saves just the doc. `ligament spec pull
` writes `..json` files plus `.ligament/spec.lock.json`, which remembers the version each file started from. `plan`, `apply` and `changeset create` send that version, so changes someone else made in the meantime are merged rather than overwritten. The workflow is described in [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md). ### Workflow runs ```sh ligament runs -n 3 ``` ```plaintext STATUS WORKFLOW DURATION STARTED RUN ID ────────────────────────────────────────────────────────────────────────────────────────── complete csm/incident_account 120ms 3m ago a59bb9b1-276c-42f7-82e9-898bd79b087c complete csm/incident_account 72ms 47m ago e3b8bf71-3d5e-4935-b12a-2b40f96c05a4 complete csm/incident_account 318ms 47m ago 5bb517a1-ad9a-4031-a61c-defd22b29cce ``` `ligament runs ` shows one run’s stages. ## Errors When the API refuses a call, the CLI prints the error and the API’s `fix` on the next line, then exits with code 1: ```plaintext Error (insufficient_scope): This API key lacks the "spec:read" scope. Use a key that has "spec:read" (or "*"). Create one in Settings → API keys; the scopes are listed at https://docs.ligament.ai/reference/scopes/. The key needs a spec scope: spec:read (read, plan), spec:propose (changesets) or spec:apply. ``` `approvals` with a `*` key fails the same way, because `approvals:decide` is an admin scope that `*` doesn’t include. Without a key at all: ```plaintext Error: LIGAMENT_API_KEY is not set Run `ligament login`, or export it in your shell. ``` ## Exit codes | Code | Meaning | | --- | --- | | `0` | OK | | `1` | Error: invalid doc, missing permission, network problem and so on | | `2` | Conflict (`spec` and `changeset` commands): nothing was applied, because of a real conflict or a clean merge you didn’t accept with `--merge` | | `3` | Proposed, not applied (`spec` and `changeset` commands): the workspace requires a person to apply this change, and it’s waiting in **Build › Changes** | Scripts can rely on `2` and `3` to tell “someone else changed this” and “waiting for review” apart from real failures. --- # App manifests > Write an app as a manifest: entities, fields, lifecycles, access, pipelines and pages. Validate, publish and install it with the CLI. Source: https://docs.ligament.ai/developers/app-spec/ An app manifest describes a whole app in one file: its record types and fields, their lifecycles and access rules, its automation and its pages. You keep the file in version control, validate it locally, publish it as a numbered version and install that version in a workspace. Use a manifest when an app should be reviewed like code, installed in several workspaces, or upgraded over time; for a one-off app in one workspace, [Build › Apps](https://docs.ligament.ai/get-started/first-app/index.md) is quicker. The example below is a small Office moves app for a facilities team. Every field the manifest accepts is listed in the [App manifest reference](https://docs.ligament.ai/reference/app-manifest/index.md). ## Set up Install the [CLI](https://docs.ligament.ai/developers/cli/index.md) and work in a folder for your app. The CLI reads two settings, from the environment or from a `.env` file in the current folder: | Variable | Value | | --- | --- | | `LIGAMENT_URL` | Your workspace’s address, for example `https://app.ligament.ai` | | `LIGAMENT_API_KEY` | An API key. Publishing needs the `apps:write` scope and installing needs `apps:install`. These are admin scopes: only a workspace admin can create a key with them. | `ligament app validate` works without a key. Scaffold a manifest: ```bash ligament app init ``` ```text ✓ Created app.ts and .env Next: set LIGAMENT_API_KEY (or ligament login), then ligament app publish. ``` `app.ts` holds a small example app to replace with your own. Fill in `.env`: set `LIGAMENT_API_KEY`, and set `LIGAMENT_URL` to your workspace’s address (the scaffold puts a local development address there). ## Write the manifest The manifest is a TypeScript (or JavaScript) module whose default export is the app, wrapped in `defineApp` from `@ligament/sdk` for type checking: *app.ts* ```ts import { defineApp } from '@ligament/sdk' export default defineApp({ key: 'office_moves', version: '1.0.0', releaseNotes: '1.0: first release: move requests, a three-step lifecycle and a moves overview page.', editPolicy: 'full', store: { name: 'Office moves', summary: 'Request, schedule and complete desk moves.', description: 'Facilities track every desk move from request to done: who moves, from which desk to which, on what date and how many crates.', category: 'Facilities', icon: 'truck', plans: [{ key: 'standard', name: 'Standard', isDefault: true }], }, nav: { label: 'Office moves', icon: 'truck', items: [ { label: 'Moves', to: '/r/office_move', icon: 'list' }, { label: 'New move', to: '/r/office_move/new', icon: 'plus' }, ], }, entities: [ { key: 'office_move', label: 'Office move', description: 'One person moving from one desk to another.', icon: 'truck', backingTable: 'records', fields: [ { key: 'name', label: 'Summary', type: 'string', storage: 'ext', required: true, order: 0 }, { key: 'employee', label: 'Employee', type: 'reference', storage: 'ext', order: 1, referenceEntityKey: 'person', referenceDisplayField: 'name' }, { key: 'from_desk', label: 'From desk', type: 'string', storage: 'ext', order: 2 }, { key: 'to_desk', label: 'To desk', type: 'string', storage: 'ext', required: true, order: 3 }, { key: 'move_date', label: 'Move date', type: 'date', storage: 'ext', order: 4 }, { key: 'crates', label: 'Crates', type: 'number', storage: 'ext', order: 5 }, { key: 'scheduled_on', label: 'Scheduled on', type: 'date', storage: 'ext', order: 6 }, ], states: [ { key: 'requested', label: 'Requested', color: 'yellow', isInitial: true, order: 0 }, { key: 'scheduled', label: 'Scheduled', color: 'blue', order: 1 }, { key: 'done', label: 'Done', color: 'green', isTerminal: true, order: 2 }, ], transitions: [ { from: 'requested', to: 'scheduled', label: 'Schedule', runWorkflow: 'stamp-scheduled' }, { from: 'scheduled', to: 'done', label: 'Complete' }, ], acls: [ { operation: 'read', role: 'member' }, { operation: 'create', role: 'member' }, { operation: 'update', role: 'member' }, { operation: 'transition', role: 'admin' }, ], }, ], pipelines: [ { key: 'stamp-scheduled', name: 'Stamp the scheduling date', trigger: { type: 'manual', entity: 'office_move' }, nodes: [ { id: 'stamp', kind: 'action', action: 'record.update', params: { entity: 'office_move', id: '{{trigger.record.id}}', values: { scheduled_on: '{{now}}' } } }, ], }, ], pages: [ { specVersion: 1, key: 'office_moves_home', title: 'Office moves', description: 'Moves waiting to be scheduled and the ones coming up.', blocks: [ { id: 'intro', type: 'heading', props: { text: 'Desk moves' } }, { id: 'waiting', type: 'metric', span: 4, props: { entity: 'office_move', metric: 'count', caption: 'Waiting to be scheduled', filters: [{ field: 'state', op: 'eq', value: 'requested' }] } }, { id: 'upcoming', type: 'list', span: 12, title: 'Upcoming moves', props: { entity: 'office_move', columns: ['name', 'employee', 'to_desk', 'move_date'], sort: [{ field: 'move_date', dir: 'asc' }], limit: 10 } }, ], }, ], }) ``` ### The app | Field | What it is | | --- | --- | | `key` | The app’s permanent key, in lower\_snake\_case. It namespaces everything the app installs. | | `version` | A semantic version (`1.0.0`). Each published version is immutable. | | `releaseNotes` | Shown in the App Store and in the upgrade summary. | | `editPolicy` | How much installers may change what the app ships: `full` (default), `additive` or `locked`. See [Upgrades and your customisations](https://docs.ligament.ai/guides/building-apps/upgrades/index.md#how-much-installers-may-change). | | `store` | The App Store listing: name, summary, description, category, icon and plans. | | `nav` | The app’s section in the navigation. | | `dependsOn` | Keys of apps that must be installed first. Installing from the App Store names them and installs them first. | ### Entities and fields Each entity is a record type. `backingTable: 'records'` stores its records in the workspace’s shared record store, so installing it needs no database change; give its fields `storage: 'ext'`. A field has a `key`, a `label`, a `type` (`string`, `number`, `money`, `decimal`, `boolean`, `date`, `url`, `email`, `image_url`, `enum` or `reference`; `currency` is the older float type that `money` replaces), its position (`order`) and optional settings such as `required`, `enumOptions` (`[{ value, color, label? }]`: `label` is what people see, else the value is humanized), for a reference `referenceEntityKey` and `referenceDisplayField`, or for money and decimal fields `currency`, `currencyField`, `scale` and `rounding` (see [Money in the API](https://docs.ligament.ai/developers/money/index.md#manifests)). A reference can point at an entity of another app or module, such as `person` from People. `seed` on an entity (or `seedRecords` on the app) creates starter records on install. ### Lifecycle `states` lists the states in order; one has `isInitial: true` and terminal states have `isTerminal: true`. Each transition names its `from` and `to` states and an action `label`, and can require a role (`requiresRole`) or run one of the app’s pipelines (`runWorkflow`). Mark a transition that ends or undoes something (Retire, Cancel, Revoke) `destructive: true`: the record page never makes it the accent button and asks before running it, with your `confirm` question if you give one. Every state a transition names must be declared. ### Access `acls` says which roles may `read`, `create`, `update`, `delete` or `transition` the entity’s records. A rule can also deny (`effect: 'deny'`), cover one field (`fieldKey`) or only rows matching `rowFilters`. Owners and admins always pass, so `{ operation: 'transition', role: 'admin' }` keeps transitions to admins and owners. On install, each role’s rules become a permission set in the workspace’s spec store, named `.`. For this app: ```json { "key": "office_moves.member", "origin": "app", "role": "member", "grants": [ { "entity": "office_move", "ops": ["read", "create", "update"] } ], "app": "office_moves" } ``` Admins can see and adjust them in **Settings › Access**; see [Roles and permission sets](https://docs.ligament.ai/guides/access/roles-and-permission-sets/index.md). For a full access model (your own roles and permission sets, restrictions such as “pay is masked except on your own record”, and the role that administers the app), ship it under the manifest’s `access` key instead. The install creates it, upgrades keep the workspace’s changes and never widen access without an admin’s approval, and uninstalling removes it. See [Access in the manifest](https://docs.ligament.ai/guides/building-apps/access-in-the-manifest/index.md). ### Pipelines `pipelines` are the app’s automation, declared as data: a trigger and a list of nodes. In the example, the Schedule transition runs `stamp-scheduled`, which writes the date into `scheduled_on`. Inside a pipeline, `{{trigger.record.id}}` is the record that triggered it and `{{now}}` the current time. The published manifest carries pipelines in its `workflows` field. A `wait` node can pause a pipeline until an event arrives: `{ id: 'answer', kind: 'wait', for: { event: 'ticket.answered', match: { recordId: '{{trigger.record.id}}' }, timeout: '3d' } }`. Its output is the event, or empty when the timeout passes first. By default it waits for the next matching event. If the step before it sends a request that someone can answer at once, add `lookback: true`, so an answer that arrives before the wait starts still counts. `lookback` needs a `match`, and it counts any matching event since the pipeline started (never the event that started it). Don’t use it on a wait that means “the next update”, or an earlier update would end the wait. ### Pages `pages` are page documents, the same format the [page builder](https://docs.ligament.ai/guides/building-apps/page-builder/index.md) edits and its JSON tab shows. They install as the app’s shipped pages, which workspaces can customise and keep across your upgrades. ## Validate ```bash ligament app validate ``` ```text ✔ App "office_moves" v1.0.0 is valid (1 entity, 1 pipeline(s), 0 grant(s)) ``` Validation checks the shape of every field and the consistency between them, and exits with code 1 on any problem: ```text ✖ Manifest invalid ✗ version: must be semver (e.g. 1.0.0) ``` ```text ✖ Manifest failed validation ✗ entity "office_move": transition.to "closed" is not a declared state ``` ## Publish ```bash ligament app publish ``` ```text ✔ Published office_moves v1.0.0 Install it with ligament app install office_moves ``` A published version can’t be changed or published again: ```text ✖ Publish failed (409) {"error":"Version 1.0.0 already published for \"office_moves\""} ``` To ship a change, raise `version` (`1.1.0`) and publish again, or pass `--version 1.1.0` to `app publish`. Write `releaseNotes` for each version: installers see them before they upgrade. **Release notes: every version bump adds a line.** Start `releaseNotes` with an entry for the new version, the version and a colon, and keep the older entries after it, newest first: `'1.1.1: fixes the moves overview total. 1.1: floor changes. 1.0: first release.'` For a `x.y.0` version, `x.y:` is enough (`1.1:` for `1.1.0`); a patch version needs the full number (`1.1.1:`). The apps in the Ligament repository are checked for this rule by a test (`release-notes-lint`), so a version bump without its line fails the build. Because a published version can’t change, fixing forgotten notes means a new patch version with its own line. ## Install and upgrade ```bash ligament app install office_moves ``` ```text ✔ Installed office_moves v1.0.0 ``` `ligament app install office_moves@1.0.0` installs a specific version. The app’s entities, fields, lifecycle, permission sets, pipelines and pages are created, and its section appears in the navigation. `ligament app list` shows your apps with the latest published version and the version installed in this workspace: ```text office_moves (latest v1.2.0) installed v1.2.0 ``` Workspaces that have the app installed upgrade from the App Store (**Updates available**) or with `POST /api/apps/upgrade`. Their changes to your pages are kept and merged with your new version; see [Upgrades and your customisations](https://docs.ligament.ai/guides/building-apps/upgrades/index.md). `ligament app uninstall office_moves` disables the app in a workspace. All the `app` commands are in the [CLI reference](https://docs.ligament.ai/reference/cli/index.md). --- # Hooks, callbacks and events > Receive calls from other systems with signed inbound hooks, and get a signed callback when a workflow run finishes. Source: https://docs.ligament.ai/developers/webhooks/ Two things connect your workspace to other systems over plain HTTP: - **Inbound hooks** give another system a URL to call. A script in your workspace handles each call, after Ligament has checked the caller’s signature or API key and filtered out duplicate deliveries. - **Run callbacks** let your code start a workflow and get a signed `POST` back when the run completes or fails. Ligament doesn’t send general-purpose outbound webhooks for record changes. To react to a change, use an automation that starts on the record event, and call out from it. ## Inbound hooks Any script can be exposed as an HTTP endpoint at: ```plaintext https://app.ligament.ai/api/hook/ ``` The token is long and random, and it’s the only thing in the URL that identifies your workspace. It accepts `GET`, `POST`, `PUT`, `PATCH` and `DELETE`. The script receives the request as `input` (`{ method, query, headers, body }`) and whatever it returns becomes the response: return `{ status, headers, body }` to control the status code, or any other value to answer `200` with that value as JSON. Bodies over 256 KB are refused with `413`. ### Expose a script 1. Open **Build › Extensions** and select the script (or create one with **New**). 2. Open the script settings (the icon at the top right of the editor) and turn on **Expose as HTTP endpoint**. 3. The **Endpoint** section shows the URL, with buttons to copy it and to issue a new token. A new token stops the old URL working. 4. Choose how callers authenticate under **Auth** (below). Scripts that ship in an app declare the same settings in the [app manifest](https://docs.ligament.ai/reference/app-manifest/index.md) (`exposed`, `endpointAuth`, `endpointHmac`, `endpointIdempotency` on a script). ### How callers authenticate | Auth | The caller sends | Use it for | | --- | --- | --- | | Public | Nothing but the URL. The script runs read-only | Low-risk lookups, where the token is enough | | API key | `Authorization: Bearer ` with `endpoints:invoke`, from a key in the same workspace. The script runs as the key’s creator, at most with member rights | Your own services | | Signed (HMAC) | A signature header computed with a shared secret | Webhooks from SaaS providers (payments, carriers, identity checks) | The app’s **Auth** menu offers Public and API key. Signed endpoints are set up through the app manifest or the API (`POST /api/scripts` with `endpointAuth: "hmac"` and `endpointHmac`), and then show as **Signed (HMAC)** in the script settings. ### Signed endpoints A signed endpoint verifies the raw request body against a workspace secret before your script runs. The secret lives in your workspace’s secrets (**Build › Secrets**), and the script never sees it. Two signature formats are supported: | `scheme` | Header value | Signed text | | --- | --- | --- | | `timestamped` | `t=,v1=` (several `v1=` allowed, so you can rotate secrets) | `.` | | `hex` | ``, optionally prefixed `sha256=` | the raw body | Both use HMAC-SHA256 with a hex digest. With `timestamped`, a timestamp further than `toleranceSeconds` from now (default 300, at most 3600) is refused, which stops replays of old deliveries. This is the configuration of a carrier status hook in an example workspace: ```json { "key": "carrier_status_webhook", "name": "Carrier status webhook", "exposed": true, "endpointAuth": "hmac", "endpointHmac": { "secret": "CARRIER_WEBHOOK_SECRET", "header": "X-Carrier-Signature", "scheme": "timestamped", "toleranceSeconds": 300 }, "endpointIdempotency": { "header": "Idempotency-Key" } } ``` and its script: ```js // Carrier status updates (signed by the carrier) var b = input.body || {}; return { status: 202, body: { accepted: true, shipment: b.shipment_id, status: b.status } }; ``` A delivery, signed the way the carrier would sign it: ```sh BODY='{"shipment_id":"SHP-20931","status":"delivered"}' T=$(date +%s) SIG=$(printf '%s.%s' "$T" "$BODY" | openssl dgst -sha256 -hmac "$CARRIER_WEBHOOK_SECRET" -hex | awk '{print $2}') curl -i -X POST "https://app.ligament.ai/api/hook/" \ -H "Content-Type: application/json" \ -H "X-Carrier-Signature: t=$T,v1=$SIG" \ -H "Idempotency-Key: evt_7f3a91" \ -d "$BODY" ``` ```plaintext HTTP/1.1 202 Accepted {"accepted":true,"shipment":"SHP-20931","status":"delivered"} ``` A missing, malformed, wrong or stale signature gets the same answer, so a caller can’t probe which part was wrong: ```plaintext HTTP/1.1 401 Unauthorized {"error":"invalid_signature"} ``` ### Duplicate deliveries Providers retry, and sometimes deliver the same event twice. Set `endpointIdempotency.header` to the header that carries the provider’s event id. The first successful (`2xx`) response for each id is stored; a repeat delivery with the same id gets the stored response back without running the script again, marked with a header: ```plaintext HTTP/1.1 202 Accepted Idempotent-Replayed: true {"status":"delivered","accepted":true,"shipment":"SHP-20931"} ``` If the first delivery is still running when the repeat arrives, the repeat gets `409 {"error":"in_progress"}` and the provider retries later. Add `serializeBy: { "bodyPath": "account.id" }` to run deliveries for the same body value one at a time; a value still busy after 10 seconds gets `409 {"error":"busy"}`. ### Other answers | Situation | Response | | --- | --- | | Unknown token, or the script is disabled or no longer exposed | `404 {"error":"endpoint not found"}` | | Body over 256 KB | `413 {"error":"payload_too_large"}` | | Idempotency key longer than allowed | `400 {"error":"invalid_idempotency_key"}` | | The script throws | `500 {"error":""}` | ## Run callbacks When you start a workflow run through the API, you can ask for a callback when it finishes: ```sh curl -s -X POST "https://app.ligament.ai/api/workflows/trigger" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "workflowId": "fulfill-request", "input": { "requestId": "REQ0001042" }, "webhook": { "onComplete": "https://orders.example.com/hooks/run-complete", "onFailed": "https://orders.example.com/hooks/run-failed" } }' ``` The key needs `workflows:run`. The call answers `202` with `{ "runId": "…", "status": "running" }`. Both URLs are optional. The callback URLs are checked when you start the run: they must be `http` or `https`, can’t contain a user name or password, and must resolve to a public address. A URL that fails the check is refused before the run starts: ```plaintext HTTP/1.1 422 Unprocessable Entity {"error":"blocked address: 10.0.0.5"} ``` An unknown `workflowId` is `404 {"error":"Workflow not found"}`, and starting runs is rate-limited per workspace (`429` with `Retry-After`). ### The callback When the run completes (or fails), Ligament sends a `POST` to the matching URL with a JSON body of this shape: ```json { "runId": "", "workflowId": "fulfill-request", "status": "complete", "output": { "…": "the run's output" }, "completedAt": "" } ``` A failed run has `"status": "failed"`, and an `error` with the reason. These headers come with it: | Header | Value | | --- | --- | | `X-Ligament-Signature` | `sha256=`: HMAC-SHA256 of the raw body with your workspace’s webhook signing secret | | `X-Ligament-RunId` | The run id | | `X-Ligament-Event` | `run.complete` or `run.failed` | Answer with any `2xx` status. If the delivery fails or times out (10 seconds), it’s retried twice, about 2 and 4 seconds later. Redirects aren’t followed. ### Verify the signature Compute the HMAC over the exact bytes you received, before parsing the JSON, and compare in constant time. In Node.js: ```js import { createHmac, timingSafeEqual } from 'node:crypto'; export function verifyRunCallback(rawBody, signatureHeader, secret) { const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex'); const a = Buffer.from(expected); const b = Buffer.from(signatureHeader ?? ''); return a.length === b.length && timingSafeEqual(a, b); } ``` ### The signing secret Each workspace has one webhook signing secret, starting `whsec_`. There’s no screen for it in the app; read and rotate it through the API: | Call | Needs | | --- | --- | | `GET /api/settings/webhook` returns `{"secret":"whsec_…"}` | `settings:write` (an admin scope), from a key created by an admin or owner | | `POST /api/settings/webhook` issues a new secret and returns it | `settings:write` (an admin scope) | Reading the secret needs the same scope as rotating it, because anyone who holds it can sign a callback your system will trust. A `*` or `settings:read` key gets `403 insufficient_scope`. Make a separate key with `settings:write` for the setup step that fetches the secret, and keep it out of everyday clients. Callbacks are signed with whichever secret is current when they’re sent, so a callback already queued when you rotate will fail verification on your side. Rotate when few runs are in flight. ## Events that start workflows Inside the workspace, an automation can start on a record being created, updated or moved to a state, or on a named event. Live chat emits `chat.started`, `chat.message_left` and `chat.closed`, and an embedded form capture emits `form.captured` (or the event name the form sends). These events stay inside your workspace: to tell another system about them, add a step to the automation that calls it. --- # Money in the API > The JSON format of money and decimal values, input rules and errors, totals per currency, exchange rates and conversion over the API, MCP and the CLI, and the CSV format. Source: https://docs.ligament.ai/developers/money/ This page covers the wire format. For what the field types do, see the guide [Money and currencies](https://docs.ligament.ai/guides/building-apps/money/index.md). ## Values | Field type | JSON value | Example | | --- | --- | --- | | `money` | An object with the amount as a **string** | `{ "amount": "1234.50", "currency": "USD" }` | | `decimal` | A string | `"0.125"` | | `number`, `currency` (older types) | A JSON number | `1234.5` | Amounts are strings because a JSON number is read as a floating-point number by most clients, and that can’t hold every decimal exactly. Parse them with a decimal library, such as `decimal.js` in JavaScript, `decimal.Decimal` in Python or `BigDecimal` in Java. Don’t use `parseFloat`. The amount always has the field’s places: `"12.50"`, not `"12.5"`. Its `currency` is the field’s fixed currency, or the record’s currency field. It’s `null` if the record has none yet. A masked amount is masked whole, so you get `"•••••"` instead of the object. A hidden field is absent. See [field levels](https://docs.ligament.ai/guides/access/index.md). ```json GET /api/records/opportunity?limit=1 { "rows": [ { "id": "cmx3…", "name": "Brightwater API rollout", "amount": { "amount": "12000.00", "currency": "USD" }, "probability": 10 } ] } ``` ## Writing amounts You can send a money value in three forms: - `{ "amount": "1234.50", "currency": "USD" }`; - a decimal string, `"1234.50"`, which takes the field’s or the record’s currency; - a JSON number, `1234.5`, only if it’s exactly what you meant (at most 15 significant digits). Values are **never rounded** on the way in. Every write below is refused with status 422 and nothing is saved: | You send | Error | | --- | --- | | `"amount": "12.345"` to a USD field | `Amount (ARR): USD amounts have at most 2 decimal places (got "12.345")` | | `"amount": { "amount": "12.50", "currency": "EUR" }` to a USD field | `Amount (ARR) is in USD; got EUR (convert it first)` | | `"amount": "1,250.00"` | `Amount (ARR): "1,250.00" is not a decimal number (digits with an optional "." and sign, e.g. "1234.50")` | | `"amount": 0.30000000000000004` | `Amount (ARR): 0.30000000000000004 has more digits than a JSON number holds exactly; send it as a string` | On a record with a currency field, an amount in another currency is refused, and an amount sent while the currency field is empty fills it in. Changing the record’s currency re-checks its stored amounts. For example, moving `12.50` from USD to JPY is refused unless you send a new amount too. ## Totals `GET /api/records/?summary=1` (or with `groupBy`) adds a `summary`. Money and decimal fields are under `totals`, computed exactly in SQL `numeric`. Money is never added across currencies. For example: ```json "summary": { "total": 82, "sums": { "probability": 4725 }, "totals": { "amount": { "kind": "money", "byCurrency": [{ "currency": "USD", "amount": "2284176.00" }] }, "salary": { "kind": "money", "byCurrency": [{ "currency": "EUR", "amount": "612000.00" }, { "currency": "THB", "amount": "2040000.00" }] }, "quantity": { "kind": "decimal", "amount": "1250.500" } }, "groups": null } ``` With `groupBy`, each group has its own `totals`. `sums` keeps the older `number` and `currency` fields as JSON numbers, as before. A field you can’t read in clear on every row has no total. With per-record field rules the check is on the rows being added up: a total (or a group’s) is present when every one of its rows is in clear for the caller, and absent when any is masked or hidden. Filters and sorts on such a field still match nothing. Reports and dashboard queries (`POST /api/reports/run`) work the same way. A money metric in one currency returns `amount` and `currency`. A metric spanning several currencies returns `byCurrency` and no single `value`. Grouped buckets carry their `currency`. `value` is only there to draw charts, so show `amount`. ## Exchange rates | Call | Who | What it does | | --- | --- | --- | | `GET /api/fx/rates?asOf=2026-11-15` | Anyone who can read records (`records:read`) | The rates in force on that date (default today) | | `POST /api/fx/rates` | Admins and owners (`settings:write`) | Set a rate from a date: `{ "base": "EUR", "quote": "USD", "rate": "1.0845", "from": "2026-11-01" }` | | `POST /api/fx/convert` | Anyone who can read rates (`records:read`) | Convert an amount (below) | | `POST /api/fx/sync` | Admins and owners (`settings:write`) | Pull the day’s rates from the enabled rate source | `asOf` takes a date `YYYY-MM-DD` in the workspace’s time zone, or `@today`, `@end_of_last_month`, `@end_of_last_quarter` or `@end_of_last_year`. A rate has at most 10 decimal places. ```json POST /api/fx/convert { "amount": { "amount": "1250.00", "currency": "EUR" }, "to": "USD", "asOf": "2026-11-15" } 200 { "amount": "1355.62", "currency": "USD", "from": { "amount": "1250.00", "currency": "EUR" }, "rate": "1.0845", "rateDate": "2026-11-01", "source": "manual" } ``` `rateDate` is the date the rate took effect. If only the opposite pair exists, the answer uses its inverse and adds `"inverse": true`, with a source such as `"manual (inverse)"`. The amount is rounded half-even to the target currency’s places. | Code | When | | --- | --- | | `fx_rate_missing` (422) | No rate for the pair on that date: `No exchange rate from EUR to USD on 2026-10-01` | | `fx_invalid` (422) | A malformed body | | Other 422 codes, such as `invalid_currency` or `invalid_decimal` | A bad currency code or amount; the message names the value | | `fx_source_missing` | A sync with no enabled rate source | | `fx_source_failed`, `fx_source_invalid` | The rate source didn’t answer, or answered with something unusable | **MCP:** `fx_convert` and `fx_rates`, with the same arguments and answers, need `records:read`. See [MCP](https://docs.ligament.ai/developers/mcp/index.md). **CLI:** see [CLI](https://docs.ligament.ai/developers/cli/index.md). ```sh ligament fx rates --as-of 2026-11-15 ligament fx convert 1250.00 EUR --to USD --as-of 2026-11-15 ligament fx set EUR USD 1.0845 --from 2026-11-01 ``` ## CSV export and import Exports write a money field as two columns: the plain decimal, then `_currency` right after it. Decimals are written exactly. A masked amount is masked in both columns. ```csv id,name,amount,amount_currency,probability,state,createdAt cmx3…,Brightwater API rollout,12000.00,USD,10,qualification,2026-11-30T16:59:22.676Z ``` Imports accept the same plain format. They also accept amounts as people type them in spreadsheets: `$1,234.50`, `1.234,50 €`, `USD 1,234.50` and `(12.00)` for a negative amount. The decimal separator is detected per column. A `_currency` column, or an ISO code in the cell, sets the currency. Every row is checked with the API’s rules before anything is written, and problems are reported per row: ```plaintext Row 14, Amount: USD amounts have at most 2 decimal places (got "12.345") ``` ## Manifests In an [app manifest](https://docs.ligament.ai/developers/app-spec/index.md), a money field declares a fixed `currency` or a `currencyField`, and optionally `scale` and `rounding`: ```ts { key: 'amount', label: 'Amount', type: 'money', storage: 'ext', order: 3, currency: 'USD' }, { key: 'salary', label: 'Salary', type: 'money', storage: 'ext', order: 15, currencyField: 'currency' }, { key: 'unit_price', label: 'Unit price', type: 'money', storage: 'ext', order: 4, currency: 'USD', scale: 4 }, { key: 'rate', label: 'Rate', type: 'decimal', storage: 'ext', order: 5, scale: 6, rounding: 'half_up' }, ``` `rounding` is `half_even` (the default) or `half_up`, and applies to computed values. A `calculated` field with `formulaOutputType: 'money'` or `'decimal'` takes the same settings, and its formula can use `convert(amount, "USD", date)`. Changing an existing field from `number` or `currency` to `money` in a new version converts the stored values on upgrade. The upgrade preview lists them, and the upgrade is refused (409) if any value wouldn’t convert exactly. --- # Webhooks or notifications? > When to use notifications (messages to people) and when to use hooks, callbacks and automations (calls between systems). Source: https://docs.ligament.ai/developers/webhooks-vs-notifications/ Ligament has two ways to tell the outside world that something happened. They look alike (both can end up in Slack), but they’re built for different readers. | | Notifications | Hooks, callbacks and automations | | --- | --- | --- | | For | People | Other systems | | Who decides where it goes | Each person, in their preferences, within the defaults an admin sets | You, in code or in an automation | | Channels | In-app, email, browser push, Slack, Teams, SMS, WhatsApp, connected apps | Any HTTP endpoint | | Content | Written for each person: only what they may see, short by default, with a link | Whatever your automation or script sends | | Buttons | Approve and Reject, checked as the person who pressed | None: the receiving system decides what to do | | Delivery | Retried with backoff, held during quiet hours, rate limited, logged per message | A workflow step: retried by the workflow engine, logged in the run | | Set up in | **Settings › Notifications** | Workflows, scripts and [hooks](https://docs.ligament.ai/developers/webhooks/index.md) | ## Use notifications when - a person has to do something: approve a request, pick up an assignment, answer a comment; - the message must respect what the reader may see. A notification about an employee never shows a field the reader can’t open in the app; - people should choose for themselves how they hear about it, and when not to be disturbed. A **team channel** (an admin rule that posts every SLA breach to a Slack channel, say) is still a notification: it’s for the people in that channel, so it says only which record and links to it. ## Use hooks, callbacks and automations when - another system needs the data: a ticket in another tool, a row in a warehouse, a message to a partner’s API; - you need the full record, in a format you choose; - the receiver isn’t a person and won’t press a button. Ligament doesn’t send general-purpose outbound webhooks for record changes. To push a change to another system, use an automation that starts on the record event, and call out from it. To learn when a workflow run you started finishes, use a [run callback](https://docs.ligament.ai/developers/webhooks/index.md). To receive calls, expose a script as an [inbound hook](https://docs.ligament.ai/developers/webhooks/index.md). An automation that calls another system sends exactly what you put in it, with no per-reader filtering. Don’t put field values in it, or post them into a channel people read, unless everyone who gets them may see them. A workflow’s `notify` step (`ctx.notify`) is different: it’s a notification, so preferences, quiet hours, per-reader redaction and the delivery log apply. See [Notify from a workflow](https://docs.ligament.ai/developers/notifications/index.md#notify-from-a-workflow). ## Related - [Your notifications](https://docs.ligament.ai/guides/notifications/index.md) - [Workspace notification settings](https://docs.ligament.ai/guides/notifications/admin/index.md) - [Notifications API](https://docs.ligament.ai/developers/notifications/index.md) - [Hooks, callbacks and events](https://docs.ligament.ai/developers/webhooks/index.md) --- # Notifications API > Send notifications, read and set preferences, manage workspace notification settings, and read the delivery log over the REST API. Source: https://docs.ligament.ai/developers/notifications/ The notification endpoints let your code read and change what people get, and let admins check what was sent. Every endpoint is in the [REST API reference](https://docs.ligament.ai/reference/rest-api/index.md) with its request and response shapes; this page explains how they fit together. Calls use an API key (`Authorization: Bearer `) or a signed-in session. Some endpoints act on “your own” settings and so need a signed-in user, not a key. ## Who can call what | Endpoint | Credential | Who | | --- | --- | --- | | `GET /api/notifications`, `POST /api/notifications` (mark read) | Session | Anyone, for their own notifications | | `GET`/`PUT /api/notifications/prefs` | Session | Anyone, for their own preferences | | `/api/notifications/push-subscriptions…`, `GET /api/notifications/push/key` | Session | Anyone, for their own browsers | | `GET`/`PUT /api/notifications/settings` | `settings:read` / `settings:write` | Owners and admins | | `/api/notifications/connections…`, `/api/notifications/identities…` | `settings:read` / `settings:write` | Owners and admins | | `GET /api/notifications/deliveries…`, `POST …/retry`, `GET /api/notifications/action-log` | `settings:read` / `settings:write` | Owners and admins | | `POST /api/notifications/preview` | `settings:read` | Owners and admins | | `GET`/`PUT /api/notifications/rules` | `settings:read` / `settings:write` | Owners and admins (team channels) | A key acts with its creator’s role, so a key made by a member gets `403` from the admin endpoints even with the right scope. The `/api/notify/…` endpoints (`actions`, `slack/interactions`, `teams/messages`, `push/receipt`, `twilio/status/{id}`) are called by Slack, Microsoft Teams, browsers and Twilio. Each checks a signature from the caller and isn’t meant for your code. ## Preferences `GET /api/notifications/prefs` returns the caller’s preferences together with what the page needs to show them: the channels available, the admin defaults that apply, the events that are urgent, the workspace time zone, linked Slack/Teams accounts and push devices. `PUT /api/notifications/prefs` replaces them: ```json { "prefs": { "events": { "approval": { "inapp": "instant", "email": "instant", "plugin:slack": "instant" }, "comment": { "email": "digest" } }, "addresses": { "sms": "+66812345678" }, "digest": { "cadence": "daily", "hour": 8 }, "timezone": "Asia/Bangkok", "quiet": { "enabled": true, "start": "22:00", "end": "07:00" } } } ``` Modes are `instant`, `digest` and `off`. A mode above an admin cap is stored but never applied: the effective mode is the lower of the two. ## Workspace settings `GET`/`PUT /api/notifications/settings` reads or replaces the admin settings: ```json { "settings": { "defaults": { "approval": { "email": { "mode": "instant", "userMay": "narrow" } } }, "events": { "sla_breach": { "urgent": true }, "approval": { "bodyMode": "minimal", "escalation": { "afterHours": 8, "to": "manager" } } }, "rateLimits": { "sms": 20 }, "templates": { "approval": { "*": { "title": "Approval: {{record.label}}", "body": "Please review." } } } } } ``` - `defaults[event][channel].userMay`: `narrow` (people may only lower it) or `any`. - `events[event].bodyMode`: `minimal` (the default, except `workflow_message`: `full`), `full` or `template`. Whatever the mode, values the recipient can’t read are removed. See [Workspace notification settings](https://docs.ligament.ai/guides/notifications/admin/index.md#fields-people-cant-see-never-leave). - `events[event].escalation`: `afterHours` and `to` (`manager`, or `channel` with a `channelId`). - `rateLimits[channel]`: messages per minute for the workspace. `0` means no limit. - `templates[event][channel]`: `*` applies to every channel outside the app. `POST /api/notifications/preview` renders a message the way a channel sends it, **as the caller**, with the caller’s field access: `{ "eventType": "approval", "channelId": "plugin:slack", "mode": "template", "entityKey": "hr_leave_request", "recordId": "…" }`. It returns the message, its plain text, the email HTML and the channel’s own format (Slack blocks, a Teams card, a push payload). There is no way to preview as someone else. ## Delivery log `GET /api/notifications/deliveries` lists deliveries, newest first. One row is one message to one address on one channel. Filter with `status` (a comma list of `pending`, `held`, `sending`, `sent`, `delivered`, `failed`, `dead`), `channel`, `event`, `recipient` (a user id) and `eventId`. Page with `limit` (up to 200) and `before` (the `next` value of the previous page). The response also has `counts` per status for the whole workspace. `GET /api/notifications/deliveries/{id}` returns one delivery with the message, its history (`queued`, `held`, `rate_limited`, `sent`, `delivered`, `failed`, `retry`, `dead`, `manual_retry`, `clicked`, `action`, `suppressed`) and any button presses on it. The list masks email addresses and phone numbers (`l•••@example.com`, `+668•••02`); the single delivery shows them in full. Each copy was written for its recipient. When you read someone else’s copy, its title and text are masked again for **you**: values you can’t read on the record are replaced with `•••••`, and if you can’t open the record you get only the event’s kind. `POST /api/notifications/deliveries/{id}/retry` queues a `failed` or `dead` delivery again (`409` for any other status). `GET /api/notifications/action-log` lists button presses from messages (Approve, Reject): who pressed (the member, or the Slack or Teams user when unlinked), on which channel, and the outcome (`done`, `already`, `refused`, `expired`, `unmapped`, `invalid`, `error`). ## Sending a notification `POST /api/notifications` doesn’t send messages; it marks the caller’s in-app notifications read. Notifications are sent by Ligament itself: approvals, assignments, comments, SLA timers, escalations, team channel rules and your workflows’ notify steps. They go through preferences, quiet hours, redaction and the delivery log. ## Notify from a workflow A workflow sends a message with its `notify` step: the `notify` action in a workflow definition, or `ctx.notify` in a code workflow. The message is a notification like any other, of the kind **Workflow message**: - **Who.** `to` takes one or more email addresses or member user ids, separated by commas. A member is reached on their own channels, as their preferences and your workspace defaults say. Workflow messages go to the bell and by email until someone changes that. An address that isn’t a member’s gets an email. - **When.** Quiet hours hold every channel except in-app until the window ends, unless an admin marked **Workflow message** as urgent. - **What.** Each copy is written for its reader. The message is about a record: the record that started the workflow, or the one the step names (`entity` and `recordId`, or `entityKey` and `recordId` in `ctx.notify`). In the app, the reader gets your subject and text, with every value of that record they can’t read replaced by `•••••`. Outside the app (email, Slack, Teams, push, SMS), they get your text too, with the same values removed, unless an admin set **Workflow message** to **Minimal** (the event and the record’s name with a link) or **Template**. Someone who can’t open the record gets only “New workflow message” and the link. - **Where it shows.** Every copy is in the [delivery log](#delivery-log), and failed sends are retried. - **Once.** A step sends its message once per run, however often the step is retried or replayed. ```ts await ctx.notify({ id: 'tell-manager', to: managerEmail, subject: `Salary change: ${employee.name}`, message: `${employee.name} now earns ${employee.salary.amount} ${employee.salary.currency}.`, // optional: entityKey + recordId (default: the run's trigger record), channel ('email' or 'inapp'), integration }) ``` ```json { "id": "tell", "kind": "action", "action": "notify", "params": { "to": "{{trigger.record.owner}}", "channel": "inapp", "subject": "Quiet sign-up: {{trigger.record.name}}", "body": "No API call in 3 days." } } ``` `channel` limits the message to `email` or `inapp`. Without it, each person’s own routing decides. The step’s output says what happened: `{ notified, queued, held, digest }`, plus `duplicate: true` when an earlier attempt of the same step already sent it and `unresolved` for addressees that are neither an email address nor a member. Only values of the record the message is about are checked. If your text quotes another record (a lookup step’s output, say), name that record in the step or leave those values out. To send a full email to someone outside the workspace, such as a customer, use the `email.send` action with an email template. To call another system rather than a person, see [Webhooks or notifications?](https://docs.ligament.ai/developers/webhooks-vs-notifications/index.md). ## Related - [Your notifications](https://docs.ligament.ai/guides/notifications/index.md) - [Workspace notification settings](https://docs.ligament.ai/guides/notifications/admin/index.md) - [Connect Slack and Microsoft Teams](https://docs.ligament.ai/guides/notifications/slack-teams-setup/index.md) - [API scopes](https://docs.ligament.ai/reference/scopes/index.md) --- # E-signatures for developers > Send envelopes from the REST API, workflows, MCP and the CLI, wait for them to finish, download sealed PDFs and check them. Source: https://docs.ligament.ai/developers/e-signatures/ The e-signature endpoints let your code and workflows send documents for signature and collect the sealed result. How signing looks to people, the sealed PDF and the verification page are in the [E-signatures guide](https://docs.ligament.ai/guides/e-signatures/index.md). Every endpoint is in the [REST API reference](https://docs.ligament.ai/reference/rest-api/index.md). **Nothing you call signs.** Keys, agents and workflows can create, send, remind, void and read envelopes. Signing and declining are done by each recipient in person: a member in the app, anyone else with the emailed link and a one-time code. The signing endpoints refuse requests that carry an API key (`403 keys_cannot_sign`). ## Scopes and who sees what | Scope | Allows | | --- | --- | | `esign:read` | Envelopes the key’s creator may see (status, recipients, audit trail) and their sealed PDFs; templates; the seal status (e-signature admins). | | `esign:write` | Create, send, remind and void envelopes; create and change templates (e-signature admins). | A key acts as its creator. The creator must be able to read the record an envelope is about. They then see the envelopes they sent and the ones sent to them; e-signature admins (owners, admins and roles with `esign.admin`) see all of them. Legal holds are set by e-signature admins only, with the `settings:write` scope. ## Send an envelope An envelope is about a **record** (`subject`) and its documents are PDFs **attached to that record**, or a template: ```sh curl -X POST https://app.ligament.ai/api/esign/envelopes \ -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \ -H 'Idempotency-Key: offer-0042' \ -d '{ "subject": { "entity": "candidate", "id": "cmx1a2b3c" }, "title": "Offer letter: Jordan Example", "documents": [{ "attachmentId": "att_9f8e7d" }], "signingOrder": "sequential", "recipients": [ { "email": "jordan@example.com", "name": "Jordan Example", "order": 1 }, { "userId": "user_hr_lead", "order": 2 }, { "email": "payroll@example.com", "role": "cc", "order": 3 } ], "fields": [ { "recipient": 0, "kind": "signature", "page": 1, "x": 120, "y": 112, "w": 160, "h": 30 }, { "recipient": 0, "kind": "date_signed", "page": 1, "x": 330, "y": 112, "w": 90, "h": 20 }, { "recipient": 0, "kind": "text", "page": 1, "x": 56, "y": 230, "w": 200, "h": 16, "label": "Start date" }, { "recipient": 1, "kind": "initials", "page": 1, "x": 480, "y": 112, "w": 50, "h": 24 } ], "expiresInDays": 14, "reminderEveryDays": 3 }' ``` It is sent straight away unless you pass `"send": false` (then `POST /api/esign/envelopes//send`). The same `Idempotency-Key` returns the same envelope. | Field | Notes | | --- | --- | | `recipients[].auth` | `link_email_otp` (the default for people outside the workspace), `link_sms_otp` (needs `phone` and the Twilio channel), `link` (they confirm their email instead of a code), `session` (members, the default when you pass `userId`). | | `recipients[].role` | `signer` (default) or `cc` (gets the sealed copy). | | `fields[]` | `kind` is `signature`, `initials`, `date_signed`, `name`, `email`, `text` or `checkbox`. Positions are PDF points from the bottom-left corner of the page. `recipient` is the recipient’s index or email. | | `template` | A template key instead of `documents` and `fields`. Each recipient then names its `templateRole`; template fields with `prefill: "{{record.}}"` take the record’s value. | | `expiresInDays` | 1 to 30 (default 14). | Documents are checked before anything is sent: only PDFs up to 20 MB and 500 pages, not encrypted and not already signed. Scripts, embedded files and forms are removed from the sealed copy and listed in the audit trail. ## Follow it and get the result ```sh curl https://app.ligament.ai/api/esign/envelopes/ -H "Authorization: Bearer $KEY" # status, recipients, seal curl https://app.ligament.ai/api/esign/envelopes//audit -H "Authorization: Bearer $KEY" # the audit trail and its check curl -o signed.pdf https://app.ligament.ai/api/esign/envelopes//sealed -H "Authorization: Bearer $KEY" ``` Statuses: `draft`, `sent`, `completing` (everyone signed, sealing), `completed`, `declined`, `voided`, `expired`. The audit response includes `check` (the hash chain against the envelope’s latest entry) and `anchorCheck` (against the copy sealed into the PDF). `POST /api/esign/envelopes//remind` sends the signers whose turn it is a fresh link; `POST /api/esign/envelopes//void` with `{ "reason": "…" }` withdraws it. ## In a workflow `esign.send` creates and sends the envelope once per step (a retry or replay returns the same one), and its output has the `envelopeId`. Wait for the `esign.finished` event with `lookback: true`: a quick signer can finish before the wait starts, and lookback makes the wait see that event. The workflow linter refuses an `esign.finished` wait without it. ```json { "key": "offer-signing", "name": "Offer signing", "trigger": { "type": "manual" }, "nodes": [ { "id": "offer", "kind": "action", "action": "esign.send", "params": { "subject": { "entity": "candidate", "id": "{{trigger.input.candidateId}}" }, "template": "offer_letter", "recipients": [{ "email": "{{trigger.input.email}}", "name": "{{trigger.input.name}}", "templateRole": "candidate" }] } }, { "id": "signed", "kind": "wait", "for": { "event": "esign.finished", "match": { "envelopeId": "{{steps.offer.output.envelopeId}}" }, "lookback": true, "timeout": "15d" } }, { "id": "outcome", "kind": "switch", "on": "{{steps.signed.output.status}}", "cases": [ { "equals": "completed", "do": [{ "id": "accepted", "kind": "action", "action": "set", "params": { "name": "result", "value": "signed" } }] } ], "default": [{ "id": "not_signed", "kind": "action", "action": "set", "params": { "name": "result", "value": "{{steps.signed.output.status}}" } }] } ] } ``` `esign.finished` carries `{ envelopeId, subjectEntity, subjectId, status }` with `status` = `completed`, `declined`, `voided` or `expired`. `esign.remind` and `esign.void` take an `envelopeId`. There is no workflow action that signs. ## MCP and CLI The MCP server has `esign_create_envelope`, `esign_send`, `esign_void`, `esign_remind`, `esign_status` and `esign_sealed_pdf` ([MCP tools](https://docs.ligament.ai/reference/mcp-tools/index.md)). The CLI has `ligament esign create | send | void | remind | status | list | download` ([CLI reference](https://docs.ligament.ai/reference/cli/index.md)): ```sh ligament esign create --entity candidate --record cmx1a2b3c --file att_9f8e7d \ --signer jordan@example.com:"Jordan Example" --signer hr.lead@example.com --sequential ligament esign status ligament esign download -o offer-signed.pdf ``` ## Check a sealed PDF in code `GET /api/esign/verify?id=` answers the short facts (no names or fingerprints). `POST /api/esign/verify` with `{ "sha256": "" }` answers the full certificate when a sealed PDF has that fingerprint, and `{ "found": false, "match": false }` when none does. Both are public and rate-limited. The audit trail inside the PDF (`audit-trail.json`, format `ligament.esign.audit/v1`) can be checked without calling Ligament: each event’s `rowHash` is the sha256 of the previous event’s `rowHash`, a newline and the event’s canonical JSON, and the last sealed event’s hash is the `anchor` printed on the certificate page. --- # Onboarding for developers > The platform pieces Onboarding added for any app: guest sessions, the identity verification connection and its result facts, DSL actions for retention and messages, and calling an app’s own pipelines. Source: https://docs.ligament.ai/developers/onboarding/ Onboarding is a first-party app built as manifest data (`apps/onboarding`). Where the platform lacked something, the missing piece was added to the platform so other apps can use it. This page describes those pieces. How Onboarding looks to people is in the [Onboarding guide](https://docs.ligament.ai/guides/onboarding/index.md). ## Guest sessions A [signed link](https://docs.ligament.ai/guides/compliance/evidence-methods/index.md) works once: right for “sign this”, wrong for a portal someone returns to over two weeks. A **guest session** is what a used signed link turns into: a cookie-bound session for one record (the link’s subject), for the email address the link was sent to, with an expiry and revocation. - It is created only by a server route that has just consumed a signed link (compare-and-set, so a link starts at most one session). The cookie is `HttpOnly`, `Secure`, `SameSite=Lax` and scoped to the portal’s paths; only the token’s SHA-256 is stored. - It expires after 30 days by default (at most 60), never later than the `notAfter` the caller gives (Onboarding: a week after the start date), and can be revoked for the whole subject. - It is **not** a member session: `requireAuth`, the records API, API keys, MCP and the CLI ignore it. Code that serves a guest reads and writes the subject record (and what hangs off it) as the system, after checking the session’s subject; record rules still run. The functions are in `lib/guest-sessions.ts`: `startGuestSession`, `resolveGuestSession`, `endGuestSession`, `revokeGuestSessions` and `guestSessionsOf`. ## Identity verification connections Identity checks run through the **Verify** app’s case (`verification`) and a provider chosen as a workspace connection of type `identity_verification` (**Settings › Connections**). The connection holds the provider’s API base URL, API key, optional webhook secret, and chip and device policy. Results come from the provider’s signed webhook (`/api/webhooks/attest`, `Attest-Signature` over `t.`, five-minute window) or from a reconcile sweep that asks the provider for cases still open. To get a check’s facts onto your own record, start the verification with `subjectEntity` and `subjectId`. When the decision arrives, the platform writes the facts, as the system, into the `idv_*` fields your entity declares and no others: | Field | Fact | | --- | --- | | `idv_decision` | `approved`, `rejected`, `resubmission` or `pending` | | `idv_verified_name`, `idv_birth_date`, `idv_nationality` | From the document (chip where read) | | `idv_document_type`, `idv_document_country`, `idv_document_expiry` | The document | | `idv_assurance`, `idv_method` | How strong the check was and how it was done | | `idv_reference`, `idv_completed_at`, `idv_environment` | The provider’s session reference, when, `live` or `test` | | `idv_reasons` | Why it was not approved | | `idv_case` | The Verify case | The case itself keeps only the decision. Pair the fields with a restriction (`hidden` unless a capability) and `auditReads: true` on the entity, as Onboarding’s `onb_rtw_check` does. E-signature’s identity check for signers uses the same connection. ## DSL additions | Action or option | What it does | | --- | --- | | `attachment.delete` `{ entity, id, reason, nameContains? }` | Deletes a record’s attachments (all, or those whose file name contains `nameContains`) and writes an `attachment.delete` access-audit row with the reason. For retention rules: Onboarding deletes right-to-work copies N years after the leaving date | | `notify` with `about: 'none'` | Sends the message about no record. By default a `notify` step is about the trigger record, and a recipient who can’t read that record (a plain email address) gets the generic “open it in the app”. Use `about: 'none'` when the text itself is the message and says nothing the recipient may not see | | `workflow.call` from an app pipeline | Resolves the app’s own pipelines first (with the workspace’s overrides), then the workspace’s automations. An app can keep a “library” pipeline with a `manual` trigger and call it from its event pipelines | | `onboarding.invite` `{ journeyId, revoke? }` | Onboarding’s own: emails the portal invite for a journey, or closes the portal | | Date tokens `@start_of_month`, `@end_of_month` | In view and page filters, next to `@today` and `@today+30d` | ## Two things to know when writing an app like this - **Classified fields are masked unless a permission set lists them.** A field with `classification: 'sensitive'` (or `pii`) is `masked` for a set that grants the entity without naming the field. Give the people who need the value an explicit level (`read` or `write`) in their set’s `fields`; use a restriction for “everyone else, admins included”. - **Every event-triggered pipeline run counts**, even one whose `where` or `fields` filter then skips it: the filter runs inside the run, and runs count against the plan’s rate limit (the Free plan allows 10 a minute). Prefer one pipeline per entity event with `if` branches over several pipelines on the same event. --- # Build with AI > Let AI coding agents read these docs, connect to your workspace and propose changes. Source: https://docs.ligament.ai/build-with-ai/ AI coding agents such as Claude Code and Cursor can build on Ligament the way a developer does: read the docs, look at your workspace’s records and app definitions, and propose changes. A person reviews every proposed change before it takes effect. This section shows how to set that up. ## Docs your agent can read Every page of these docs is available in a form that’s easy for a model to read: | What | Where | | --- | --- | | An index of every page, with a one-line summary each ([llms.txt](https://llmstxt.org) format) | [/llms.txt](https://docs.ligament.ai/llms.txt) | | Every page in one Markdown file | [/llms-full.txt](https://docs.ligament.ai/llms-full.txt) | | One page as Markdown | The page’s URL followed by `index.md`, for example [/developers/mcp/index.md](https://docs.ligament.ai/developers/mcp/index.md) | | The REST API as OpenAPI | [/openapi.json](https://docs.ligament.ai/openapi.json) | | Instructions to put in your repository | [/templates/AGENTS.md](https://docs.ligament.ai/templates/AGENTS.md) | Each page also has **Copy as Markdown** and **View as Markdown** buttons next to its title, for pasting a page into a chat. Point an agent at `https://docs.ligament.ai/llms.txt` and it can find the rest itself. ## Your workspace, through MCP The [MCP server](https://docs.ligament.ai/developers/mcp/index.md) at `https://app.ligament.ai/api/mcp` gives an agent tools to query records, explain access, read your app spec and create changesets. What it can do depends on the API key you give it. [Connect an agent with MCP](https://docs.ligament.ai/build-with-ai/mcp-setup/index.md) has the setup for Claude Code, Claude Desktop, Cursor and other clients. ## Agents propose, people apply The safe setup is an agent that can read and propose but not apply: 1. Create a key with `spec:read`, `spec:propose` and `records:read`, named after the agent (for example “Claude Code (proposals only)”). 2. The agent reads the current artefacts, edits them, checks its edit with a plan, and creates a **changeset** with a title and a note explaining why. 3. A person opens the changeset in **Build › Changes**, reviews the plan and the diff, and applies or discards it. The changeset records who proposed it and through which key, for example “Ada Admin via API key Claude Code (proposals only) (…4n9P)”, so you always know which changes came from an agent. Two more safeguards apply even to keys that can apply changes. A key never does more than the person who created it can do right now, and when the workspace requires a person to apply changes made with a key (access rules, by default), an apply from a key becomes a proposal that waits for review. See [API keys and scopes](https://docs.ligament.ai/developers/api-keys/index.md) and [Let agents propose changes](https://docs.ligament.ai/guides/building-apps/agents-propose/index.md). ## Next - [Connect an agent with MCP](https://docs.ligament.ai/build-with-ai/mcp-setup/index.md) - [A prompt for your agent](https://docs.ligament.ai/build-with-ai/agent-prompt/index.md) that keeps it inside this flow - [AGENTS.md template](https://docs.ligament.ai/build-with-ai/agents-md/index.md) for repositories where agents work on your apps --- # Connect an agent with MCP > Set up Claude Code, Claude Desktop, Cursor and other MCP clients against your workspace. Source: https://docs.ligament.ai/build-with-ai/mcp-setup/ Connect an AI client to your workspace’s [MCP server](https://docs.ligament.ai/developers/mcp/index.md) and the agent can query records, read your app spec and propose changesets from inside the chat or editor. You need an API key and a few lines of client configuration. All clients need the same two things: | Setting | Value | | --- | --- | | URL | `https://app.ligament.ai/api/mcp` | | Header | `Authorization: Bearer ` | The server uses the streamable HTTP transport and authenticates with the header only. ## 1\. Create a key for the agent In **Settings › API keys**, create a key named after the agent and the machine, for example “Claude Code on Priya’s laptop”. Choose the scopes for what the agent should do: | The agent should | Scopes | | --- | --- | | Answer questions about records | `records:read` | | Also explain access (“why can’t Tomás see this case?”) | `records:read` (the access tools come with it) | | Read your apps and propose changes for review | `spec:read`, `spec:propose`, `records:read` | | Apply changes itself | add `spec:apply`. Only for agents you’d trust with the creator’s build permissions | | Call your workspace’s exposed connectors and scripts | `endpoints:invoke` | Avoid **Full access** (`*`) for agents: it includes `spec:apply` and every write scope. Keep the key in an environment variable rather than in a config file you might commit: ```sh export LIGAMENT_API_KEY= ``` ## 2\. Check the key works Before configuring a client, check that the server answers with your key: ```sh curl -s "https://app.ligament.ai/api/mcp" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}' ``` ```json {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-03-26","capabilities":{"tools":{},"resources":{}},"serverInfo":{"name":"ligament","version":"1.0.0"}}} ``` Then list the tools the key can use: ```sh curl -s "https://app.ligament.ai/api/mcp" \ -H "Authorization: Bearer $LIGAMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' ``` A key with `spec:read`, `spec:propose` and `records:read` lists 21 tools: `spec_catalog`, `spec_list`, `spec_get`, `spec_schema`, `spec_validate`, `spec_plan`, `spec_history`, `changeset_list`, `changeset_get`, `changeset_create`, `changeset_put_items`, `changeset_plan`, `changeset_discard`, `access_whoami`, `access_explain`, `access_effective`, `access_plan`, `records_query`, `records_get`, `records_history` and `records_changes`. A `401` means the key is wrong or revoked; a `403` means it has none of the scopes the server needs. ## 3\. Add the server to your client ### Claude Code ```sh claude mcp add --transport http ligament https://app.ligament.ai/api/mcp \ --header "Authorization: Bearer $LIGAMENT_API_KEY" ``` This stores the key’s value in your Claude Code settings. To share the setup with your team without sharing a key, add the server to the project’s `.mcp.json` instead and let each person’s environment supply the key: ```json { "mcpServers": { "ligament": { "type": "http", "url": "https://app.ligament.ai/api/mcp", "headers": { "Authorization": "Bearer ${LIGAMENT_API_KEY}" } } } } ``` In Claude Code, `/mcp` shows whether the server is connected and how many tools it has. ### Claude Desktop Claude Desktop starts local MCP servers from `claude_desktop_config.json`. To reach a remote server that authenticates with a header, run it through the `mcp-remote` bridge (needs Node.js): ```json { "mcpServers": { "ligament": { "command": "npx", "args": ["-y", "mcp-remote", "https://app.ligament.ai/api/mcp", "--header", "Authorization:${AUTH_HEADER}"], "env": { "AUTH_HEADER": "Bearer " } } } } ``` The header goes through an environment variable because the value contains a space. Restart Claude Desktop after editing the file. ### Cursor Add the server to `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for every project): ```json { "mcpServers": { "ligament": { "url": "https://app.ligament.ai/api/mcp", "headers": { "Authorization": "Bearer ${env:LIGAMENT_API_KEY}" } } } } ``` The server then appears under Cursor’s MCP settings with its tools. ### Other clients Any client that supports MCP over streamable HTTP with custom headers works: give it the URL and the `Authorization` header from the table at the top of this page. For clients that only run local (stdio) servers, use the `mcp-remote` bridge as in the Claude Desktop example. ## 4\. Try it Ask the agent something that needs the tools, for example: > Which critical incidents are still in progress? Use the ligament tools. The agent should call `records_query` with a `priority` filter. Then give it the [starting prompt](https://docs.ligament.ai/build-with-ai/agent-prompt/index.md) before asking for changes, and put the [AGENTS.md template](https://docs.ligament.ai/build-with-ai/agents-md/index.md) in any repository where agents work on your apps. To disconnect an agent, revoke its key in **Settings › API keys**. Its next call gets `401`. --- # A prompt for your agent > A starting prompt that keeps an agent inside the review flow. Source: https://docs.ligament.ai/build-with-ai/agent-prompt/ Paste this prompt at the start of a session (or into your client’s project instructions) before you ask an agent to change anything in your workspace. It tells the agent how Ligament works, keeps it to reading and proposing, and makes it hand the change to a person instead of applying it. It assumes the agent is [connected over MCP](https://docs.ligament.ai/build-with-ai/mcp-setup/index.md) with a key that has `spec:read`, `spec:propose` and `records:read`. Edit the parts in angle brackets. ```md You are working on our Ligament workspace through the "ligament" MCP server. Ligament docs for agents: https://docs.ligament.ai/llms.txt. Read the pages you need before you act. Your job: . Rules: 1. You propose changes; a person applies them. Never call spec_apply or changeset_apply. 2. Before changing an artefact, read it with spec_get and keep its hash. Use spec_catalog and spec_schema to see which types, entities, fields and blocks exist. Don't invent field or block names. 3. Check every edit with spec_validate, then spec_plan. If the plan shows a change you didn't intend, fix the doc and plan again. 4. Propose with changeset_create: a short title, a note that says why, one item per artefact, each with the baseHash you read. Revise with changeset_put_items. Set ready: true when it's complete. 5. Then stop and reply with: the changeset url, a summary of each item, and anything the reviewer should check. 6. Use records_query and records_get only to understand the data. Don't change records unless I ask. 7. If a tool returns isError, read its code and fix: - insufficient_scope: tell me which scope is missing (the "required" field) and stop. - spec.conflict: someone changed the artefact. Read it again, redo the edit, plan again. - an access code such as no_grant: use access_explain to find out why, then tell me. Don't look for ways around a refusal. 8. Never print, store or repeat the API key. Stay within: . Don't touch: . ``` ## Why each rule is there The key already stops an agent from applying anything if it lacks `spec:apply`, but the prompt keeps the agent from trying, and gives it a clear stopping point: a changeset url and a summary for you. Reading before writing matters because every proposed item carries the version (`baseHash`) the agent started from. If someone changes the same page while the changeset waits, Ligament merges the two or reports a conflict instead of overwriting their work. The error rules turn refusals into useful messages. Every refusal from the API and the MCP server carries a `code` and usually a `fix`; an agent that reads them tells you “this key needs `records:write:incident`” instead of retrying in a loop. See [Errors](https://docs.ligament.ai/developers/errors/index.md). ## When you’re happy with the proposal Open the url the agent gives you. It goes to the changeset in **Build › Changes**, where you see the plan for every item and apply or discard the whole set. [Changesets](https://docs.ligament.ai/guides/building-apps/changesets/index.md) covers the review. For agents that work in a code repository (for example on an app manifest), put the same rules in an [AGENTS.md](https://docs.ligament.ai/build-with-ai/agents-md/index.md) file so every session starts with them. --- # AGENTS.md template > Drop-in instructions for coding agents that work on your apps. Source: https://docs.ligament.ai/build-with-ai/agents-md/ Coding agents such as Claude Code, Cursor and Codex read an `AGENTS.md` file at the root of a repository before they start work. Put this template in any repository where agents work on your Ligament apps (an app manifest, page specs pulled with `ligament spec pull`, scripts) and every session starts with the same rules: where the docs are, how to reach your workspace, and that the agent proposes changes while a person applies them. Download it from [/templates/AGENTS.md](https://docs.ligament.ai/templates/AGENTS.md), or copy it from below: ```sh curl -o AGENTS.md https://docs.ligament.ai/templates/AGENTS.md ``` Then edit the lines marked `EDIT`: your workspace’s address if it has its own domain, the apps you own, and what this agent may and may not touch. ## What the template covers | Section | What it tells the agent | | --- | --- | | About Ligament | What the product is, and where the [Markdown docs](https://docs.ligament.ai/build-with-ai/index.md) are | | Our workspace | The MCP server, and that the key is in `LIGAMENT_API_KEY` and must never be printed | | How to make changes | Read, edit, validate, plan, propose as a changeset, then stop and hand over the url | | Records | How to query, and to change records only when asked | | When something is refused | What `insufficient_scope`, `session_required`, `spec.conflict` and access codes mean, and that it mustn’t work around them | | Scope of this agent | Your own limits for this repository | The template assumes a key with `spec:read`, `spec:propose` and `records:read`, as set up in [Connect an agent with MCP](https://docs.ligament.ai/build-with-ai/mcp-setup/index.md). The same rules as a one-off chat prompt are on [A prompt for your agent](https://docs.ligament.ai/build-with-ai/agent-prompt/index.md). ## The template *AGENTS.md* ```md # AGENTS.md Instructions for AI coding agents working on our Ligament workspace. Copy this file to the root of your repository and edit the parts marked "EDIT". ## About Ligament Ligament runs our processes: records, workflows, approvals, portals and access control. Apps, pages and access rules are defined as a spec: JSON artefacts that people and agents change through reviewed changesets. Docs for agents: https://docs.ligament.ai/llms.txt (index) and https://docs.ligament.ai/llms-full.txt (everything in one file). Every docs page is also available as Markdown at its URL followed by index.md. ## Our workspace - App URL: https://app.ligament.ai - MCP server: https://app.ligament.ai/api/mcp (server name "ligament") - The API key is in the environment variable LIGAMENT_API_KEY. Never print it, log it, commit it or paste it into a file, a changeset or a chat message. - Apps we own: EDIT (for example: itsm, crm) ## How to make changes You propose; a person applies. Follow this loop for every change to pages, access rules and other artefacts: 1. Read before you write: spec_list and spec_get (or `ligament spec pull
`). Keep the `hash` you read. 2. Edit the doc. Check its shape with spec_schema and spec_validate. 3. Plan it: spec_plan (or `ligament spec plan `). Read the plan: action, layer, changes, and whether a person must apply it. 4. Propose it: changeset_create with a clear title and a note that says why, one item per artefact, each with the `baseHash` you read. Use changeset_put_items to revise it. Mark it ready when it is complete. 5. Stop. Give the person the changeset's `url` and a short summary of what changes and why. They review and apply it in Build > Changes. Do not call spec_apply or changeset_apply, even if the key allows it, unless the person explicitly asks you to apply a specific changeset. If an apply answers `proposed: true, applied: false`, the change is waiting for a person: report the `url` and stop. ## Records - Read records with records_query and records_get. Filters are [{ field, op, value }] with ops eq ne contains in lt lte gt gte empty not_empty. - Change records only when the task asks for it, one record at a time, and say which records you changed. - To answer "why can (or can't) someone see this", use access_explain rather than guessing. ## When something is refused Errors carry a `code` and a `fix`. Read them and act on them; do not work around them. - insufficient_scope: the key lacks a scope. Tell the person which scope (`required`) and stop. Do not look for another key. - session_required: only a signed-in person can do this in the app. Tell them. - spec.conflict: someone changed the artefact since you read it. Read it again, redo your edit on the new version, plan again. - no_grant or another access code: the key's creator may not do this. Use access_explain and report. ## Scope of this agent EDIT: list what this agent may and may not touch, for example: - May propose: pages and views in the itsm app. - May not touch: access rules, roles, permission sets, secrets, integrations. The key should have only spec:read, spec:propose and records:read unless this file says otherwise. ``` --- # REST API > Every API route and method, the API-key scope it needs, and what it does. Generated from the code. Source: https://docs.ligament.ai/reference/rest-api/ Every route below is on your workspace’s origin, for example `https://app.ligament.ai/api/records/incident`. Send an API key as `Authorization: Bearer `. The second column is what a key needs; a signed-in person in the browser is checked against their role instead. Request and response bodies are covered in the [developer guides](https://docs.ligament.ai/developers/index.md). The same table is available as OpenAPI 3.1: [`/openapi.json`](https://docs.ligament.ai/openapi.json). This page is generated from the product’s route table, so it lists every route the API serves today. Data - [Attachments](#attachments) 2 - [Dashboards](#dashboards) 4 - [E-signatures](#e-signatures) 23 - [Exchange rates](#exchange-rates) 4 - [Export](#export) 3 - [Geo](#geo) 1 - [Identity verification](#identity-verification) 1 - [Import](#import) 23 - [Incidents](#incidents) 1 - [Knowledge](#knowledge) 1 - [Record search](#record-search) 1 - [Records](#records) 21 - [Reports](#reports) 4 - [Seal verification](#seal-verification) 2 - [Search](#search) 1 Build - [App Sites](#app-sites) 2 - [App store](#app-store) 6 - [Apps](#apps) 15 - [Blocks](#blocks) 2 - [Build](#build) 19 - [Business hours](#business-hours) 2 - [Changesets](#changesets) 9 - [Connector hooks](#connector-hooks) 2 - [Connectors](#connectors) 6 - [Connectors and plugins](#connectors-and-plugins) 22 - [Custom components](#custom-components) 5 - [Entities](#entities) 25 - [Forms](#forms) 2 - [Modules](#modules) 2 - [Navigation](#navigation) 10 - [Page specs](#page-specs) 6 - [Pages](#pages) 4 - [Script test](#script-test) 1 - [Scripts](#scripts) 6 - [Spec store](#spec-store) 11 - [Templates](#templates) 2 - [Widgets](#widgets) 7 Automation and AI - [AI](#ai) 20 - [Approvals](#approvals) 3 - [Assistant](#assistant) 4 - [Automations](#automations) 15 - [Build plans](#build-plans) 8 - [CLI](#cli) 1 - [Endpoints](#endpoints) 2 - [Inbound hooks](#inbound-hooks) 5 - [Knowledge collections](#knowledge-collections) 7 - [Local agent runner](#local-agent-runner) 5 - [MCP](#mcp) 6 - [Outreach](#outreach) 2 - [Prompts](#prompts) 5 - [Prospecting](#prospecting) 2 - [Skills](#skills) 2 - [Tunnels](#tunnels) 3 - [Workflows](#workflows) 8 Access and identity - [Access](#access) 56 - [Access rules](#access-rules) 3 - [API keys](#api-keys) 2 - [Audit log](#audit-log) 4 - [Authentication](#authentication) 2 - [Domains](#domains) 4 - [Invites](#invites) 5 - [Members](#members) 3 - [OIDC clients](#oidc-clients) 2 - [Roles](#roles) 4 - [SCIM](#scim) 18 - [Security policy](#security-policy) 2 - [Single sign-on](#single-sign-on) 3 Workspace - [Health](#health) 1 - [Integrations](#integrations) 9 - [Notifications](#notifications) 27 - [Secrets](#secrets) 3 - [Settings](#settings) 17 - [Workspaces](#workspaces) 3 Channels and embeds - [Embed tokens](#embed-tokens) 3 - [Embeds](#embeds) 13 - [Inbound email](#inbound-email) 3 - [Live chat](#live-chat) 11 - [Notification callbacks](#notification-callbacks) 5 - [Portal](#portal) 5 - [Provider webhooks](#provider-webhooks) 4 Other - [assets](#assets) 2 - [compliance](#compliance) 19 - [demo](#demo) 3 - [onboard](#onboard) 2 - [onboarding](#onboarding) 2 - [x](#x) 6 ## Data ### Attachments Upload and download files. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/attachments/blob/{key…}` | `records:read` | | | PUT `/api/attachments/blob/{key…}` | `records:write` | | ### Dashboards Dashboards and favourites. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/dashboards` | `apps:read` | | | POST `/api/dashboards` | Signed-in session only | | | DELETE `/api/dashboards` | Signed-in session only | | | POST `/api/dashboards/{id}/favorite` | Signed-in session only | Toggle this dashboard as a favorite for the current user (pins it to the sidebar). | ### E-signatures Envelopes (create, send, remind, void, legal hold), their audit trails and sealed PDFs, templates, the seal status and the public verification check. People sign in person, never through a key. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/esign/download/{token}` | Own credential | The sealed PDF for a recipient outside the workspace (link in the completion email; 30 days). | | GET `/api/esign/envelopes` | `esign:read` | Envelopes the caller may read. | | POST `/api/esign/envelopes` | `esign:write` | | | GET `/api/esign/envelopes/{id}` | `esign:read` | Status, recipients, fields. | | DELETE `/api/esign/envelopes/{id}` | `esign:write` | | | GET `/api/esign/envelopes/{id}/audit` | `esign:read` | The hash-chained trail and whether it verifies (chain, head, sealed anchor). | | GET `/api/esign/envelopes/{id}/documents/{docId}` | `esign:read` | An original PDF as sent (readers of the envelope). | | POST `/api/esign/envelopes/{id}/legal-hold` | `settings:write` | E-signature admins only; audited. | | POST `/api/esign/envelopes/{id}/remind` | `esign:write` | | | GET `/api/esign/envelopes/{id}/sealed` | `esign:read` | The sealed PDF (readers of the envelope; it also sits on the subject record). | | POST `/api/esign/envelopes/{id}/send` | `esign:write` | Send a draft (the provider issues links / notices). | | POST `/api/esign/envelopes/{id}/void` | `esign:write` | | | POST `/api/esign/sign/{recipientId}` | Signed-in session only | A MEMBER signs their own envelope in the app. | | GET `/api/esign/sign/{recipientId}/document/{docId}` | Signed-in session only | A document the signed-in member is asked to sign. | | GET `/api/esign/status` | `esign:read` | The seal key, its certificate (expiry), the TSA and the last timestamp (e-signature admins). | | GET `/api/esign/templates` | `esign:read` | | | POST `/api/esign/templates` | `esign:write` | | | GET `/api/esign/templates/{id}` | `esign:read` | Id (id or key). | | PATCH `/api/esign/templates/{id}` | `esign:write` | | | DELETE `/api/esign/templates/{id}` | `esign:write` | | | GET `/api/esign/templates/{id}/document` | `esign:read` | The template's PDF (the field editor renders it). | | GET `/api/esign/verify` | Own credential | | | POST `/api/esign/verify` | Own credential | | ### Exchange rates Dated exchange rates and currency conversion that says which rate it used. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/fx/convert` | `records:read` | | | GET `/api/fx/rates` | `records:read` | | | POST `/api/fx/rates` | `settings:write` | | | POST `/api/fx/sync` | `settings:write` | | ### Export Download records as CSV, or the whole workspace as a ZIP. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/export` | `records:read` | Whole-workspace export as a ZIP of per-entity CSVs (admin). | | GET `/api/export/{entityKey}` | `records:read:{entityKey}` | That entity's rows as a CSV download (admin). | | GET `/api/export/schema` | `schema:read` | Runnable DDL + data for the data model (admin). | ### Geo Location lookups. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/geo` | Signed-in session only | | ### Identity verification Verification cases from an identity-verification provider. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/verify/{id}/sync` | Signed-in session only | Pull the case's current status from the provider and apply it (manual reconcile / "Refresh from provider"). | ### Import Stage data from files, map it onto entities and import it. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/import` | `records:read` | List draft staging batches. | | POST `/api/import` | `import:write` | Create a staging batch. | | GET `/api/import/{id}` | `records:read` | | | PUT `/api/import/{id}` | `import:write` | | | DELETE `/api/import/{id}` | `import:write` | | | POST `/api/import/{id}/profile` | `import:write` | | | POST `/api/import/{id}/promote` | `import:write` | Turn a staged batch into a new app/entity or import into an existing one. | | GET `/api/import/projects` | `records:read` | List draft multi-source import projects. | | POST `/api/import/projects` | `import:write` | Start a new project. | | GET `/api/import/projects/{id}` | `records:read` | The project + its staged source tables + any proposal. | | DELETE `/api/import/projects/{id}` | `import:write` | Discard the project + its staged batches. | | POST `/api/import/projects/{id}/commit` | `import:write` | Build entities/fields/records from the (optionally edited) proposal. | | POST `/api/import/projects/{id}/design` | `import:write` | AI-propose a normalized schema across the source tables. | | GET `/api/import/runs` | `records:read` | List staging import runs (admin only). | | GET `/api/import/runs/{id}` | `records:read` | | | POST `/api/import/runs/{id}/automap` | `import:write` | Given a source staging entity + a target entity, suggest a field mapping (exact key/label match, then fuzzy). | | POST `/api/import/runs/{id}/discard` | `import:write` | Delete a run and all of its staged records. | | POST `/api/import/runs/{id}/new-target` | `import:write` | Create a new real table mirroring a staging entity's columns, to promote into when no suitable table exists yet. | | POST `/api/import/runs/{id}/promote` | `import:write` | Map a staging entity's records into a target entity and upsert. | | POST `/api/import/runs/{id}/promote-cascade` | `import:write` | | | GET `/api/import/runs/{id}/records` | `records:read` | | | POST `/api/import/stage` | `import:write` | Stage a batch's rows into a run + staging entities using the (possibly user-edited) proposal. | | POST `/api/import/stage/detect` | `import:write` | | ### Incidents Major incident handling. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/incidents/{id}/major` | Signed-in session only | Declare / update / stand down a major incident. | ### Knowledge Search published knowledge articles. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/knowledge/search` | `records:read` | Published KB articles matching the query (case deflection). | ### Record search Search records across entities, filtered by what the caller can read. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/search-records` | `records:read` | Deterministic, ACL-scoped record search (the ⌘K command palette). | ### Records Create, read, update, transition and delete records; comments, attachments and history. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/records/{entityKey}` | `records:read:{entityKey}` | Query records. | | POST `/api/records/{entityKey}` | `records:write:{entityKey}` | Create a record. | | GET `/api/records/{entityKey}/{id}` | `records:read:{entityKey}` | Fetch one record. | | PATCH `/api/records/{entityKey}/{id}` | `records:write:{entityKey}` | Partial update (system fields + ext custom fields). | | DELETE `/api/records/{entityKey}/{id}` | `records:write:{entityKey}` | Delete one record (ACL + row-ACL + before-delete rules apply). | | GET `/api/records/{entityKey}/{id}/attachments` | `records:read:{entityKey}` | The record's attachments (confirmed only). | | POST `/api/records/{entityKey}/{id}/attachments` | `records:write:{entityKey}` | | | GET `/api/records/{entityKey}/{id}/attachments/{attId}` | `records:read:{entityKey}` | 302 to a short-lived download URL. | | PATCH `/api/records/{entityKey}/{id}/attachments/{attId}` | `records:write:{entityKey}` | Confirm the upload completed. | | DELETE `/api/records/{entityKey}/{id}/attachments/{attId}` | `records:write:{entityKey}` | Remove file + metadata. | | GET `/api/records/{entityKey}/{id}/comments` | `records:read:{entityKey}` | The record's comments + work notes. | | POST `/api/records/{entityKey}/{id}/comments` | `records:write:{entityKey}` | Add a comment / work note. | | GET `/api/records/{entityKey}/{id}/history` | `records:read:{entityKey}` | | | GET `/api/records/{entityKey}/{id}/live` | Signed-in session only | Per-record real-time channel (SSE). | | POST `/api/records/{entityKey}/{id}/merge` | `records:write:{entityKey}` | | | POST `/api/records/{entityKey}/{id}/reveal` | `records:read:{entityKey}` | The clear values of fields the caller sees masked on this record. | | POST `/api/records/{entityKey}/{id}/transition` | `records:write:{entityKey}` | Move a record to a new state. | | POST `/api/records/{entityKey}/batch` | `records:write:{entityKey}` | | | GET `/api/records/{entityKey}/changes` | `records:read:{entityKey}` | | | GET `/api/records/{entityKey}/effective-events` | `records:read:{entityKey}` | List the changes that take effect in a period on an effective-dated entity, as JSON or CSV (for payroll). | | POST `/api/records/batch` | `records:write` | | ### Reports Run aggregations over records. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/reports` | `apps:read` | | | POST `/api/reports` | Signed-in session only | | | DELETE `/api/reports` | Signed-in session only | | | POST `/api/reports/run` | `records:read` | Run an ad-hoc aggregation for the builder preview (read-gated). | ### Seal verification The verification check for sealed PDFs (the same as the e-signature verify endpoint). | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/seal/verify` | Own credential | | | POST `/api/seal/verify` | Own credential | | ### Search Workspace search. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/search` | Own credential | | ## Build ### App Sites Actions on published App Sites. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/sites/action` | Signed-in session only | Perform an App Site action-button as the signed-in principal (the write path). | | POST `/api/sites/intake` | Own credential | | ### App store The app catalogue and subscriptions. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/store` | `apps:read` | The app catalog with this workspace's subscription status. | | POST `/api/store/{appKey}/subscribe` | `apps:install` | | | POST `/api/store/{appKey}/unsubscribe` | `apps:install` | Cancel + disable an app (owner/admin). | | POST `/api/store/publish` | `apps:write` | Re-sync the store catalog from code manifests (owner/admin). | | GET `/api/store/settings` | `apps:read` | | | PUT `/api/store/settings` | `settings:write` | | ### Apps Publish, install, upgrade and uninstall apps. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/apps` | `apps:read` | List the API key's workspace's published apps + their versions. | | POST `/api/apps/delete` | `apps:install` | Remove a custom app (session, admin). | | GET `/api/apps/dependencies` | `apps:read` | What a delete would touch / block (session, admin). | | POST `/api/apps/install` | `apps:install` | | | GET `/api/apps/install-runs` | `apps:read` | Recent install runs in this workspace (newest first). | | POST `/api/apps/install-runs` | `apps:install` | | | GET `/api/apps/install-runs/{id}` | `apps:read` | One install run of this workspace (another workspace's id answers 404). | | POST `/api/apps/install-runs/{id}/resume` | `apps:install` | Retry a failed install run from the step that failed (what is installed stays; nothing is redone). | | POST `/api/apps/install-runs/{id}/step` | `apps:install` | Install the next app of the run (one per call) and return the run. | | GET `/api/apps/install/plan` | `apps:read` | | | POST `/api/apps/publish` | `apps:write` | Publish an immutable AppVersion (the data manifest, with any DSL workflows) owned by the API key's workspace. | | POST `/api/apps/uninstall` | `apps:install` | Disable an installed app in the API key's workspace. | | GET `/api/apps/updates` | `apps:read` | | | POST `/api/apps/upgrade` | `apps:install` | Assess (and optionally apply) an app version upgrade with a data-loss guard. | | POST `/api/apps/upgrade/bulk` | `apps:install` | Upgrade several installed apps, dependencies first. | ### Blocks Reusable page blocks. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/blocks/composites/{key}` | `apps:write` | | | POST `/api/blocks/custom/{name}` | `apps:write` | | ### Build Custom apps: entities, extension fields, workflows, sites and store listings. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/build/apps` | `apps:read` | The workspace's custom apps. | | POST `/api/build/apps` | `apps:write` | Create a new custom app. | | POST `/api/build/apps/{appKey}/entities` | `apps:write` | Create an app-scoped entity. | | GET `/api/build/apps/{appKey}/extend` | `apps:read` | This app's extension fields, grouped by target entity. | | POST `/api/build/apps/{appKey}/extend` | `apps:write` | Add an app-owned field. | | DELETE `/api/build/apps/{appKey}/extend` | `apps:write` | Remove one of this app's extension fields. | | GET `/api/build/apps/{appKey}/metadata` | `apps:read` | Entities/fields/states + members + roles for the flow-builder's pickers. | | POST `/api/build/apps/{appKey}/publish` | `apps:write` | | | GET `/api/build/apps/{appKey}/sites` | `apps:read` | The app's site settings, its routes, and the entities (with fields) available to bind. | | PUT `/api/build/apps/{appKey}/sites` | `apps:write` | Upsert the site settings (mount / visibility / slug / nav / accent). | | POST `/api/build/apps/{appKey}/sites/routes` | `apps:write` | Upsert a route. | | DELETE `/api/build/apps/{appKey}/sites/routes` | `apps:write` | Remove a route. | | POST `/api/build/apps/{appKey}/store` | `apps:write` | | | PUT `/api/build/apps/{appKey}/store` | `apps:write` | Upsert the store listing + plans (monetize). | | GET `/api/build/apps/{appKey}/workflows` | `apps:read` | The app's workflow drafts. | | POST `/api/build/apps/{appKey}/workflows` | `apps:write` | Create a new workflow (manual trigger, empty body) to edit on the canvas. | | GET `/api/build/apps/{appKey}/workflows/{key}` | `apps:read` | | | PUT `/api/build/apps/{appKey}/workflows/{key}` | `apps:write` | Save the workflow (validated). | | DELETE `/api/build/apps/{appKey}/workflows/{key}` | `apps:write` | | ### Business hours Working-hours schedules used by SLAs. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/business-hours` | `settings:read` | The workspace's working-hours schedule (or defaults). | | PUT `/api/business-hours` | `settings:write` | Save the schedule (admins only). | ### Changesets Propose changes for review, then apply them together. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/changesets` | `spec:read` | Changesets, newest first. | | POST `/api/changesets` | `spec:propose` | | | GET `/api/changesets/{id}` | `spec:read` | The changeset with its items (docs + base hashes) and activity. | | PATCH `/api/changesets/{id}` | `spec:propose` | Rename, or mark ready for review / reopen. | | POST `/api/changesets/{id}/apply` | `spec:apply` | | | POST `/api/changesets/{id}/discard` | `spec:propose` | Drop the changeset (kept, with its activity, as discarded). | | PUT `/api/changesets/{id}/items` | `spec:propose` | | | DELETE `/api/changesets/{id}/items` | `spec:propose` | Drop one item. | | POST `/api/changesets/{id}/plan` | `spec:read` | The plan of every item against current (merges, conflicts, permissions). | ### Connector hooks Inbound calls for connectors. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/connector-hook/{token}` | `endpoints:invoke` | | | POST `/api/connector-hook/{token}` | `endpoints:invoke` | | ### Connectors Installed connectors and their operations. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/connectors` | `apps:read` | | | POST `/api/connectors` | `apps:write` | | | GET `/api/connectors/{key}` | `apps:read` | | | PUT `/api/connectors/{key}` | `apps:write` | | | DELETE `/api/connectors/{key}` | `apps:write` | | | POST `/api/connectors/{key}/test` | `apps:write` | Try a connector operation with sample args — powers the editor's Run button. | ### Connectors and plugins Connectors to other systems: install, configure, OAuth and publishing. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/plugins` | `apps:read` | Every connector (built-in, tenant-authored, shared from a parent org) with this workspace's install state. | | POST `/api/plugins` | `apps:write` | Create/update a tenant-authored connector. | | PATCH `/api/plugins/{key}` | `apps:write` | Update connector settings (currently: org sharing of an approved connector). | | DELETE `/api/plugins/{key}` | `apps:write` | Remove a tenant-authored connector (and its install). | | PUT `/api/plugins/{key}/functions` | `apps:write` | Replace the named functions of a tenant connector. | | POST `/api/plugins/{key}/install` | `apps:install` | Install/configure the plugin for this workspace. | | DELETE `/api/plugins/{key}/install` | `apps:install` | Uninstall the plugin from this workspace. | | GET `/api/plugins/{key}/oauth/client` | `apps:read` | OAuth connection status (no tokens). | | POST `/api/plugins/{key}/oauth/client` | `settings:write` | Store the tenant's app-registration creds (workspace admins). | | DELETE `/api/plugins/{key}/oauth/client` | `settings:write` | Disconnect (clears stored tokens; keeps client creds). | | GET `/api/plugins/{key}/oauth/start` | `settings:write` | Begin the OAuth2 authorization-code flow. | | GET `/api/plugins/{key}/publish` | `apps:read` | This connector's store-submission state (if any). | | POST `/api/plugins/{key}/publish` | `apps:write` | Submit this workspace's connector for public store review (or publish an update). | | DELETE `/api/plugins/{key}/publish` | `apps:write` | Pull this workspace's connector from the store (existing installs keep their copy). | | POST `/api/plugins/{key}/update` | `apps:write` | Re-sync a store-installed connector to the publisher's latest version (credentials kept). | | POST `/api/plugins/import` | `apps:write` | | | POST `/api/plugins/inbound/{token}` | Own credential | The generic inbound webhook for conversation-channel connectors (Telegram today). | | GET `/api/plugins/oauth/callback` | Own credential | Provider redirects here after consent. | | GET `/api/plugins/wizard/{id}` | `apps:read` | The install spec (fields, capability, current state) for the wizard. | | POST `/api/plugins/wizard/{id}` | `apps:write` | Perform the install/configure. | | DELETE `/api/plugins/wizard/{id}` | `apps:write` | Uninstall/deactivate the plugin. | | POST `/api/plugins/wizard/{id}/test` | `settings:write` | Run a provider's connection test (nothing is stored). | ### Custom components Upload, approve and revoke custom page components. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/components` | `apps:read` | Every custom component version (status, requested vs approved scopes, hash). | | POST `/api/components` | `apps:write` | Upload a version (admins; it is code that will run in viewers' browsers, sandboxed). | | POST `/api/components/{name}/{version}/approve` | `components:approve` | Approve a version and grant a subset of the scopes it requested (default: all requested). | | POST `/api/components/{name}/{version}/revoke` | `components:approve` | Withdraw a version's approval. | | POST `/api/components/data` | Signed-in session only | The ONLY data channel of a custom component. | ### Entities The data model: entities, fields, forms, views, lifecycles and rules. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/entities` | `schema:read` | List this workspace's configurable entity defs (+ fields). | | POST `/api/entities/{entityKey}/fields` | `schema:write` | Add a custom field (admin only). | | PATCH `/api/entities/{entityKey}/fields/{fieldId}` | `schema:write` | Edit a field (admin only). | | DELETE `/api/entities/{entityKey}/fields/{fieldId}` | `schema:write` | Remove a custom field (admin only). | | GET `/api/entities/{entityKey}/form-layout` | `schema:read` | A named form's layout + available fields. | | PUT `/api/entities/{entityKey}/form-layout` | `schema:write` | Save one named form (admin only). | | DELETE `/api/entities/{entityKey}/form-layout` | `schema:write` | Drop a role-specific record layout (that role falls back to the default form). | | GET `/api/entities/{entityKey}/forms` | `schema:read` | The entity's named forms (default first). | | POST `/api/entities/{entityKey}/forms` | `schema:write` | Create a new custom form; optionally seeded from another form's layout. | | PATCH `/api/entities/{entityKey}/forms` | `schema:write` | Rename a form and/or promote it to the entity default. | | DELETE `/api/entities/{entityKey}/forms` | `schema:write` | Remove a custom form (never the primary 'default'). | | GET `/api/entities/{entityKey}/lifecycle` | `schema:read` | States + transitions. | | PUT `/api/entities/{entityKey}/lifecycle` | `schema:write` | Replace the lifecycle (admin only). | | GET `/api/entities/{entityKey}/list-columns` | `schema:read` | Available columns + the caller's resolved selection. | | PUT `/api/entities/{entityKey}/list-columns` | `schema:write` | Save personal (default needs admin). | | DELETE `/api/entities/{entityKey}/list-columns` | Signed-in session only | Clear the caller's personal override. | | GET `/api/entities/{entityKey}/related-columns` | `schema:read` | The child entity's choosable columns + its current related-list selection. | | PUT `/api/entities/{entityKey}/related-columns` | `schema:write` | Set the shared related-list columns for this entity (admin only). | | GET `/api/entities/{entityKey}/rules` | `schema:read` | All rules for the entity + its fields/states (for the editor). | | PUT `/api/entities/{entityKey}/rules` | `schema:write` | Replace the tenant-authored rules (admin only). | | GET `/api/entities/{entityKey}/views` | `schema:read` | Built-in + shared (visible to the caller's role) + personal views. | | POST `/api/entities/{entityKey}/views` | Signed-in session only | | | PUT `/api/entities/{entityKey}/views` | Signed-in session only | Replace a view's spec (owner for personal, admin for shared). | | PATCH `/api/entities/{entityKey}/views` | `schema:write` | Pin as default / toggle nav (admin, shared views). | | DELETE `/api/entities/{entityKey}/views` | Signed-in session only | Delete a personal (owner) or shared (admin) view. | ### Forms Forms sent to people during a workflow. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/forms/{id}` | Own credential | | | POST `/api/forms/{id}/submit` | Own credential | | ### Modules Built-in modules a workspace can turn on. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/modules` | `apps:read` | Available modules + which this workspace has enabled. | | POST `/api/modules` | `apps:install` | Install a module. | ### Navigation Navigation preferences and app rail settings. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/nav/apps` | `settings:read` | | | DELETE `/api/nav/apps` | `settings:write` | | | PUT `/api/nav/apps/{appKey}` | `settings:write` | | | DELETE `/api/nav/apps/{appKey}` | `settings:write` | | | GET `/api/nav/defaults` | Signed-in session only | | | PUT `/api/nav/defaults` | Signed-in session only | | | DELETE `/api/nav/defaults` | Signed-in session only | | | GET `/api/nav/prefs` | Signed-in session only | | | PUT `/api/nav/prefs` | Signed-in session only | | | DELETE `/api/nav/prefs` | Signed-in session only | | ### Page specs Pages defined as specs: validate, plan and apply. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/page-specs` | `apps:read` | Pages applied from a page spec (key, title, hash, url). | | GET `/api/page-specs/{key}` | `apps:read` | | | POST `/api/page-specs/apply` | `apps:write` | | | POST `/api/page-specs/plan` | `apps:read` | Validate, then diff against the applied page. | | GET `/api/page-specs/schema` | `apps:read` | JSON Schemas (page, per-block props, component manifest) + the block registry and limits. | | POST `/api/page-specs/validate` | `apps:read` | | ### Pages Custom pages. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/pages` | `apps:read` | Custom pages (optionally for one app). | | POST `/api/pages` | `apps:write` | Create/update a page (admin). | | GET `/api/pages/{id}` | `apps:read` | | | DELETE `/api/pages/{id}` | `apps:write` | | ### Script test Run an unsaved script with sample input. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/script-test` | `apps:write` | Try a script (unsaved) with a sample input — powers the editor's Run button. | ### Scripts Sandboxed scripts and their endpoints. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/scripts` | `apps:read` | | | POST `/api/scripts` | `apps:write` | | | GET `/api/scripts/{key}` | `apps:read` | | | PUT `/api/scripts/{key}` | `apps:write` | | | PATCH `/api/scripts/{key}` | `apps:write` | Mint a new endpoint URL (revokes the old token). | | DELETE `/api/scripts/{key}` | `apps:write` | | ### Spec store Read, validate, plan and apply app artefacts. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/spec` | `spec:read` | Every artefact in the spec store (effective layer, customised?, conflicts). | | GET `/api/spec/{address…}` | `spec:read` | | | POST `/api/spec/apply` | `spec:apply` | | | GET `/api/spec/catalog` | `spec:read` | | | GET `/api/spec/conflicts` | `spec:read` | Values an upgrade re-base kept from the workspace's customisation (to review). | | POST `/api/spec/conflicts` | `spec:apply` | Mark them reviewed (the custom values stay). | | POST `/api/spec/plan` | `spec:read` | | | GET `/api/spec/policy` | `spec:read` | | | PUT `/api/spec/policy` | Signed-in session only | | | GET `/api/spec/schema/{type}` | `spec:read` | The JSON Schema of one artefact type (the JSON tab, the CLI and MCP use it). | | POST `/api/spec/validate` | `spec:read` | | ### Templates Message and document templates. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/templates` | Signed-in session only | Active templates for the macro/insert pickers. | | POST `/api/templates/{id}/render` | Signed-in session only | | ### Widgets Sandboxed widgets on record pages. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/widgets` | `apps:read` | | | POST `/api/widgets` | `apps:write` | | | GET `/api/widgets/{key}` | `apps:read` | | | PUT `/api/widgets/{key}` | `apps:write` | | | DELETE `/api/widgets/{key}` | `apps:write` | | | POST `/api/widgets/{key}/render` | `records:read` | Render payload for a widget — the def + its data. | | POST `/api/widgets/action` | `records:write` | The WRITE channel for widgets. | ## Automation and AI ### AI Models, agents, knowledge indexing and agent tasks. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/ai/{id}` | Own credential | | | POST `/api/ai/{id}/review` | Own credential | | | GET `/api/ai/adapters` | `ai:use` | Research source adapters + availability (for the research.enrich picker). | | GET `/api/ai/agents` | `ai:use` | The workspace's named AI agents. | | POST `/api/ai/agents` | `apps:write` | Create/update a named agent (admin). | | GET `/api/ai/agents/{key}` | `ai:use` | One agent. | | DELETE `/api/ai/agents/{key}` | `apps:write` | Remove an agent (admin). | | POST `/api/ai/assist/draft` | Signed-in session only | Drafts a customer-facing reply grounded in the ticket + top KB articles. | | POST `/api/ai/assist/suggest` | Signed-in session only | Semantic KB article suggestions for the agent working a ticket (searches the 'kb' RAG index, keyword fallback). | | POST `/api/ai/assist/summarize` | Signed-in session only | A concise TL;DR of the ticket + its thread, for reassignment / shift handoff / major-incident bridges. | | GET `/api/ai/config` | `settings:read` | | | PUT `/api/ai/config` | `settings:write` | | | GET `/api/ai/knowledge/settings` | `settings:read` | KB index status + auto-sync toggle (any member). | | PUT `/api/ai/knowledge/settings` | `settings:write` | Toggle scheduled auto-sync (admin). | | POST `/api/ai/knowledge/sync` | `settings:write` | Rebuild the agent knowledge index from published KB articles (admin). | | GET `/api/ai/models` | `ai:use` | | | GET `/api/ai/tasks` | Signed-in session only | The CURRENT USER's agent task queue (queues are per user, never shared). | | POST `/api/ai/tasks` | Signed-in session only | Queue a task in the current user's queue. | | PATCH `/api/ai/tasks/{id}` | Signed-in session only | | | GET `/api/ai/tasks/{id}/transcript` | Signed-in session only | The owner's view of what the agent actually did: the task's session transcript. | ### Approvals List and decide approvals. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/approvals` | `approvals:decide` | Approvals in the workspace, for the CLI and automation. | | GET `/api/approvals/{id}` | Own credential | | | POST `/api/approvals/{id}/decide` | `approvals:decide` | | ### Assistant The in-app assistant. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/assistant` | Signed-in session only | Stream the assistant's agentic run as SSE; persists the turn + logs usage at the end. | | GET `/api/assistant/sessions` | Signed-in session only | The caller's recent assistant conversations. | | GET `/api/assistant/sessions/{id}` | Signed-in session only | One conversation's messages (only if it belongs to the caller). | | DELETE `/api/assistant/sessions/{id}` | Signed-in session only | | ### Automations Automations on entities and overrides of app workflows. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/automations` | `workflows:read` | The tenant's automations. | | POST `/api/automations` | `workflows:write` | | | GET `/api/automations/{key}` | `workflows:read` | | | PUT `/api/automations/{key}` | `workflows:write` | | | PATCH `/api/automations/{key}` | `workflows:write` | | | DELETE `/api/automations/{key}` | `workflows:write` | | | POST `/api/automations/{key}/run` | `workflows:run` | Manually run this automation now; returns the run id. | | GET `/api/automations/metadata` | `workflows:read` | Every workspace entity (+ members/roles) for the automation builder's pickers. | | POST `/api/automations/on-failure` | `workflows:write` | Set (or clear) the workspace-wide on-failure automation. | | GET `/api/automations/overrides` | `workflows:read` | Installed apps' shipped workflows, annotated with override state. | | POST `/api/automations/overrides` | `workflows:write` | Fork a shipped workflow into an editable tenant override. | | GET `/api/automations/overrides/{appKey}/{key}` | `workflows:read` | | | PUT `/api/automations/overrides/{appKey}/{key}` | `workflows:write` | Save the override body. | | PATCH `/api/automations/overrides/{appKey}/{key}` | `workflows:write` | Disable an app's workflow for this tenant (or re-enable the override). | | DELETE `/api/automations/overrides/{appKey}/{key}` | `workflows:write` | Drop the override; the app's shipped workflow takes effect again. | ### Build plans Plans and tasks the build assistant works through. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/plans` | Signed-in session only | The caller's build plans (optionally for one app). | | POST `/api/plans` | Signed-in session only | Create a plan (usually the agent's propose\_plan tool, but a manual create works too). | | GET `/api/plans/{id}` | Signed-in session only | | | PATCH `/api/plans/{id}` | Signed-in session only | Title / status. | | DELETE `/api/plans/{id}` | Signed-in session only | | | POST `/api/plans/{id}/tasks` | Signed-in session only | Add a task to the plan. | | PATCH `/api/plans/{id}/tasks/{taskId}` | Signed-in session only | Edit a task: status (check off), title/detail, reorder (afterId), or deps/agent (frame). | | DELETE `/api/plans/{id}/tasks/{taskId}` | Signed-in session only | | ### CLI Endpoints the CLI uses to sign in. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/cli/generate` | `ai:use` | | ### Endpoints Exposed endpoints. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/endpoints` | `apps:read` | | | POST `/api/endpoints/register` | `apps:write` | | ### Inbound hooks Call an exposed script endpoint. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/hook/{token}` | `endpoints:invoke` | | | POST `/api/hook/{token}` | `endpoints:invoke` | | | PUT `/api/hook/{token}` | `endpoints:invoke` | | | PATCH `/api/hook/{token}` | `endpoints:invoke` | | | DELETE `/api/hook/{token}` | `endpoints:invoke` | | ### Knowledge collections Collections of documents agents can search. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/rag/collections` | `ai:use` | | | POST `/api/rag/collections` | `apps:write` | | | PATCH `/api/rag/collections/{slug}` | `apps:write` | | | DELETE `/api/rag/collections/{slug}` | `apps:write` | | | GET `/api/rag/collections/{slug}/documents` | `ai:use` | | | POST `/api/rag/collections/{slug}/documents` | `apps:write` | Add knowledge. | | DELETE `/api/rag/collections/{slug}/documents` | `apps:write` | | ### Local agent runner Endpoints the local agent runner (CLI) calls. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/agent-host/claim` | `ai:use` | | | POST `/api/agent-host/complete` | `ai:use` | | | POST `/api/agent-host/heartbeat` | `ai:use` | | | GET `/api/agent-host/task` | `ai:use` | Status + answer for the runner's cancel checks and ask\_owner answer-polling. | | POST `/api/agent-host/waiting` | `ai:use` | Local ask\_owner: flip the task to waiting with the question (runner then polls /task). | ### MCP The MCP server, and MCP servers the workspace's agents use. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/mcp` | `endpoints:invoke` or any of `spec:read`, `spec:propose`, `spec:apply`, `records:read`, `members:write`, `apps:read`, `apps:install`, `settings:write` | | | GET `/api/mcp/servers` | Signed-in session only | List servers (headers omitted; they're secrets). | | POST `/api/mcp/servers` | Signed-in session only | Register a server (admin). | | POST `/api/mcp/servers/{id}` | Signed-in session only | Test the connection + sync the tool list (admin). | | PATCH `/api/mcp/servers/{id}` | Signed-in session only | Update/enable/disable (admin). | | DELETE `/api/mcp/servers/{id}` | Signed-in session only | Remove the server (admin). | ### Outreach Email campaigns. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/outreach/open` | Own credential | | | GET `/api/outreach/unsubscribe` | Own credential | | ### Prompts Named prompts. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/prompts` | `apps:read` | | | POST `/api/prompts` | `apps:write` | | | GET `/api/prompts/{slug}` | `apps:read` | | | PUT `/api/prompts/{slug}` | `apps:write` | | | DELETE `/api/prompts/{slug}` | `apps:write` | | ### Prospecting Prospect lists and enrolment. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/prospecting/lgm-enroll-selected` | `workflows:run` | | | POST `/api/prospecting/research-selected` | `workflows:run` | | ### Skills Agent skills. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/skills` | `apps:read` | | | POST `/api/skills/register` | `apps:write` | | ### Tunnels Private connections from the platform to your machines. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/tunnels` | `apps:read` | List tunnels with live status (session or API key). | | POST `/api/tunnels` | `apps:write` | Create a tunnel (admins; CLI API keys count as admin). | | DELETE `/api/tunnels/{id}` | `apps:write` | Remove a tunnel (admins). | ### Workflows Workflow definitions and runs: start, cancel, replay. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/workflows` | `workflows:read` | | | POST `/api/workflows/register` | `workflows:write` | | | GET `/api/workflows/runs` | `workflows:read` | | | GET `/api/workflows/runs/{runId}` | `workflows:read` | | | POST `/api/workflows/runs/{runId}/cancel` | `workflows:run` | | | POST `/api/workflows/runs/{runId}/replay` | `workflows:run` | Re-enqueue a terminal (failed/cancelled) run with its original input as a NEW run (dead-letter replay). | | GET `/api/workflows/runs/{runId}/state` | Signed-in session only | | | POST `/api/workflows/trigger` | `workflows:run` | | ## Access and identity ### Access Roles, permission sets, restrictions, groups, hierarchies, elevations, delegations, and the explain API. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/access/assignments` | `settings:read` | | | POST `/api/access/assignments` | `members:write` | Assign a role (owners/admins, or an app admin for a role built only from their app's sets; audited). | | DELETE `/api/access/assignments/{id}` | `members:write` | | | GET `/api/access/audit` | `settings:read` | | | POST `/api/access/break-glass` | Signed-in session only | | | PUT `/api/access/classification` | `members:write` | | | GET `/api/access/delegations` | `settings:read` | | | POST `/api/access/delegations` | `members:write` | | | POST `/api/access/delegations/{id}/revoke` | `members:write` | End a delegation early: the delegator, the delegate or an owner/admin. | | GET `/api/access/effective` | `records:read` | | | GET `/api/access/elevations` | `settings:read` | | | POST `/api/access/elevations` | `members:write` | | | POST `/api/access/elevations/{id}/decide` | `members:write` | | | POST `/api/access/elevations/{id}/revoke` | `members:write` | End an elevation early (an admin, or the holder); a pending request is cancelled. | | GET `/api/access/enforce/readiness` | `settings:read` | | | GET `/api/access/evaluator` | `records:read` | | | PUT `/api/access/evaluator` | `settings:write` | | | GET `/api/access/explain` | `records:read` | | | POST `/api/access/explain` | `records:read` | | | GET `/api/access/freeze` | `settings:read` | | | POST `/api/access/freeze` | `members:write` | Apply the freeze (owners only). | | POST `/api/access/freeze/open` | `members:write` | | | GET `/api/access/group-mappings` | `settings:read` | | | POST `/api/access/group-mappings` | `members:write` | | | DELETE `/api/access/group-mappings/{id}` | `members:write` | | | GET `/api/access/groups` | `settings:read` | | | POST `/api/access/groups` | `members:write` | | | GET `/api/access/groups/{id}` | `settings:read` | One group with its members and mappings (owners/admins). | | PATCH `/api/access/groups/{id}` | `members:write` | | | DELETE `/api/access/groups/{id}` | `members:write` | Delete a manual group (SCIM groups are deleted by the IdP). | | POST `/api/access/groups/{id}/members` | `members:write` | | | DELETE `/api/access/groups/{id}/members` | `members:write` | | | GET `/api/access/hierarchies` | `records:read` | | | GET `/api/access/hierarchies/{key}` | `records:read` | | | POST `/api/access/hierarchies/{key}` | `settings:write` | | | POST `/api/access/hierarchies/{key}/reparent` | `settings:write` | | | GET `/api/access/permission-sets` | `settings:read` | | | POST `/api/access/permission-sets` | `members:write` | Create or replace a workspace permission set (owners/admins, or an app admin for their app's sets; audited). | | GET `/api/access/permission-sets/{key}` | `settings:read` | One set (owners/admins; an app admin: their app's sets only, others answer 404 like a missing one). | | PUT `/api/access/permission-sets/{key}` | `members:write` | | | PATCH `/api/access/permission-sets/{key}` | `members:write` | | | DELETE `/api/access/permission-sets/{key}` | `members:write` | | | GET `/api/access/restrictions` | `settings:read` | | | POST `/api/access/restrictions` | `members:write` | | | PUT `/api/access/restrictions/{key}` | `members:write` | | | DELETE `/api/access/restrictions/{key}` | `members:write` | | | GET `/api/access/roles/{key}` | `settings:read` | | | PUT `/api/access/roles/{key}` | `members:write` | | | PATCH `/api/access/roles/{key}` | `members:write` | | | DELETE `/api/access/roles/{key}` | `members:write` | Delete a custom role nobody holds as their seat (owners/admins; app admins: their app's roles). | | GET `/api/access/shadow` | `settings:read` | | | GET `/api/access/view-as` | Signed-in session only | | | POST `/api/access/view-as` | Signed-in session only | | | DELETE `/api/access/view-as` | Signed-in session only | | | GET `/api/access/who` | `settings:read` | | | GET `/api/access/whoami` | `records:read` | | ### Access rules Per-entity access rules. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/acls` | `settings:read` | List ACL rules for the workspace (admin only). | | POST `/api/acls` | `members:write` | Upsert a rule (admin only). | | DELETE `/api/acls/{id}` | `members:write` | Remove an ACL rule (admin only, workspace-scoped). | ### API keys Create and revoke API keys (signed-in session only). | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/keys` | Signed-in session only | | | DELETE `/api/keys/{id}` | Signed-in session only | Revoke an API key. | ### Audit log Record changes and security events. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/audit` | `audit:read` | Admin-only audit list. | | GET `/api/audit/export` | `audit:read` | Admin-only download of the audit log. | | GET `/api/audit/security` | `audit:read` | Admin-only auth-event list. | | GET `/api/audit/security/export` | `audit:read` | Admin-only auth-event download. | ### Authentication Sign-in endpoints. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/auth/{all…}` | Own credential | | | POST `/api/auth/{all…}` | Own credential | | ### Domains Claim and verify email domains. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/domains` | `settings:read` | Claimed email domains for the workspace (+ the TXT record that verifies a pending one; admin keys and sessions only). | | POST `/api/domains` | `sso:write` | Claim a domain (admins). | | DELETE `/api/domains` | `sso:write` | Unclaim a domain (admins). | | POST `/api/domains/verify` | `sso:write` | | ### Invites Invite people to the workspace. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/invites` | `settings:read` | Pending invites, expired ones included (admin only; invite tokens only for sessions and members:write keys). | | POST `/api/invites` | `members:write` | Invite someone (admin only). | | DELETE `/api/invites/{id}` | `members:write` | Revoke a pending invite (admin only). | | POST `/api/invites/{id}/resend` | `members:write` | | | POST `/api/invites/accept` | Signed-in session only | | ### Members People in the workspace. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/members` | `settings:read` | Workspace members. | | PATCH `/api/members/{userId}` | `members:write` | Change a member's role, subtree scope, and/or app allowlist (admin only). | | DELETE `/api/members/{userId}` | `members:write` | Remove a member (admin only; not the owner). | ### OIDC clients Apps that sign people in with this workspace. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/oidc/clients` | Signed-in session only | Register / list OIDC client applications (Ligament-as-IdP). | | POST `/api/oidc/clients` | Signed-in session only | | ### Roles Built-in and custom roles. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/roles` | `settings:read` | Workspace roles (built-in + custom). | | POST `/api/roles` | `members:write` | Add a custom role (build:access: owners/admins). | | PATCH `/api/roles/{key}` | Signed-in session only | | | DELETE `/api/roles/{key}` | `members:write` | Remove a custom role (build:access; built-ins + in-use blocked). | ### SCIM SCIM 2.0 users and groups, and the tokens your identity provider uses. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/scim/tokens` | `settings:read` | List this workspace's SCIM tokens (metadata only, never the secret). | | POST `/api/scim/tokens` | `sso:write` | Mint a SCIM bearer token. | | DELETE `/api/scim/tokens/{id}` | `sso:write` | Revoke a SCIM token (scoped to the caller's workspace). | | GET `/api/scim/v2/Groups` | Own credential | | | POST `/api/scim/v2/Groups` | Own credential | Create a group (members optional; each must be a user of this workspace). | | GET `/api/scim/v2/Groups/{id}` | Own credential | | | PUT `/api/scim/v2/Groups/{id}` | Own credential | Replace displayName and members. | | PATCH `/api/scim/v2/Groups/{id}` | Own credential | | | DELETE `/api/scim/v2/Groups/{id}` | Own credential | The group goes (its members and role mappings with it). | | GET `/api/scim/v2/ResourceTypes` | Own credential | The resource types we expose (User, Group). | | GET `/api/scim/v2/Schemas` | Own credential | The core User and Group schemas (enough for Entra/Okta attribute mapping). | | GET `/api/scim/v2/ServiceProviderConfig` | Own credential | | | GET `/api/scim/v2/Users` | Own credential | | | POST `/api/scim/v2/Users` | Own credential | Provision a user into the token's workspace. | | GET `/api/scim/v2/Users/{id}` | Own credential | | | PUT `/api/scim/v2/Users/{id}` | Own credential | Full replace (name + active). | | PATCH `/api/scim/v2/Users/{id}` | Own credential | The deactivation + attribute-edit path (Entra/Okta). | | DELETE `/api/scim/v2/Users/{id}` | Own credential | Deprovision (remove membership). | ### Security policy Allowed sign-in methods and two-factor requirements. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/security-policy` | Signed-in session only | Per-workspace auth security policy. | | PUT `/api/security-policy` | Signed-in session only | | ### Single sign-on SSO identity providers (signed-in session only). | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/sso/providers` | Signed-in session only | | | POST `/api/sso/providers` | Signed-in session only | | | DELETE `/api/sso/providers` | Signed-in session only | | ## Workspace ### Health Liveness probe. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/health` | Own credential | Public liveness/readiness probe. | ### Integrations Email and other integrations. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/integrations` | `settings:read` | | | POST `/api/integrations` | `settings:write` | | | GET `/api/integrations/{id}` | `settings:read` | | | PUT `/api/integrations/{id}` | `settings:write` | | | DELETE `/api/integrations/{id}` | `settings:write` | | | POST `/api/integrations/{id}/test` | `settings:write` | | | POST `/api/integrations/{id}/test-email` | `settings:write` | Actually send a test message via this email integration, to confirm real delivery (beyond the connection test). | | GET `/api/integrations/options` | `records:read` | The integrations of one type that a record field's provider picker offers. | | GET `/api/integrations/plugins` | Own credential | | ### Notifications Notifications, preferences, routing rules, workspace policy, provider connections, linked accounts and the delivery log. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/notifications` | Signed-in session only | Recent notifications + unread count for the current user/workspace. | | POST `/api/notifications` | Signed-in session only | Mark one (id) or all (no id) notifications read. | | GET `/api/notifications/action-log` | `settings:read` | Every Approve / Reject press from a message, newest first (admins). | | GET `/api/notifications/connections` | `settings:read` | Slack, Teams and Twilio connections (admins). | | GET `/api/notifications/connections/{provider}` | `settings:read` | One connection (admins). | | PUT `/api/notifications/connections/{provider}` | `settings:write` | Create or update (admins). | | DELETE `/api/notifications/connections/{provider}` | `settings:write` | Disconnect (admins). | | POST `/api/notifications/connections/{provider}/test` | `settings:write` | A sanity call with the stored credentials (admins). | | GET `/api/notifications/deliveries` | `settings:read` | | | GET `/api/notifications/deliveries/{id}` | `settings:read` | One delivery: the rendered message, its log and button presses (admins). | | POST `/api/notifications/deliveries/{id}/retry` | `settings:write` | Put a dead (or failed) delivery back in the queue now (admins). | | GET `/api/notifications/identities` | `settings:read` | Every member and their linked account (admins). | | PUT `/api/notifications/identities` | `settings:write` | Link or unlink one member by hand (admins). | | POST `/api/notifications/identities/sync` | `settings:write` | Auto-link members by their account email (admins). | | GET `/api/notifications/prefs` | Signed-in session only | | | PUT `/api/notifications/prefs` | Signed-in session only | Save the caller's own prefs (self only). | | POST `/api/notifications/preview` | `settings:read` | Render a message the way the channel would send it, as YOU (your field access), for the template editor (admins). | | GET `/api/notifications/push-subscriptions` | Signed-in session only | The caller's own push devices in this workspace. | | POST `/api/notifications/push-subscriptions` | Signed-in session only | | | DELETE `/api/notifications/push-subscriptions/{id}` | Signed-in session only | Turn push off for one of the caller's own devices. | | POST `/api/notifications/push-subscriptions/test` | Signed-in session only | | | GET `/api/notifications/push/key` | Signed-in session only | The instance VAPID public key (applicationServerKey for pushManager.subscribe). | | GET `/api/notifications/rules` | `settings:read` | The workspace's shared routing rules. | | PUT `/api/notifications/rules` | `settings:write` | Replace the rule set (admins only). | | GET `/api/notifications/settings` | `settings:read` | | | PUT `/api/notifications/settings` | `settings:write` | Replace the policy (admins). | | GET `/api/notifications/stream` | Signed-in session only | | ### Secrets Secrets workflows and connectors use (values are never returned). | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/secrets` | `settings:read` | List secret key names (values never returned). | | POST `/api/secrets` | `settings:write` | Create/update a secret (admins only; CLI API keys count as admin). | | DELETE `/api/secrets/{key}` | `settings:write` | Remove a secret (admins only; CLI API keys count as admin). | ### Settings Workspace settings: time zone, embed domains, support email, webhook signing secret. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/settings/ai-resolver` | `settings:read` | | | PUT `/api/settings/ai-resolver` | `settings:write` | | | GET `/api/settings/embed-domains` | `settings:read` | | | PUT `/api/settings/embed-domains` | `settings:write` | | | GET `/api/settings/invites` | `settings:read` | Invite settings (admins; Settings › Members › Invite member). | | PUT `/api/settings/invites` | `settings:write` | | | GET `/api/settings/money-fields` | `settings:write` | | | POST `/api/settings/money-fields/apply` | `settings:write` | | | POST `/api/settings/money-fields/plan` | `settings:write` | | | GET `/api/settings/support-email` | `settings:read` | Support-email identity for ticket-conversation mail. | | PUT `/api/settings/support-email` | `settings:write` | | | GET `/api/settings/time-zone` | `settings:read` | | | PUT `/api/settings/time-zone` | `settings:write` | | | GET `/api/settings/verify` | `settings:read` | | | PUT `/api/settings/verify` | `settings:write` | | | GET `/api/settings/webhook` | `settings:write` | Reveal the current signing secret. | | POST `/api/settings/webhook` | `settings:write` | Rotate the signing secret. | ### Workspaces Subsidiaries and switching workspaces. | Method and path | API key needs | Does | | --- | --- | --- | | PATCH `/api/workspace/{id}/parent` | Signed-in session only | | | POST `/api/workspace/subsidiaries` | `settings:write` | Create a child workspace under the active one (admin only). | | POST `/api/workspace/switch` | Signed-in session only | Set the active workspace cookie (reachability-checked). | ## Channels and embeds ### Embed tokens Tokens for embeds. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/embed-tokens` | `settings:write` | Mint an embed token (admin only). | | PATCH `/api/embed-tokens/{id}` | `settings:write` | Edit a token (admin). | | DELETE `/api/embed-tokens/{id}` | `settings:write` | Revoke (delete) a token (admin). | ### Embeds Embedded forms, chat and actions on your own site. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/embed/chat` | Own credential | | | POST `/api/embed/chat` | Own credential | Start a chat. | | POST `/api/embed/chat/{id}/close` | Own credential | The visitor ends the chat. | | GET `/api/embed/chat/{id}/messages` | Own credential | The transcript so far (resume after a reload) + current state. | | POST `/api/embed/chat/{id}/messages` | Own credential | The visitor says something. | | GET `/api/embed/chat/{id}/stream` | Own credential | Server-Sent Events for one chat. | | GET `/api/embed/config` | Own credential | The browser SDK's discovery call. | | POST `/api/embed/ingest` | Own credential | Form-capture ingest. | | POST `/api/embed/records/{entityKey}` | Own credential | Create a record from an embedded form / captured submit. | | GET `/api/embed/verify` | Own credential | Poll a case's status/decision. | | POST `/api/embed/verify` | Own credential | | | POST `/api/embed/verify/token` | Own credential | | | POST `/api/embed/workflows/trigger` | Own credential | Fire a workflow from an embedded action button. | ### Inbound email Email intake. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/inbound/email` | Own credential | Generic inbound-email webhook. | | GET `/api/inbound/mailbox` | `settings:read` | The workspace's inbound address + enabled state. | | POST `/api/inbound/mailbox` | `settings:write` | Enable/disable email intake (admins). | ### Live chat The live-chat inbox and settings. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/chat/inbox` | Signed-in session only | Open chats (needing an answer first) + the last day's closed ones. | | GET `/api/chat/inbox/{id}` | Signed-in session only | | | POST `/api/chat/inbox/{id}/close` | Signed-in session only | End the chat from Ligament. | | POST `/api/chat/inbox/{id}/reply` | Signed-in session only | Answer from Ligament (claims the chat if unanswered). | | GET `/api/chat/inbox/stream` | Signed-in session only | | | GET `/api/chat/settings` | `settings:read` | | | PUT `/api/chat/settings` | `settings:write` | | | POST `/api/chat/settings/connect` | `settings:write` | Check the channel and register its inbound webhook (admin only). | | GET `/api/chat/settings/staff` | `settings:read` | The staff-name directory (admin only). | | PUT `/api/chat/settings/staff` | `settings:write` | | | POST `/api/chat/settings/test` | `settings:write` | Post a test message to the staff channel (admin only). | ### Notification callbacks Button presses from messages, Slack and Teams callbacks, push receipts and SMS status callbacks. Each verifies its own signature. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/notify/actions` | Own credential | An Approve / Reject press from an email (via its confirmation page) or a web-push notification. | | POST `/api/notify/push/receipt` | Own credential | The service worker showed a push notification. | | POST `/api/notify/slack/interactions` | Own credential | Receive an Approve or Reject press from a Slack notification. | | POST `/api/notify/teams/messages` | Own credential | The messaging endpoint of the Microsoft Teams bot (Bot Framework). | | POST `/api/notify/twilio/status/{id}` | Own credential | Twilio's StatusCallback for one message. | ### Portal The self-service portal. | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/portal` | `settings:read` | The workspace's portal config (any authed user). | | PUT `/api/portal` | `settings:write` | Save the portal config (admins). | | POST `/api/portal/confirm-resolution` | `records:write` | The requester's verdict on the AI Resolver's proposed fix, from the portal button. | | GET `/api/portal/search` | Signed-in session only | | | POST `/api/portal/survey` | Signed-in session only | Portal survey submission. | ### Provider webhooks Webhooks from third-party providers. | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/webhooks/attest` | Own credential | | | POST `/api/webhooks/didit` | Own credential | Public Didit webhook receiver. | | POST `/api/webhooks/stripe` | Own credential | | | POST `/api/webhooks/sumsub` | Own credential | Public Sumsub webhook receiver. | ## Other ### assets | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/assets/checkouts/{id}/ack-link` | `records:write` | | | POST `/api/assets/checkouts/{id}/acknowledge` | Signed-in session only | The signed-in recipient confirms they received the kit. | ### compliance | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/compliance/assignments/{id}/complete` | Signed-in session only | The signed-in assignee completes their OWN assignment. | | GET `/api/compliance/assignments/{id}/document` | Signed-in session only | | | POST `/api/compliance/assignments/{id}/external-link` | `records:write` | | | POST `/api/compliance/assignments/{id}/progress` | Signed-in session only | | | POST `/api/compliance/assignments/{id}/quiz` | Signed-in session only | The signed-in assignee's quiz. | | POST `/api/compliance/campaigns/{id}/launch` | `records:write` | Assign the campaign's obligation to its audience with its due date. | | POST `/api/compliance/channel` | Signed-in session only | Publish the public speak-up form (an App Site with the anonymous intake blocks) or take it down. | | POST `/api/compliance/completions/{id}/correct` | Signed-in session only | A correction: a new record pointing at the original (which never changes). | | POST `/api/compliance/completions/{id}/review` | Signed-in session only | A compliance admin verifies or rejects submitted evidence (an uploaded signed copy, a certificate) or countersigns it. | | POST `/api/compliance/exemptions/{id}/request` | `records:write` | Send a draft exemption for approval (Compliance admins). | | POST `/api/compliance/governance/{id}/evidence` | `records:write` | Use an attached file as the task's evidence (owner or admin). | | GET `/api/compliance/me` | `records:read` | The caller's own assignments (session or an API key acting as its owner, scope records:read:cmp\_assignment). | | GET `/api/compliance/obligations/{id}/preview` | `records:read` | Who this obligation assigns to today, why, and the next due dates. | | GET `/api/compliance/pack` | `records:read` | | | POST `/api/compliance/sync` | `records:write` | | | GET `/api/compliance/templates` | `records:read` | The catalog and what's installed. | | POST `/api/compliance/templates` | `records:write` | | | POST `/api/compliance/versions/{id}/publish` | `records:write` | Publish an approved document version (the document's owner or a Compliance admin). | | POST `/api/compliance/versions/{id}/submit` | `records:write` | Submit a draft document version for approval (the document's owner or a Compliance admin). | ### demo | Method and path | API key needs | Does | | --- | --- | --- | | GET `/api/demo` | Signed-in session only | | | POST `/api/demo/load` | Signed-in session only | | | POST `/api/demo/remove` | Signed-in session only | | ### onboard | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/onboard/{action}` | Own credential | The new hire's portal (guest session cookie; the request never names a journey: the session does). | | POST `/api/onboard/upload` | Own credential | | ### onboarding | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/onboarding/journeys/{id}/{action}` | Signed-in session only | The back office's journey actions. | | GET `/api/onboarding/payroll-csv` | Signed-in session only | Payroll's bank-details CSV. | ### x | Method and path | API key needs | Does | | --- | --- | --- | | POST `/api/x/asset-ack/{token}` | Own credential | Someone without a login confirms they received their kit through the link IT sent them. | | POST `/api/x/esign/{token}` | Own credential | Someone signs through the link we emailed them. | | GET `/api/x/esign/{token}/document/{docId}` | Own credential | A document to sign; needs the link's signing session (x-esign-session). | | POST `/api/x/onboard/{token}` | Own credential | | | POST `/api/x/sign/{token}` | Own credential | An external signer signs through their link. | | GET `/api/x/sign/{token}/document` | Own credential | The document to read, for a valid (unused, unexpired) external signing link. | --- # API key scopes > Every scope an API key can hold, the admin scopes, and the areas no key can reach. Generated from the code. Source: https://docs.ligament.ai/reference/scopes/ How to choose scopes and create keys: [API keys and scopes](https://docs.ligament.ai/developers/api-keys/index.md). ## Scopes A key created without scopes gets `*`: every scope in this first table. Scopes for one entity add the entity key: `records:read:incident`. | Scope | Allows | | --- | --- | | `records:read` | Read records of any entity (or one entity: records:read:), exports, search, attachments, reports. | | `records:write` | Create, update, transition, merge and delete records (or one entity: records:write:). | | `schema:read` | Read entity definitions: fields, forms, views, lifecycle, rules. | | `schema:write` | Change the data model: entities, fields, forms, views, lifecycle, rules. | | `apps:read` | Read apps, build-studio drafts, plugins, connectors, scripts, widgets, pages, dashboards, reports, templates, prompts, skills, endpoints. | | `apps:write` | Build and publish apps and their parts (plugins, connectors, scripts, widgets, pages, prompts, skills, endpoints, AI agents, RAG collections). Installing apps into the workspace needs apps:install. | | `workflows:read` | Read workflow definitions, automations and runs. | | `workflows:write` | Create, change and delete workflows and automations. | | `workflows:run` | Start, cancel and replay workflow runs. | | `spec:read` | Read the app spec: artefacts (pages, access rules, …), their history, JSON Schemas and the catalog; plan changes. | | `spec:propose` | Propose changes: create and edit changesets for a person to review. Never applies anything. | | `spec:apply` | Apply spec changes (POST /api/spec/apply, changeset apply), capped by the key creator's build permissions. Key-made access and code changes still wait for a person unless the workspace allows them. | | `endpoints:invoke` | Call deployed endpoints, API-key webhooks and the MCP server. | | `ai:use` | Use the AI models and agents, and the local agent runner (ligament agent start). | | `import:write` | Run data imports (stage, map, promote, discard). | | `audit:read` | Read and export the audit logs. | | `esign:read` | Read e-signature envelopes the key's creator may see (status, recipients, audit trail) and download sealed PDFs. | | `esign:write` | Create, send, remind and void e-signature envelopes. Never signs: signing is done by each recipient in person. | | `settings:read` | Read workspace settings: members, roles, ACLs, invites, secrets metadata, integrations, domains, portal, notifications rules, SCIM tokens. Never the credentials among them (webhook signing secret, invite and domain verification tokens, integration config): those need the matching admin scope. | ## Admin scopes `*` never includes these. A key gets one only when it names it, and only an owner or admin can create such a key. | Scope | Allows | | --- | --- | | `settings:write` | Change workspace settings: secrets, integrations, webhooks, embed tokens, portal, AI and notification settings, subsidiaries. | | `members:write` | Change who is in the workspace and what they can do: members, invites, roles, ACLs. | | `sso:write` | Change identity provisioning: SCIM tokens and claimed email domains (SSO providers are session-only). | | `apps:install` | Install, upgrade, uninstall and delete apps, modules and plugins in this workspace. | | `approvals:decide` | List and decide approvals. | | `components:approve` | Approve custom component versions and grant them data scopes. The key's creator must also hold the "Approve custom components" role permission (owners do; owners can grant it to a role). | ## Areas no API key can reach These need a signed-in person in the browser, whatever scopes a key holds. - API keys - SSO providers - Security policy - OIDC clients - Workspace hierarchy --- # MCP tools > Every tool and resource the MCP server offers, with its arguments and the scope it needs. Generated from the code. Source: https://docs.ligament.ai/reference/mcp-tools/ The server is at `https://app.ligament.ai/api/mcp`. A key sees only the tools its scopes allow. Setup and examples: [MCP server](https://docs.ligament.ai/developers/mcp/index.md). ## Record tools ### `records_query` Scope: `records:read:` List records of an entity: filters (\[{field, op, value|values}\], ops eq ne contains empty not\_empty in lt lte gt gte), match all|any, sort ("-salary,name"), q (search), limit (≤ 200), offset. With asOf, effective-dated fields are as of that date and each row has \_effective (versions shown, which fields are current). | Argument | Type | Description | | --- | --- | --- | | `entity` required | `string` | Entity key, e.g. person | | `filters` | `object[]` | | | `match` | `"all" | "any"` | | | `sort` | `string` | | | `q` | `string` | | | `limit` | `number` | | | `offset` | `number` | | | `asOf` | `string` | Effective dating: a date YYYY-MM-DD (00:00 in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Dated fields show their value on that date; other fields show today's; access is decided now. Records not started on that date are absent. | | `knownAt` | `string` | As recorded at this instant (bitemporal: before later corrections). Needs records.as\_recorded or an audit:read key. | ### `records_get` Scope: `records:read:` One record by id. With asOf: as of that date (404 effective\_not\_started when it didn't exist yet), with \_effective. | Argument | Type | Description | | --- | --- | --- | | `entity` required | `string` | Entity key, e.g. person | | `id` required | `string` | | | `asOf` | `string` | Effective dating: a date YYYY-MM-DD (00:00 in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Dated fields show their value on that date; other fields show today's; access is decided now. Records not started on that date are absent. | | `knownAt` | `string` | As recorded at this instant (bitemporal: before later corrections). Needs records.as\_recorded or an audit:read key. | ### `records_history` Scope: `records:read:` An effective-dated record's history: versions per group (e.g. comp, job), newest first, with from/to, kind, reason, who, when recorded, status (scheduled, in\_force, past, superseded). include \["corrections"\] adds superseded versions (records.as\_recorded). | Argument | Type | Description | | --- | --- | --- | | `entity` required | `string` | Entity key, e.g. person | | `id` required | `string` | | | `group` | `string` | | | `include` | `"corrections" | "proposed"[]` | | | `knownAt` | `string` | As recorded at this instant (bitemporal: before later corrections). Needs records.as\_recorded or an audit:read key. | ### `records_changes` Scope: `records:read:` The changes feed for exports (payroll-style): changes RECORDED since recordedSince (an instant: your last watermark), new, corrected or rescinded, with the periods whose values changed and the values after (and before, for records.as\_recorded). Filter by group, effectiveFrom/effectiveTo, overlapsBefore (periods you already exported). Pass nextCursor to page; keep watermark. | Argument | Type | Description | | --- | --- | --- | | `entity` required | `string` | Entity key, e.g. person | | `recordedSince` required | `string` | | | `recordedUntil` | `string` | | | `group` | `string[]` | | | `effectiveFrom` | `string` | | | `effectiveTo` | `string` | | | `overlapsBefore` | `string` | | | `cursor` | `string` | | | `limit` | `number` | | ### `records_change` Scope: `records:write:` Change a record. On an effective-dated entity pass effective: { from: "2027-03-01", reason: "merit", mode: "change" | "correction" | "rescind", version?, group? }: a change from a date (future = scheduled), a correction of the version in force on from (or with version + from, re-timing it), or a rescind of a version. Without effective, dated values change from today. Returns the record (today's values) and effective (versions written, warnings about later changes it rewrote). | Argument | Type | Description | | --- | --- | --- | | `entity` required | `string` | Entity key, e.g. person | | `id` required | `string` | | | `values` | `object` | | | `effective` | `object` | | ## Access tools ### `access_whoami` Scope: `records:read` Who this key acts as here: user id, role (capped at the key creator's role), key scopes, and how access is decided (evaluator: v2 = roles, permission sets and restrictions decide; shadow = the previous access rules decide while the current ones are compared). ### `access_explain` Scope: `records:read` Why a principal may or may not do an action on an entity or one record: allow, reason (granted, no\_grant, forbidden, row\_mismatch, field\_level, app\_access, key\_scope), the fix, the row predicate in words, field levels, and the trace of rules that decided it. A record outside the scope is never described. | Argument | Type | Description | | --- | --- | --- | | `entity` required | `string` | Entity key, e.g. incident | | `action` | `"read" | "create" | "update" | "delete" | "transition"` | default read | | `recordId` | `string` | | | `fields` | `string[]` | | | `principal` | `string | object` | Whom to explain: "self" (default), {"user": ""} or {"role": ""}. Others need an admin key. | ### `access_effective` Scope: `records:read` What a principal can do: per entity, each action (read, create, update, delete, transition) allowed or not with the reason and the rows in words, plus every field's level (hidden, read, write). Omit entity for all entities. | Argument | Type | Description | | --- | --- | --- | | `entity` | `string` | Entity key, e.g. incident | | `principal` | `string | object` | Whom to explain: "self" (default), {"user": ""} or {"role": ""}. Others need an admin key. | ### `access_plan` Scope: `spec:read` Dry-run changes to access artefacts (role/, permissionSet/, restriction/, groupMapping/, hierarchy/, share/) without writing: the spec plan (per item action, changes, errors, permission, whether a person must apply it) plus accessDiff, the effective-access diff: per affected role and member, per entity, action and field, what is gained, lost or changed, in words, with live row counts before → after. Apply with spec\_apply or a changeset. The key's creator needs the Build capability, or must be an app admin planning their own app's permission sets, roles and restrictions. | Argument | Type | Description | | --- | --- | --- | | `items` required | `object[]` | | ## Spec tools ### `spec_catalog` Scope: `spec:read` The catalog for writing valid spec docs: artefact types (with the build permission each needs), entities with their fields, roles, approved components and the page block registry. ### `spec_list` Scope: `spec:read` List the artefacts in the spec store (effective layer): address, type, key, app, layer, hash, customised, conflict count. | Argument | Type | Description | | --- | --- | --- | | `type` | `"page" | "acl" | "role" | "permissionSet" | "restriction" | "groupMapping" | "hierarchy" | "share"` | | | `app` | `string` | App key, or \_\_tenant\_\_ for workspace-owned artefacts | ### `spec_get` Scope: `spec:read` Read one artefact: { address, layer, doc, hash, version, customised, base, conflicts }. doc is exactly what spec\_apply takes: applying it with baseHash = hash is a noop. | Argument | Type | Description | | --- | --- | --- | | `address` required | `string` | Artefact address: // (as spec\_list / spec\_get return it) or /. Types: page, acl, role, permissionSet, restriction, groupMapping, hierarchy, share | | `layer` | `"effective" | "base" | "custom" | "source"` | default effective | | `version` | `integer` | a past version (spec\_history) | ### `spec_schema` Scope: `spec:read` The JSON Schema of one artefact type (also served as resource ligament://spec/schema/). | Argument | Type | Description | | --- | --- | --- | | `type` required | `"page" | "acl" | "role" | "permissionSet" | "restriction" | "groupMapping" | "hierarchy" | "share"` | | ### `spec_validate` Scope: `spec:read` Validate docs against the workspace (no state, no permissions): { ok, errors\[\], warnings\[\] } with { address, code, path, message, fix }. | Argument | Type | Description | | --- | --- | --- | | `items` required | `object[]` | | ### `spec_plan` Scope: `spec:read` Plan changes without writing: per item the action, the layer it writes, per-path changes, the merge with changes made since baseHash (none / clean / conflict with base, yours, current), the permission it needs and whether you hold it, and whether a person must apply it. | Argument | Type | Description | | --- | --- | --- | | `items` required | `object[]` | | ### `spec_history` Scope: `spec:read` Version history of one artefact, newest first: version, action, layer, hash, changes, changeset, who and when. | Argument | Type | Description | | --- | --- | --- | | `address` required | `string` | Artefact address: // (as spec\_list / spec\_get return it) or /. Types: page, acl, role, permissionSet, restriction, groupMapping, hierarchy, share | ### `spec_apply` Scope: `spec:apply` Apply changes all-or-nothing. Every item needs baseHash (null = new). Returns { versions } (empty = noop). Errors: spec.conflict (conflicts: base/yours/current), spec.merge\_available (merged docs to re-apply), spec.changed, spec.invalid, spec.permission. When the workspace requires a person to apply it (access/code changes made with a key), nothing is applied and the result says proposed: true with the changeset waiting for review. | Argument | Type | Description | | --- | --- | --- | | `items` required | `object[]` | | | `onConflict` | `"reject" | "merge"` | reject (default): a clean merge with changes made since comes back as a spec.merge\_available error holding the merged doc; merge: apply clean merges directly. Real conflicts are always refused. | | `title` | `string` | Changeset title used if the change has to wait for a person | ## Changeset tools ### `changeset_list` Scope: `spec:read` Changesets, newest first: id, title, status, item count, addresses, who proposed it. | Argument | Type | Description | | --- | --- | --- | | `status` | `"open" | "ready" | "applied" | "discarded"[]` | | ### `changeset_get` Scope: `spec:read` One changeset with its items (address, baseHash, doc | delete) and activity. | Argument | Type | Description | | --- | --- | --- | | `id` required | `string` | Changeset id (changeset\_list / changeset\_create) | ### `changeset_create` Scope: `spec:propose` Propose a change for a person to review (never applies anything). Items are optional; an item without baseHash starts from the current doc. ready: true marks it ready for review. | Argument | Type | Description | | --- | --- | --- | | `title` required | `string` | | | `note` | `string` | | | `items` | `object[]` | | | `ready` | `boolean` | | ### `changeset_put_items` Scope: `spec:propose` Add or replace items of an open changeset (one per artefact). | Argument | Type | Description | | --- | --- | --- | | `id` required | `string` | Changeset id (changeset\_list / changeset\_create) | | `items` required | `object[]` | | ### `changeset_plan` Scope: `spec:read` The plan of every item of a changeset against current (same shape as spec\_plan). | Argument | Type | Description | | --- | --- | --- | | `id` required | `string` | Changeset id (changeset\_list / changeset\_create) | ### `changeset_apply` Scope: `spec:apply` Apply every item of a changeset all-or-nothing (same errors as spec\_apply). When the workspace requires a person to apply it, nothing is applied and the result says so with the changeset link. | Argument | Type | Description | | --- | --- | --- | | `id` required | `string` | Changeset id (changeset\_list / changeset\_create) | | `onConflict` | `"reject" | "merge"` | reject (default): a clean merge with changes made since comes back as a spec.merge\_available error holding the merged doc; merge: apply clean merges directly. Real conflicts are always refused. | ### `changeset_discard` Scope: `spec:propose` Discard a changeset (kept, with its activity, as discarded). | Argument | Type | Description | | --- | --- | --- | | `id` required | `string` | Changeset id (changeset\_list / changeset\_create) | ## Invite tools ### `invites_list` Scope: `members:write` List this workspace's invites: email invites and domain/open links that are pending (expired ones included), with state (pending, expired, used\_up, accepted, revoked), expiresAt and expiresInDays. history: true adds the invites accepted or revoked in the last 30 days. Admins only. | Argument | Type | Description | | --- | --- | --- | | `history` | `boolean` | also list invites accepted or revoked in the last 30 days | ### `invites_resend` Scope: `members:write` Resend an email invite that is pending or expired: issues a new link (the old link stops working), restarts the expiry (the workspace's invite expiry, default 14 days) and emails the invite again. Returns the invite, the new link and whether the email was sent. Links (domain/open) can't be resent: create a new one. Admins only. | Argument | Type | Description | | --- | --- | --- | | `id` required | `string` | invite id (invites\_list) | ## Exchange-rate tools ### `fx_convert` Scope: `records:read` Convert a money amount to another currency with the exchange rate in force on a date (the direct pair, else the inverse pair). Send the amount as a decimal string, e.g. { amount: { amount: "1250.00", currency: "USD" }, to: "EUR", asOf: "2026-01-31" }. Returns { amount, currency, from, rate, rateDate (the date the rate took effect), source, inverse? }, the amount rounded half-even to the currency's minor units. Error code fx\_rate\_missing when no rate exists for the pair on that date. | Argument | Type | Description | | --- | --- | --- | | `amount` required | `object` | | | `to` required | `string` | target ISO 4217 code | | `asOf` | `string` | The date whose rate applies: YYYY-MM-DD (in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Default: today. | ### `fx_rates` Scope: `records:read` The exchange rates in force on a date (default today): \[{ base, quote, rate, rateDate, source }\], 1 base = rate quote. rateDate is the date each rate took effect. | Argument | Type | Description | | --- | --- | --- | | `asOf` | `string` | The date whose rate applies: YYYY-MM-DD (in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Default: today. | ## E-signature tools ### `esign_status` Scope: `esign:read` An envelope: status, recipients (who signed when), documents, the seal (certificate id, key id, timestamp). | Argument | Type | Description | | --- | --- | --- | | `envelopeId` required | `string` | | ### `esign_sealed_pdf` Scope: `esign:read` Where to download the sealed PDF of a completed envelope (GET with the same key), its sha256 and its Verify page. | Argument | Type | Description | | --- | --- | --- | | `envelopeId` required | `string` | | ### `esign_create_envelope` Scope: `esign:write` Create an e-signature envelope on a record and send it (send: false keeps a draft). Documents are PDFs attached to that record (attachmentId) or a template key. People sign themselves: members in the app, others through an emailed link + one-time code. Returns the envelope. | Argument | Type | Description | | --- | --- | --- | | `subject` required | `object` | | | `title` | `string` | | | `message` | `string` | | | `template` | `string` | | | `documents` | `object[]` | | | `recipients` required | `object[]` | | | `fields` | `object[]` | { recipient (index or email), document?, kind, page, x, y, w, h, required?, label? } in PDF points. | | `signingOrder` | `"parallel" | "sequential"` | | | `expiresInDays` | `integer` | | | `reminderEveryDays` | `integer` | | | `send` | `boolean` | | | `idempotencyKey` | `string` | | ### `esign_send` Scope: `esign:write` Send a draft envelope (invites the first signers). | Argument | Type | Description | | --- | --- | --- | | `envelopeId` required | `string` | | ### `esign_void` Scope: `esign:write` Void (withdraw) an envelope that is not finished. The reason is shown to the signers. | Argument | Type | Description | | --- | --- | --- | | `envelopeId` required | `string` | | | `reason` required | `string` | | ### `esign_remind` Scope: `esign:write` Remind the signers whose turn it is (or one recipient) with a fresh link. | Argument | Type | Description | | --- | --- | --- | | `envelopeId` required | `string` | | | `recipientId` | `string` | | ## App Store tools ### `store_updates` Scope: `apps:read` Installed apps with a newer version available in this workspace: key, name, from, to, bump (patch/minor/major). ### `store_install_plan` Scope: `apps:read` What installing an app does here, in order (deepest dependency first, the app last), with versions and plan prices, the dependencies already installed and the paid ones that need explicit acceptance. Changes nothing. | Argument | Type | Description | | --- | --- | --- | | `appKey` required | `string` | | | `planKey` | `string` | | | `version` | `string` | | ### `store_install_status` Scope: `apps:read` One install run: each step (app, version, plan, status, error), what is installed and the failed step. | Argument | Type | Description | | --- | --- | --- | | `runId` required | `string` | | ### `store_install` Scope: `apps:install` Install an app. dependencies: "fail" (default) refuses when other apps must be installed first and returns the plan; "install" installs them first, in order, one at a time. A dependency with no free plan needs acceptPaid: \[""\] (nothing is bought otherwise). A failure stops the run: resume it with store\_install\_resume. | Argument | Type | Description | | --- | --- | --- | | `appKey` required | `string` | | | `planKey` | `string` | | | `version` | `string` | | | `dependencies` | `"install" | "fail"` | | | `acceptPaid` | `string[]` | | ### `store_install_resume` Scope: `apps:install` Retry a failed install run from the step that failed; what is installed stays and is not redone. | Argument | Type | Description | | --- | --- | --- | | `runId` required | `string` | | ### `store_upgrade` Scope: `apps:install` Upgrade installed apps, dependencies first. appKeys (or all: true). dryRun: true previews each app's changes (entities/fields added, removed, changed) and what would be blocked. A destructive change blocks that app unless its key is in confirm. Access-widening changes are held. | Argument | Type | Description | | --- | --- | --- | | `appKeys` | `string[]` | | | `all` | `boolean` | | | `dryRun` | `boolean` | | | `confirm` | `string[]` | | ### `store_uninstall` Scope: `apps:install` Uninstall an app (its records stay). Refused while other installed apps depend on it: the error names them. preview: true returns who loses which access, changing nothing. | Argument | Type | Description | | --- | --- | --- | | `appKey` required | `string` | | | `preview` | `boolean` | | ### `store_auto_patch` Scope: `settings:write` The owner setting "auto-apply patch updates" (default off): on applies x.y.Z updates that are not destructive and widen no access, once a day. Omit \`on\` to read it. Changing it needs the workspace owner's key. | Argument | Type | Description | | --- | --- | --- | | `on` | `boolean` | | ## Your workspace's own tools | Tool name | Scope | Description | | --- | --- | --- | | `connector____` | `endpoints:invoke` | One tool per operation of each connector the workspace has marked as exposed. Inputs are the operation's template variables. | | `script__