Preset operations

7 operations named preset.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.

Updated
OperationWhat it doesPermissionConfirmation
preset.listList the presets the site can insert, theme presets first, then the site library; each with its tree.site.readnone
preset.insertInsert a fresh copy of a theme or site preset (section, group or element) into a page or a region.site.editnone
preset.saveSave a page node and its subtree into the site preset library, with fresh ids; refuses bindings the copy cannot keep.site.editnone
preset.renameRename a preset of the site library.site.editnone
preset.deleteDelete a preset from the site library; pages that inserted it keep their copies.site.editdestructive
preset.indexList the presets the site can insert, theme presets first, then the site library, without their trees: each with its source, id, kind, label, keywords, category and description.site.readnone
preset.readRead one preset with its tree, named as preset.insert names it (kind, presetId, and source, the theme's presets when absent).site.readnone

preset.list

List the presets the site can insert, theme presets first, then the site library; each with its tree.

permission: site.readreads onlyclass: read

Example input

{
  "kind": "section"
}

Input

FieldTypeRequiredNotes
kindstringnoOne of "section", "box", "element".
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes

Try it

yarn splash preset.list '{"kind":"section"}' --dry-run

preset.insert

Insert a fresh copy of a theme or site preset (section, group or element) into a page or a region. A section preset goes under a tree's root: in a region (header or footer), parentId is the region root, the root id region.read answers, never a section inside the region, which is refused as I5.section_placement. An element or box preset asked for under the root is wrapped in a new section (the answer's nodeId is the section); elsewhere it goes where asked. The batch is atomic, so one refused insert fails the whole batch.

permission: site.editwrites: tree:{pageId}class: transactionundo: yes

Example input

{
  "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
  "parentId": "root0000",
  "index": 0,
  "kind": "section",
  "presetId": "hero-split",
  "source": "theme"
}

Input

FieldTypeRequiredNotes
pageIdstringyesAt least 1 character.
parentIdstringyes
indexintegeryesAt least 0.
kindstringyesOne of "section", "box", "element".
presetIdstringyesAt least 1 character.
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes
revisionintegeryesAt least 0.
inversearray of object | object | object | object | object | object | object | object | object | object | object | object | objectyes
nodeIdstringyes

Try it

yarn splash preset.insert '{"pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","parentId":"root0000","index":0,"kind":"section","presetId":"hero-split","source":"theme"}' --dry-run

preset.save

Save a page node and its subtree into the site preset library, with fresh ids; refuses bindings the copy cannot keep.

permission: site.editwrites: presetsclass: transactionundo: yes

Example input

{
  "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
  "nodeId": "claim001",
  "label": "Claim band",
  "kind": "element",
  "category": "bands"
}

Input

FieldTypeRequiredNotes
pageIdstringyesAt least 1 character.
nodeIdstringyes
labelstringyesAt least 1 character. At most 80 characters.
idstringno
kindstringnoOne of "section", "box", "element".
categorystringno
descriptionstringnoAt most 280 characters.

Output

FieldTypeRequiredNotes
sourcestringyesOne of "theme", "site".
idstringyes
kindstringyesOne of "section", "box", "element".
labelstringyesAt least 1 character. At most 80 characters.
keywordsarray of stringnoAt least 1 item. At most 16 items.
categorystringyes
descriptionstringnoAt most 280 characters.
thumbnailstringno
scenesarray of objectnoAt most 20 items.
scenes[].triggerobject | object | object | object | object | objectyes
scenes[].entriesarray of objectyesAt most 100 items.
scenes[].conditionsobjectno
scenes[].actionsarray of object | objectnoAt most 20 items.
scenes[].seedintegernoAt least 0. At most 4294967295.
scenes[].pushByobjectno
scenes[].recipeobjectno
scenes[].disabledbooleanno
scenes[].defaultsobjectno
treeobject | object | object | object | object | object | objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Try it

yarn splash preset.save '{"pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","nodeId":"claim001","label":"Claim band","kind":"element","category":"bands"}' --dry-run

preset.rename

Rename a preset of the site library.

permission: site.editwrites: presetsclass: transactionundo: yes

Example input

{
  "presetId": "claim-band",
  "label": "Claim band, dark"
}

Input

FieldTypeRequiredNotes
presetIdstringyes
labelstringyesAt least 1 character. At most 80 characters.

Output

FieldTypeRequiredNotes
sourcestringyesOne of "theme", "site".
idstringyes
kindstringyesOne of "section", "box", "element".
labelstringyesAt least 1 character. At most 80 characters.
keywordsarray of stringnoAt least 1 item. At most 16 items.
categorystringyes
descriptionstringnoAt most 280 characters.
thumbnailstringno
scenesarray of objectnoAt most 20 items.
scenes[].triggerobject | object | object | object | object | objectyes
scenes[].entriesarray of objectyesAt most 100 items.
scenes[].conditionsobjectno
scenes[].actionsarray of object | objectnoAt most 20 items.
scenes[].seedintegernoAt least 0. At most 4294967295.
scenes[].pushByobjectno
scenes[].recipeobjectno
scenes[].disabledbooleanno
scenes[].defaultsobjectno
treeobject | object | object | object | object | object | objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Try it

yarn splash preset.rename '{"presetId":"claim-band","label":"Claim band, dark"}' --dry-run

preset.delete

Delete a preset from the site library; pages that inserted it keep their copies.

permission: site.editwrites: presetsclass: transactionconfirm: destructiveundo: yes

Example input

{
  "presetId": "claim-band"
}

Input

FieldTypeRequiredNotes
presetIdstringyes

Output

FieldTypeRequiredNotes
successtrueyes

Needs confirmed: ["destructive"] on the batch, which the single-operation CLI form does not set: put it in a batch file and run yarn splash apply <file> --dry-run.

preset.index

List the presets the site can insert, theme presets first, then the site library, without their trees: each with its source, id, kind, label, keywords, category and description. Read one preset's tree with preset.read; insert one with preset.insert.

permission: site.readreads onlyclass: read

Example input

{
  "kind": "section"
}

Input

FieldTypeRequiredNotes
kindstringnoOne of "section", "box", "element".
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes

Try it

yarn splash preset.index '{"kind":"section"}' --dry-run

preset.read

Read one preset with its tree, named as preset.insert names it (kind, presetId, and source, the theme's presets when absent). Refused with 404 preset_not_found when the site has no such preset.

permission: site.readreads onlyclass: read

Example input

{
  "kind": "section",
  "presetId": "hero-split",
  "source": "theme"
}

Input

FieldTypeRequiredNotes
kindstringyesOne of "section", "box", "element".
presetIdstringyesAt least 1 character.
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes
sourcestringyesOne of "theme", "site".
idstringyes
kindstringyesOne of "section", "box", "element".
labelstringyesAt least 1 character. At most 80 characters.
keywordsarray of stringnoAt least 1 item. At most 16 items.
categorystringyes
descriptionstringnoAt most 280 characters.
thumbnailstringno
scenesarray of objectnoAt most 20 items.
scenes[].triggerobject | object | object | object | object | objectyes
scenes[].entriesarray of objectyesAt most 100 items.
scenes[].conditionsobjectno
scenes[].actionsarray of object | objectnoAt most 20 items.
scenes[].seedintegernoAt least 0. At most 4294967295.
scenes[].pushByobjectno
scenes[].recipeobjectno
scenes[].disabledbooleanno
scenes[].defaultsobjectno
treeobject | object | object | object | object | object | objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Try it

yarn splash preset.read '{"kind":"section","presetId":"hero-split","source":"theme"}' --dry-run

Generated from the operation registry and the MCP tool catalogue (source 7f6b25496ba8c140).

Something wrong on this page? Write to docs@librettocms.com.

Libretto docs

Colophon. These docs are a Libretto site: 68 pages in two languages, 20 guide pages imported from Markdown and 41 reference pages generated from the operation registry. Set in Softcore, with code in IBM Plex Mono. Its outline:

/ Libretto docs /start Get started /start/request-access Request access /start/workspace Your workspace /start/first-site Your first site /start/invite-a-client Invite a client /start/connect-claude Connect Claude to Libretto /build Build /build/first-page Build a page /build/layers-and-canvas Layers and canvas /build/site-components Site components /design-system Design system /design-system/tokens Colours, space and themes /design-system/components Components and variants /design-system/fonts Typography and fonts /motion Motion /motion/scenes Scenes and recipes /motion/image-sequences Image sequences /motion/reduced-motion Reduced motion /publish Publish /publish/languages Site languages /publish/versions Publish and versions /publish/members-and-forms Members and forms /publish/domains Domains /handover Hand a site to a client /glossary Glossary /agents Agents and API /agents/mcp MCP server /agents/cli CLI /agents/batches Batches /agents/errors Errors and findings /agents/operations Operations /search Search