Throttle Builder

MCP tool reference

The Builder gives an AI agent 66 tools. This page lists every one, grouped by what it is for: the access level it needs, each input, what it answers and the errors it can return. How to connect an agent is on Connect and AI agents.

How the tools work

  • An agent sees only the tools its access level allows. A tool it is not allowed is not listed at all.
  • Every change goes to a draft. Nothing reaches the store until a tool that publishes is called, and only a Publish or Full key has those.
  • Answers are JSON text. A refusal comes back with isError set and an error object holding a code and a message, and sometimes more (for example issues).
  • Every change in a draft is recorded in the page history and can be undone with undo_change.
  • Catalog data (products, collections, categories) is read only here. An agent cannot change it.

Rules that apply to every tool

baseRev: do not overwrite someone else's edit

Reading a page or the site answers a draftRev. Send it back as baseRev on the next write. If the draft changed in between (you or another agent edited it), the write is refused with DRAFT_CONFLICT, nothing is saved, and the agent reads the page again. Leaving baseRev out writes on top of the current draft, except for update_menu and restore_site_settings_version, which always need it. Publishing always needs it too.

Idempotency keys

Most writes take an optional idempotencyKey (1 to 128 characters). Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Keys belong to one key and one tool, so two keys that pick the same text do not collide. Use a new key for each different change. Tools that insert something also need an index when you send a key, otherwise INDEX_REQUIRED.

Rate limits

Each key or connected assistant may make 120 tool calls a minute, and 60 writes a minute (a write also counts as a call). Over the limit the answer is 429 RATE_LIMITED with Retry-After: 60. A write that cannot be counted is not made.

Errors every tool can return

CodeWhat it means
PERMISSION_REQUIREDThe key or connection has too low a level (or lacks a scope) for the tool. The answer names what is missing in required (level:publish, level:full, draft). Tell the user; do not retry. A tool the level does not allow is not even listed.
RATE_LIMITEDMore than 120 tool calls, or 60 writes, in a minute on one key or connection (HTTP 429 with Retry-After: 60). A write also spends a call.
RATE_LIMITER_UNAVAILABLEThe call counter is down (HTTP 503). A write that cannot be counted is not made. Try again shortly.
INFRASTRUCTURE_UNAVAILABLEThe store data could not be reached. Try again shortly.

Input that does not match a tool's schema is refused before the tool runs. Fixes for the errors you meet most are on Troubleshooting.

What each level can call

LevelTools it gets
Read18 tools at exactly this level
Draft38 tools at exactly this level
Publish6 tools at exactly this level
Full4 tools at exactly this level

Each level also has every tool of the levels below it. A key made before access levels (shown as Custom) keeps the scopes it had, and the tools marked "Needs Allow publishing" below need that switch on as well.

Tools by area

Site settings and menus

Read and change the settings that apply to the whole store, and publish them.

get_site

Read the store's site settings (theme, brand, menus, announcement, seo, strings, routes, locales, storeUrl), its locales and which widget packs are enabled. Draft by default. The connections section answers { credentialSet, fingerprint } (whether a Throttle key is set, and the first 8 hex characters of the SHA-256 of that key, null when none is set), never the key. The routes section is read-only for an agent: a person sets it in the Builder.

  • Needs: Read access or above. Scopes: site:read.
  • Kind: reads only.
  • Answers: { source, settings, draftRev (or publishedVersion), hasUnpublishedChanges, locales, packs, catalogLinked }. settings is the draft by default or the published copy with source: "published". The Throttle publishable key under connections is never shown, only whether one is set. packs lists the component and data source ids per pack.
InputRequiredTypeDetails
sourceNoenumWhich copy of the settings. Defaults to 'draft'. One of: draft, published
ErrorWhen
NOT_PUBLISHEDYou asked for the published copy and it was never published. Read the draft instead.

update_site_settings

Change one or more site sections (theme, brand, menus, announcement, seo, strings, locales, storeUrl) in the draft. Each section you send replaces the whole section. Design lives in theme: preset ('clean', 'editorial', 'bold'); customized (true so your palettes apply instead of the preset's); light and dark palettes (14 colour tokens each: colorPrimary, colorPrimaryForeground, colorBackground, colorSurface, colorForeground, colorMuted, colorMutedForeground, colorBorder, colorBorderControl, colorAccent, colorSale, colorSuccess, colorWarning, colorDanger); fonts.heading, fonts.body and fonts.mono, each one of: Instrument Serif, Playfair Display, Lora, Merriweather, Cormorant Garamond, EB Garamond, Libre Baskerville, Source Serif 4, Fraunces, DM Serif Display, Inter, Schibsted Grotesk, DM Sans, Manrope, Poppins, Montserrat, Work Sans, Rubik, Nunito Sans, Open Sans, Lato, Raleway, Outfit, Plus Jakarta Sans, Figtree, Karla, DM Mono, JetBrains Mono, IBM Plex Mono, Space Mono, Bebas Neue, Oswald, Archivo Black, Space Grotesk, Syne, system-sans, system-serif, system-mono; radius (0 to 32 px); spacingScale ('compact', 'comfortable', 'roomy'); colorScheme ('light', 'dark', 'auto'); customCss (checked by the CSS sanitizer and scoped to the store's pages). Per-section layout, spacing and backgrounds are node settings (update_node). A bad value saves nothing and answers the issues. Nothing goes live until the site is published with publish.

  • Needs: Draft access or above. Scopes: site:write.
  • Kind: writes.
  • Answers: { draftRev, issues: [] }. The patch is merged into the settings draft; nothing is live until it is published.
InputRequiredTypeDetails
patchYesobjectTop-level sections to replace: theme, brand, menus, announcement, seo, strings, locales, storeUrl. Each key you send replaces that whole section, so send the whole section (read it with get_site first).
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe patched settings are not valid (answer carries issues). Nothing was saved. Sections an agent may not edit (connections, routes) are refused.

publish_site_settings

Publish the site settings draft on its own (theme, brand, menus, header and footer, announcement, SEO, strings), so it goes live. baseRev (the site settings draftRev you checked) is required, so nothing you have not checked is published. Answers the published settings version; when the live settings already are this draft it publishes nothing and answers { version: <the live one>, skipped: true }. It changes only the site-level scopes (site, menus, header, footer), never a page; to publish a page with them, use publish with includeSite. The code on/off switch is not part of the settings and is never touched. Only available at the Publish or Full level; a Draft or Read credential does not see it.

  • Needs: Publish access or above. Scopes: site:write, pages:publish. Also requires: level:publish. A key made before access levels also needs Allow publishing.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: { version, warnings } for the published site settings.
InputRequiredTypeDetails
baseRevYesintegerRequired. The site settings draftRev you checked (from get_site, update_site_settings or restore_site_settings_version). Publishing is refused with DRAFT_CONFLICT if the settings changed since, so nothing you have not checked goes live. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
PUBLISH_BLOCKEDThe page has problems that would break the live store (for example a missing image, SAVED_SECTION_UNPUBLISHED, TEMPLATE_MISSING_REQUIRED). Nothing was published; the answer lists each issue.

list_site_settings_versions

List the published versions of the site settings, newest first: version, who published it (actor), when, and which one is live, with the current draftRev and liveVersion. Pass version to read one in full. The Throttle publishable key is never shown (connections answers { credentialSet, fingerprint }). Use it to find the version to bring back with restore_site_settings_version.

  • Needs: Read access or above. Scopes: site:read.
  • Kind: reads only.
  • Answers: The published settings versions (number, who, when), or one version in full when you pass version.
InputRequiredTypeDetails
versionNointegerRead one version in full (its settings) instead of the list. min 1; max 9007199254740991

restore_site_settings_version

Load a published site settings version into the draft, exactly as it was published. Nothing goes live: publish it afterwards with publish_site_settings, using the draftRev this answers. The draft you replace is kept as a change you can undo with undo_change (document 'site'). Refused with CONNECTIONS_PERSON_ONLY (PERMISSION_REQUIRED) if the version would put back a different Throttle publishable key or different page routes: only a person sets those. Only available at the Publish or Full level.

  • Needs: Publish access or above. Scopes: site:write, pages:publish. Also requires: level:publish. A key made before access levels also needs Allow publishing.
  • Kind: writes.
  • Answers: { draftRev, restoredVersion, note }. The settings draft now holds that version; publish it with publish_site_settings. undo_change with document "site" puts the previous draft back.
InputRequiredTypeDetails
versionYesintegerA published version from list_site_settings_versions. min 1; max 9007199254740991
baseRevYesintegerRequired. The site settings draftRev you last read (get_site). Refused with DRAFT_CONFLICT if the draft changed since, so a restore never overwrites an edit you have not seen. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
PERMISSION_REQUIREDThe restore would put back a different Throttle publishable key or different page routes. Only a person sets those.

update_menu

Edit one menu of the site settings draft with ops addressed by item id: insert ({ parentId, index, item }), move ({ id, parentId, index }), update ({ id, patch }; a null value clears a field) and remove ({ id }). menu is 'header', 'footer', 'mobile' or a named menu. baseRev (the site settings draftRev from get_site) is required. All ops apply or none do. Answers the new draftRev and the menu. Refused with SETTINGS_V2_NOT_ENABLED until the store has moved to the new site settings: tell the user, do not retry. Nothing goes live until publish_site_settings (or publish with includeSite).

  • Needs: Draft access or above. Scopes: site:write.
  • Kind: writes.
  • Answers: { draftRev, issues: [], menu }: the menu as it is now. All operations apply or none do.
InputRequiredTypeDetails
menuYesstring
opsYesarray of objectat most 1000 items
baseRevYesintegermin 0; max 9007199254740991
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
SETTINGS_V2_NOT_ENABLEDThe store has not moved to the new site settings, so menus cannot be edited this way. Do not retry; tell the user.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.

import_catalog_display

Copy the Product Catalog's display settings (cards, badges, product page, strings) into the Builder's site settings draft and the product template draft. Refused with SHOP_DISPLAY_DRAFT_EXISTS when a draft already holds display settings: ask the user, then repeat with confirmOverwrite: true. Needs the Product Catalog linked (CATALOG_NOT_LINKED otherwise) and a store on the new site settings (SETTINGS_V2_NOT_ENABLED otherwise: tell the user, do not retry). Answers { written, importedFrom, adjustments? }. Nothing goes live until it is published.

  • Needs: Draft access or above. Scopes: site:write.
  • Kind: writes.
  • Answers: { written, importedFrom, adjustments? }: the Product Catalog display settings copied into the settings draft and the product template draft.
InputRequiredTypeDetails
confirmOverwriteNoboolean
ErrorWhen
SHOP_DISPLAY_DRAFT_EXISTSA draft already holds display settings. Ask the user, then repeat with confirmOverwrite: true.
CATALOG_NOT_LINKEDProduct Catalog is not linked to the Builder.
SETTINGS_V2_NOT_ENABLEDThe store is not on the new site settings. Do not retry; tell the user.

What you can use

The components, data sources and link targets available to a page.

list_widgets

List every enabled widget with its settings (key, control, default, allowed values), its data inputs, where it may be placed and a minimal example node. Read this before add_widget.

  • Needs: Read access or above. Scopes: widgets:read.
  • Kind: reads only.
  • Answers: { commonSettings, widgets }: each component with its type, version, group, placement rules, every setting (key, control, allowed values, default), data inputs and a ready example node.
InputRequiredTypeDetails
groupNoenumOnly widgets of this group. One of: layout, basic, catalog, commerce, custom

list_data_sources

List the enabled data sources (products, a collection, categories, reviews, ...) with their params and the fields a widget may read.

  • Needs: Read access or above. Scopes: widgets:read.
  • Kind: reads only.
  • Answers: { dataSources }: each source with id, provider, title, description, params, result shape, fields and whether it is per shopper.

No inputs.

query_data_source

Run a data source with params and answer a few sample results, for example to find a collection handle or see what a product grid would show. A collection, category or product param takes the handle from list_link_targets or the catalog id; an unknown handle answers NOT_FOUND (404). Prices are { amount, currency, display }; print display.

  • Needs: Read access or above. Scopes: widgets:read.
  • Kind: reads only.
  • Answers: The data the source answers for the params you gave, read with the linked catalog key (never shown).
InputRequiredTypeDetails
sourceYesstringA data source id from list_data_sources, such as 'catalog.products'. at least 1 characters; at most 100 characters
paramsNoobjectThe source's params, as listed by list_data_sources.
ErrorWhen
CATALOG_NOT_LINKEDThe source needs Product Catalog and no catalog key is linked on Connections.
DATA_SOURCE_NOT_FOUNDNo data source has that id (HTTP 404). Call list_data_sources for the ids.

list_components

List the one components library: built-in widgets, custom widgets (code, composite and template kinds) and, when the credential also has pages:read, saved sections. Each entry has ref ('widget:<type>' or 'section:<id>'), kind ('builtin', 'custom' or 'saved'), subtype, type, title, group, status, usage (how many pages, templates and parts use it), version and who changed it last. Filter with kind, group or q (a text search). Read-only.

  • Needs: Read access or above. Scopes: widgets:read.
  • Kind: reads only.
  • Answers: { components }: one entry per component of the Components screen with ref (widget:<type> or section:<id>), kind (builtin, custom, saved), subtype, type, title, group, status, usage, version and who changed it last. Saved sections are included only with pages:read.
InputRequiredTypeDetails
kindNoenumOne of: builtin, custom, saved
qNostringat most 200 characters
groupNostringat most 64 characters

Pages and templates

List, read, create, rename and delete pages, header and footer, slots and templates.

list_pages

List the site's pages, header and footer parts and slots with their state: draft changes, the published version and whether a deletion is waiting to be published.

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { documents }: id, address, kind (page, part, slot, section, template), key, pageType, title, draftRev, published, publishedVersion, hasUnpublishedChanges, updatedAt. A page deleted in the draft shows deleted: true, deletionWaitingToPublish: true.
InputRequiredTypeDetails
kindNoenumOnly this kind of document. One of: page, part, slot

get_page

Read a document, draft or published, with its node ids and draftRev. A draft with older widgets is upgraded first, so the draftRev you get is the one to write against. Use outline: true for a compact tree.

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { address, kind, key, pageType, title, seo, source, draftRev (or publishedVersion), hasUnpublishedChanges, document } with document replaced by an outline when you pass outline: true. A template with no saved row yet is shown as its default with stored: false. An older draft is upgraded when opened and the answer carries upgraded.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
publishedNobooleanRead the published copy instead of the draft. It has no draftRev.
outlineNobooleanAnswer a compact tree (node ids, types and a text label) instead of the whole document. Start with this for a big page.
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
NOT_PUBLISHEDYou asked for the published copy and it was never published. Read the draft instead.

create_page

Create a landing or content page (blank, or from a starting document) with a title and slug. It starts as a draft and is not live until published. A catalog param in a binding takes the id; a handle is turned into its id, and a handle the catalog does not have is refused.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { id, address, draftRev, issues: [] }. The page is a draft; publish it to make it live.
InputRequiredTypeDetails
titleYesstring | objectText. A plain string is stored in the site's default language; an object maps locale tags to text, such as { en: 'Hello', fr: 'Bonjour' }. at least 1 characters; at most 20000 characters
slugYesstringLowercase letters, digits and hyphens, such as spring-sale. at least 1 characters; at most 80 characters
pageTypeNoenumDefaults to 'landing'. One of: landing, content
documentNoobjectAn optional starting document ({ schemaVersion: 1, sections: [...] }). It is validated like any edit. Blank when left out.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DOCUMENT_INVALIDThe starting document is not valid (answer carries issues). Nothing was created.
KEY_TAKENThe slug is already used by another page.
ROUTE_CONFLICTThe path collides with a store route.
CATALOG_HANDLE_NOT_FOUNDA catalog binding names a collection or product handle the catalog does not have (HTTP 422).

create_slot

Create an empty slot document (a named area around the catalog's pages, such as product.below) so it can be edited with 'slot:<name>'. A slot is never deleted, only emptied. It is a draft until published.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { id, address: "slot:<name>", draftRev, issues: [] }.
InputRequiredTypeDetails
nameYesstringDotted lowercase words, such as 'product.below' (the slot points are product.above, product.below, shop.above and shop.below). at least 3 characters; at most 80 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
LIMIT_EXCEEDEDThe store already holds the most slots allowed (LIMITS.slotsPerSite is 20).

update_page_meta

Change a page's title, slug, type, own path or SEO in the draft. path sets the page's own address ('/about'), or null removes it; a path the store itself answers on (such as /cart) is refused with PATH_RESERVED. Pass document 'template:<name>' (such as 'template:product') to change a template's seo.titleTemplate, seo.description, seo.noindex and seo.frame ('site' or 'none': draw it without the site header and footer) instead (a template has no slug, type, title or path). Nothing goes live until it is published.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues: [] }. Title, slug, page type, path and SEO are saved together or not at all.
InputRequiredTypeDetails
documentYesstringWhich page or template: a page slug or id, or 'template:<name>' for a template's own search settings. at least 1 characters; at most 100 characters
titleNostring | objectText. A plain string is stored in the site's default language; an object maps locale tags to text, such as { en: 'Hello', fr: 'Bonjour' }. at least 1 characters; at most 20000 characters
slugNostringThe new slug. The home page keeps its address. at least 1 characters; at most 80 characters
pageTypeNoenumOne of: landing, content
pathNostring | nullThe page's own address, such as '/about' or '/shop/sale' (one to three lowercase segments), or null to remove it. A path the store itself answers on (such as /cart) is refused with PATH_RESERVED.
seoNoobjectSearch and share settings; shareImage is a media asset id from list_media.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
INVALID_REQUESTA template was given page-only fields (slug, pageType, title, path, seo.title, seo.shareImage), or a page was given seo.titleTemplate or seo.frame.
PATH_RESERVEDThe path is one the store reserves (checkout, cart, account and similar).
KEY_TAKENThe slug is already used by another page.
ROUTE_CONFLICTThe path is already used.

delete_page

Delete a page in the draft (never the home page). A page that was never published is gone at once; a live page stays live until its deletion is published: by a Full level key with the publish tool, or by the merchant in the Builder (a Draft or Publish key cannot publish a deletion). The answer lists inboundReferences: every page, part, menu or announcement that links to the page, and a warning saying those links stop linking. Check them first and re-point or remove the links.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first.
  • Answers: { deleted: true, pendingPublish, draftRev?, inboundReferences, warning?, note? }. A page that was live stays live until its deletion is published (Full level, or the merchant in the Builder). inboundReferences lists what linked to it.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
INVALID_REQUESTThe address is a template; templates are reset, not deleted (reset_template).

get_page_references

Which documents and site settings link to or embed a page (draft and published counts), so you know what a rename, deletion or unpublish would affect.

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { references }: the documents and site settings that link to or embed the page, with draft and published counts.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

reset_template

Put a template's DRAFT back to the pack's default layout (name: 'product', 'cart', 'shop', ...). Only the draft changes: the store keeps showing the published template until it is published. The previous draft is kept as a change you can undo with undo_change. variant picks one of the layouts the pack ships for the template (refused when it has none by that name). A catalog template on a store without the Product Catalog is TEMPLATE_UNAVAILABLE. baseRev (the template's draftRev) is optional; leave it out to reset whatever the draft holds now.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues: [], note }. Only the draft returns to the default layout; undo_change puts the previous draft back.
InputRequiredTypeDetails
nameYesenumOne of: shop, collection, category, tag, search, product, cart, account, account-verify, sign-in, sign-up, order-complete, not-found
variantNostringat least 1 characters; at most 40 characters
baseRevNointegermin 0; max 9007199254740991
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
INVALID_REQUESTThe name is not a template name, or the variant does not exist.
TEMPLATE_UNAVAILABLEA catalog template on a store without Product Catalog.
TEMPLATE_DEFAULT_UNAVAILABLEThe pack ships no default for that template.

Editing a page

Add, change, move and remove sections and components in a draft.

add_section

Insert a section with N columns (1 to 6) and widths at an index. Answers the new section and column ids. Section settings go in props, all optional: width (boxed or full), contentWidth (600 to 1600), gap, paddingX and paddingY (none, xs, s, m, l, xl or 2xl, or a number), minHeight, verticalAlign, background ({ color: "token:<name>" or "#rrggbb", image, mobileImage (a media id shown instead of image at phone width), priority (true when the background is the main image above the fold: it loads first), overlay }) and entrance. Tabs, accordions, carousels and show/hide blocks are section settings, not widgets or code widgets: set props.interaction to "tabs", "accordion", "carousel" or "toggle". For tabs, accordion and carousel the columns become the panels; for tabs and accordion each column's props.panelTitle, such as { "en": "Shipping" }, is its heading (set it with update_node on each column id this answers; a carousel uses it only as the slide label). For toggle the whole row hides behind one button (toggleLabelClosed and toggleLabelOpen). Each mode has more options (accordionOpenFirst, carouselAutoplay and so on): validate_page names what is allowed. A countdown is the basic.countdown widget (list_widgets).

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues, sectionId, columnIds }. nodeFields (frame, cssClass, showWhen) can be set on the new section.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
indexNointegerPosition among its siblings, from 0. Appended at the end when left out, except when an idempotencyKey is given: then say the index too, so a retry is the same request. min 0; max 9007199254740991
columnsNointegerHow many columns, 1 to 6. They share the width equally unless widths is given. Defaults to 1. min 1; max 6
widthsNoarray of numberColumn widths in percent. They must add up to 100. Overrides columns. at most 6 items
propsNoobjectSection settings, such as padding or a background.
nodeFieldsNoobjectFields of the node itself, apart from its settings: frame (sections), cssClass and showWhen (sections, inner sections, columns and widgets). null clears one in update_node. Never put these in props: a widget may have a setting of the same name.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
INDEX_REQUIREDYou sent an idempotencyKey without an index. Say where to insert, so a retry is the same request.

set_columns

Change the column count and widths of a section, for desktop, or only the widths for tablet or phone.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }. Narrower widths can move the children of removed columns into moveChildrenTo.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
sectionIdYesstringThe section (or inner section) id. at least 1 characters; at most 64 characters
widthsYesarray of numberColumn widths in percent, adding up to 100. Their count is the new column count (without a device). at most 6 items
deviceNoenumSet the widths for tablet or phone only; the column count stays. One of: tablet, phone
moveChildrenToNo"previous"Needed to drop a column that has widgets: they move to the column before it.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

add_widget

Insert a widget into a column (or inner column) with its settings and data bindings. Answers the new widget id. Read list_widgets for the settings first. A catalog param in a binding takes the id; a handle is turned into its id, and a handle the catalog does not have is refused.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues, widgetId }. The component is added at its latest version. nodeFields (cssClass, showWhen) can be set on the new component.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
parentIdYesstringThe column (or inner column) to put the widget in. at least 1 characters; at most 64 characters
typeYesstringA widget type from list_widgets, such as 'basic.heading'. at least 1 characters; at most 120 characters
indexNointegerPosition among its siblings, from 0. Appended at the end when left out, except when an idempotencyKey is given: then say the index too, so a retry is the same request. min 0; max 9007199254740991
propsNoobjectSetting values by key. A setting's key and allowed values are in list_widgets. Text settings that are translatable take a locale object such as { en: 'Hello' }.
nodeFieldsNoobjectFields of the node itself, apart from its settings: frame (sections), cssClass and showWhen (sections, inner sections, columns and widgets). null clears one in update_node. Never put these in props: a widget may have a setting of the same name.
dataNoobjectData bindings by the widget's input name: { source, params? } from list_data_sources.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
INDEX_REQUIREDYou sent an idempotencyKey without an index. Say where to insert, so a retry is the same request.
UNKNOWN_WIDGETThere is no enabled component with that type. Call list_widgets.
NODE_NOT_FOUNDThe node id is not in the document. Use an id from get_page.
CATALOG_HANDLE_NOT_FOUNDA catalog binding names a handle the catalog does not have (HTTP 422).

add_inner_section

Insert an inner section (columns inside a column) into a top-level column. props takes the section settings of add_section, including interaction ("tabs", "accordion", "carousel" or "toggle"); set each column's panelTitle with update_node on the column ids it answers.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues, ... } with the new inner section and its column ids. nodeFields (cssClass, showWhen) can be set on it.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
parentIdYesstringA top-level column to put the inner section in. at least 1 characters; at most 64 characters
indexNointegerPosition among its siblings, from 0. Appended at the end when left out, except when an idempotencyKey is given: then say the index too, so a retry is the same request. min 0; max 9007199254740991
columnsNointegerHow many columns, 1 to 6. They share the width equally unless widths is given. Defaults to 1. min 1; max 6
widthsNoarray of numberColumn widths in percent. They must add up to 100. Overrides columns. at most 6 items
propsNoobjectInner section settings, the same as for add_section (such as interaction).
nodeFieldsNoobjectFields of the node itself, apart from its settings: frame (sections), cssClass and showWhen (sections, inner sections, columns and widgets). null clears one in update_node. Never put these in props: a widget may have a setting of the same name.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
INDEX_REQUIREDYou sent an idempotencyKey without an index. Say where to insert, so a retry is the same request.
NODE_NOT_FOUNDThe node id is not in the document. Use an id from get_page.

update_node

Set settings on a section, column or widget (setProps). A section takes width, contentWidth, gap, paddingX, paddingY, minHeight, verticalAlign, background (color, image, mobileImage for the phone, priority for the main image above the fold, overlay), entrance and interaction ("none", "tabs", "accordion", "carousel" or "toggle"; see add_section); a column takes width, panelTitle (the heading of a tab or accordion panel, such as { "en": "Care" }), padding, background and verticalAlign. The node's own fields go in nodeFields, not props: frame (sections only: { sticky: "none"|"top", collapse: { below: "tablet"|"phone"|null, belowPx, label } }), cssClass (up to 5 class names) and showWhen ({ audience: "all"|"signed-in"|"guest", cart: "any"|"empty"|"has-items" }, presentation only, not access control) on a section, inner section, column or widget (not a saved section reference). null clears one; an omitted field stays. With props and nodeFields together the settings are saved first, then the fields, as two history entries.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }. The props are merged into the node. nodeFields sets the node's own fields: frame on a section (sticky: "none" or "top"; collapse with below tablet, phone or null, belowPx and label), cssClass (up to 5 class names) and showWhen (audience and cart, presentation only) on a section, inner section, column or widget; null clears one. Give props, nodeFields or both: with both, the settings are saved first and then the fields, as two history entries.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idYesstringA node id, as listed by get_page. at least 1 characters; at most 64 characters
propsNoobjectSettings to change on a section, column or widget. null resets a setting to its default. Give props, nodeFields or both.
nodeFieldsNoobjectFields of the node itself, apart from its settings: frame (sections), cssClass and showWhen (sections, inner sections, columns and widgets). null clears one in update_node. Never put these in props: a widget may have a setting of the same name.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
INVALID_REQUESTNeither props nor nodeFields was given.
DOCUMENT_INVALIDIts issues carry NODE_NOT_FOUND or UNKNOWN_KEY: nodeFields names a node that does not exist, frame on a node that is not a section, or any field on a saved section reference (set classes and visibility inside the saved section). With props and nodeFields together, this is found before anything is saved.

set_responsive

Set or clear tablet or phone overrides on a node.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }. The values apply to one device only.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idYesstringA node id, as listed by get_page. at least 1 characters; at most 64 characters
deviceYesenumOne of: tablet, phone
propsYesobjectOverrides for this device only. null removes an override.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

set_data_binding

Bind a widget input to a data source, or remove the binding. A catalog param (collection, product, category, parent, a manual products list) takes the id; a handle is turned into its id, and a handle the catalog does not have is refused.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idYesstringThe widget id. at least 1 characters; at most 64 characters
nameYesstringThe widget's data input name. at least 1 characters; at most 64 characters
bindingYesobject | null{ source, params? }, or null to remove the binding.
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
CATALOG_HANDLE_NOT_FOUNDThe binding names a handle the catalog does not have (HTTP 422).

move_node

Move a node to another parent or position.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idYesstringA node id, as listed by get_page. at least 1 characters; at most 64 characters
parentIdYesstringThe new parent: 'root' for a section, otherwise a column id. at least 1 characters; at most 64 characters
indexYesintegerPosition in the new parent, from 0. min 0; max 9007199254740991
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

duplicate_node

Copy a node (with everything in it) right after the original. Answers the copy id.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues, copyId }. The copy gets new ids all the way down.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idYesstringA node id, as listed by get_page. at least 1 characters; at most 64 characters
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
NODE_NOT_FOUNDThe node id is not in the document. Use an id from get_page.

remove_node

Remove a node and everything in it.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idYesstringA node id, as listed by get_page. at least 1 characters; at most 64 characters
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

apply_ops

Apply a batch of document operations atomically, for bigger builds. If any operation is invalid nothing is saved and the answer lists the issues. A catalog param in a binding takes the id; a handle is turned into its id, and a handle the catalog does not have is refused.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues }. Up to 500 operations, all applied or none. A node in an insert may carry frame, cssClass and showWhen next to its props; setProps cannot set them (use update_node with nodeFields).
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
opsYesarray of objectA batch of at most 500 operations, applied in order and all or nothing. Each is one of: { op: "insert", parentId: "root"|<column id>, index, node } · { op: "remove", id } · { op: "move", id, parentId, index } · { op: "setProps", id, props } · { op: "setResponsive", id, device: "tablet"|"phone", props } · { op: "setColumns", sectionId, widths, device?, moveChildrenTo? } · { op: "setData", id, name, binding } · { op: "upgradeNode", id, toV } (moves a custom widget to a newer version and applies its renames). A node in an insert may carry frame (sections), cssClass and showWhen next to its props; setProps cannot set them (use update_node with nodeFields). New nodes need fresh ids (lowercase letters and digits, such as "a1b2c3d4e5f6g7h8"). at most 500 items
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
DOCUMENT_INVALIDThe change would break a placement rule or a setting value. Nothing was saved; the answer lists each issue (path, code, message) and the current draftRev.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

Checking and previewing

Validate a draft and get links to look at it.

validate_page

Check the draft: structural issues and publish warnings (a missing image, an empty link, a missing collection, a link to a page that was deleted or is not published: PAGE_LINK_DELETED, PAGE_LINK_UNPUBLISHED).

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { draftRev, valid, issues, warnings }. warnings include PAGE_LINK_DELETED, PAGE_LINK_UNPUBLISHED, missing images and missing collections.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

get_preview_url

Get the links to check your work in your own browser tool: draftUrl (the draft, read-only, no sign-in, valid 12 hours, drawn at the window's own width so open it at 390, 768 and 1280), liveUrl (the published page on the store, or null), storePreviewUrl (the draft on the store itself, the only place code widgets run) and the widths.

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { draftUrl, liveUrl, storePreviewUrl, widths: [390, 768, 1280], expiresAt, note }. draftUrl is read-only, needs no sign-in and lasts 12 hours. storePreviewUrl is the draft on the store itself (the only place code components run), lasts 1 hour and is null until a store URL is set in site settings and published. liveUrl is null until published.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
versionNointegerPreview a saved version instead of the draft. min 1; max 9007199254740991
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
INVALID_REQUESTThe address is a template; templates have no preview link.

get_site_preview_token

Get a site-wide, read-only preview token for the whole store: send it as the X-Builder-Preview header on the /v1 read API (or as the throttle_builder_preview query parameter on your store, which turns it into a cookie) and every read answers the DRAFT, never cached. Unlike get_preview_url it needs no storeUrl and no publish. It lasts at most 1 hour (pass ttlSeconds for less; more is capped at 3600), unlocks reads only, and is refused by every write. Answers { token, expiresAt, header, cookieParam }. Needs Draft access or above; a Read credential does not see it.

  • Needs: Draft access or above. Scopes: pages:read. Also requires: draft.
  • Kind: reads only.
  • Answers: { token, expiresAt, header, cookieParam }. Send the token as the X-Builder-Preview header on the read API, or as the throttle_builder_preview query parameter on your store, and every read answers the draft. Lasts at most 1 hour; reads only.
InputRequiredTypeDetails
ttlSecondsNointegerHow long the token lasts, in seconds. Default and maximum 3600 (1 hour). min 1; max 9007199254740991

Publishing, versions and undo

Make a draft live, and step back.

publish

Publish a document, and optionally the site settings, so it goes live. baseRev (the draftRev you checked) is required, so nothing you have not checked is published. Answers the published version. Check the work first: validate_page, then open the draftUrl from get_preview_url in your own browser tool at 390, 768 and 1280 px wide. Publish once the work is correct. Only available when the merchant gave this credential the Publish or Full level (an older key needs Allow publishing turned on); a Draft or Read credential does not see it.

  • Needs: Publish access or above. Scopes: pages:publish. Also requires: level:publish. A key made before access levels also needs Allow publishing.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: { version, warnings, deleted? }. The draft is now live (in build-time delivery it goes live at the next release).
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
baseRevYesintegerRequired. The draftRev you checked (from get_page or the write that made the change, the same one you gave get_preview_url). Publishing is refused with DRAFT_CONFLICT if the draft has changed since, so nothing you have not checked goes live. min 0; max 9007199254740991
includeSiteNobooleanPublish the site settings (theme, brand, menus) with the page. Defaults to false. Needs siteBaseRev.
siteBaseRevNointegerRequired with includeSite: the site settings draftRev you checked (from get_site). Refused with DRAFT_CONFLICT if the settings changed since. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
PUBLISH_BLOCKEDThe page has problems that would break the live store (for example a missing image, SAVED_SECTION_UNPUBLISHED, TEMPLATE_MISSING_REQUIRED). Nothing was published; the answer lists each issue.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
SITE_BASE_REV_REQUIREDYou sent includeSite without siteBaseRev (the settings draftRev from get_site).
PERMISSION_REQUIREDPublishing a page that is deleted in the draft, or a saved section, needs Full (required: level:full).

discard_draft

Reset a draft to its published copy, dropping unpublished changes.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first.
  • Answers: { draftRev, issues: [] }. The draft is back to the published copy.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
NOT_PUBLISHEDThere is no published copy to go back to.

list_versions

List a document's saved versions, or read one in full.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: reads only.
  • Answers: The saved versions of a document (number, kind such as published or checkpoint, who, when), or one version in full when you pass version.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
versionNointegerRead one version in full (its document) instead of the list. min 1; max 9007199254740991
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

restore_version

Load a saved version into the draft. The current draft is checkpointed first; nothing is published.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues: [], restoredVersion, checkpointVersion }. Your current draft is saved first as a checkpoint version, so the restore can itself be reversed.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
versionYesintegermin 1; max 9007199254740991
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

list_changes

List the newest draft changes of a document (or of the site settings with document 'site'), newest first: seq, who made it, a summary, when, and whether it was undone. undoable marks the one change undo_change would undo now. Needs site:read for 'site'. Edits to a draft (and discard_draft and page title, address and SEO changes) are listed; restoring a version, deleting a page and the upgrade on open are not (a restore keeps its own checkpoint, see list_versions), and undo cannot step back past them.

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { changes }, newest first: seq, who, a summary, when, and whether it was undone. undoable marks the one change undo_change would undo now.
InputRequiredTypeDetails
documentYesstringWhich draft: 'site' for the site settings, or a document as in get_page ('part:header', 'template:<name>', a page slug, a document id). A page whose slug is 'site' is addressed by its document id. at least 1 characters; at most 100 characters
limitNointegerHow many of the newest changes to answer (default 20). min 1; max 50
ErrorWhen
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).

undo_change

Undo one change, by its seq from list_changes (document 'site' for the site settings; needs site:write). Only the change marked undoable works: the newest that is neither an undo nor already undone. Call again to walk further back. Anything else is refused with DRAFT_CONFLICT, and so is an undo that would step back past something the journal did not record (a version restore, a page deletion, the upgrade done when a page with older widgets is opened). An undo is itself a change in the list but cannot be undone: make the edit again instead. Edits the draft only; nothing is published.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues: [], undoneSeq }.
InputRequiredTypeDetails
documentYesstringWhich draft: 'site' for the site settings, or a document as in get_page ('part:header', 'template:<name>', a page slug, a document id). A page whose slug is 'site' is addressed by its document id. at least 1 characters; at most 100 characters
seqYesintegerThe change number from list_changes. min 1; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTA newer change has to be undone first. Call list_changes for the newest change that is not undone.
PERMISSION_REQUIREDThe undo would put back a different Throttle publishable key or page routes.

Saved sections

Sections you build once and use on many pages.

create_saved_section

Save a section as a saved section: build it once, put it on many pages by reference (insert_saved_section), and edit it once to change every page that uses it. Give fromNodeId (a top-level section already in a document) or section (a section node). It starts as a draft and is never shown on a store until it is published (publish_saved_section, Full level). Answers its id; edit it with the node tools and document 'section:<id>'. A catalog param in a binding takes the id; a handle is turned into its id, and a handle the catalog does not have is refused.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { id, address: "section:<id>", draftRev, published: false, note }. It is a draft until published.
InputRequiredTypeDetails
titleYesstringThe saved section's name, such as 'Free shipping banner'. at least 1 characters; at most 120 characters
fromNodeIdNoobjectSave a copy of a top-level section that is already in a document ({ document, nodeId }). The document is not changed: use insert_saved_section to put the saved section where it was.
sectionNoobjectOr give the section node itself ({ id, type: "section", props, columns: [...] }). Give exactly one of fromNodeId and section.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
INVALID_REQUESTYou gave both fromNodeId and section, or neither.
NODE_NOT_FOUNDThe node id is not in the document. Use an id from get_page.
INVALID_TARGETfromNodeId is not a top-level section (a column, component or inner section).
LIMIT_EXCEEDEDThe store holds the most saved sections allowed (LIMITS.savedSectionsPerSite is 200).

list_saved_sections

List the saved sections with their published version, whether the draft has changes not yet published and the pages, parts and slots that use each (usedBy). Read one with get_page and document 'section:<id>'.

  • Needs: Read access or above. Scopes: pages:read.
  • Kind: reads only.
  • Answers: { savedSections }: id, title, published version, whether the draft has unpublished changes and usedBy (the pages, parts and slots that use it).

No inputs.

insert_saved_section

Put a saved section on a page, header, footer or slot by reference, at a section index. The document shows the saved section's published content; changing the saved section later changes every document that uses it. A page that uses a saved section cannot be published until the saved section is published (PUBLISH_BLOCKED, SAVED_SECTION_UNPUBLISHED).

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues, ... } with the id of the linked block.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
savedSectionIdYesstringA saved section id from list_saved_sections or create_saved_section.
indexYesintegerPosition among the document sections, from 0. min 0; max 9007199254740991
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
INDEX_REQUIREDYou sent an idempotencyKey without an index. Say where to insert, so a retry is the same request.
INVALID_TARGETThe target is itself a saved section; a saved section cannot hold another.
WIDGET_INVALIDA saved-section reference is unknown (written reference to an id that does not exist). The answer carries issues.

detach_saved_section

Replace a saved-section reference in a document with an ordinary copy of the saved section's PUBLISHED content (new ids), so this document can differ from it. Other documents keep using the saved section. Answers the new section id.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes.
  • Answers: { draftRev, issues, sectionId, detachedFrom }. The block becomes a copy that belongs to this page.
InputRequiredTypeDetails
documentYesstringWhich document: 'part:header', 'part:footer', 'slot:<name>', 'section:<id>' (a saved section from list_saved_sections), 'template:<name>' (a store template such as 'template:product'; created on first use), a page slug (such as 'home' or 'about') or a document id from list_pages. at least 1 characters; at most 100 characters
nodeIdYesstringThe id of the saved-section reference node in the document, as listed by get_page. at least 1 characters; at most 64 characters
baseRevNointegerThe draftRev you last read. The write is refused (DRAFT_CONFLICT) if the draft has changed since, so you never overwrite someone else's edit. Leave it out to write on top of the current draft. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
NOT_FOUNDThere is no document with that address (page slug, document id, part:, slot:, section: or template:).
NODE_NOT_FOUNDThe node id is not in the document. Use an id from get_page.

delete_saved_section

Permanently delete a saved section that no page, header, footer or slot uses (draft or published). Refused with SAVED_SECTION_IN_USE and the list of documents that use it (usedBy): detach or remove those first. Destructive and not undoable: ask the user first.

  • Needs: Draft access or above. Scopes: pages:write.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first.
  • Answers: { deleted: true }.
InputRequiredTypeDetails
savedSectionIdYesstringA saved section id, from list_saved_sections.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
SAVED_SECTION_IN_USEA draft or published page, header, footer or slot still uses it (answer lists usedBy). Detach or remove the references, publish those, then try again.
NOT_FOUNDThere is no saved section with that id.

publish_saved_section

Publish a saved section, so every published page, header, footer and slot that uses it shows the new content. It changes many pages at once, so it needs the Full level. baseRev (the saved section's draftRev you checked) is required. Check the work first: validate_page, then open the draftUrl from get_preview_url in your own browser tool at 390, 768 and 1280 px wide.

  • Needs: Full access or above. Scopes: pages:publish. Also requires: level:full.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: Same as publish: { version, warnings }. Pages that use the section show the new version once they are published or revalidated.
InputRequiredTypeDetails
savedSectionIdYesstringA saved section id, from list_saved_sections.
baseRevYesintegerRequired. The saved section's draftRev (from get_page with document 'section:<id>' or the write that made the change). Refused with DRAFT_CONFLICT if the draft has changed since. min 0; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
DRAFT_CONFLICTThe draft changed after the draftRev you sent as baseRev. Nothing was saved. Read the page again and redo the change.
PUBLISH_BLOCKEDThe page has problems that would break the live store (for example a missing image, SAVED_SECTION_UNPUBLISHED, TEMPLATE_MISSING_REQUIRED). Nothing was published; the answer lists each issue.
PERMISSION_REQUIREDNeeds Full (required: level:full), and a key from before levels never has it.

Custom and code components

Your own components: template widgets and code components, with versions.

create_widget

Store a custom widget definition (a new widget, or its next version). Use validate_widget first.

  • Needs: Draft access or above. Scopes: widgets:write.
  • Kind: writes.
  • Answers: { type, version, status, ... } for the stored definition: a new component, or its next version (mode).
InputRequiredTypeDetails
definitionYesobjectA custom widget definition (composite or template). Use validate_widget first.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
modeNoenum'create' stores a new widget type (v 1); 'version' adds the next version of an existing one. Chosen from definition.v when left out. One of: create, version
ErrorWhen
WIDGET_INVALIDThe definition is not valid. The answer lists each issue.
LIMIT_EXCEEDEDA size or count limit is passed, such as customWidgetVersionsPerType (50).

validate_widget

Check a custom widget definition without storing it. Answers its issues.

  • Needs: Draft access or above. Scopes: widgets:write.
  • Kind: reads only.
  • Answers: { ok, issues, definition? }. Nothing is stored. Problems come back as issues, not as an error.
InputRequiredTypeDetails
definitionYesobjectA custom widget definition. Nothing is stored.

set_widget_status

Turn a custom widget off or on. A widget a merchant turned off can only be turned back on by the merchant, in the Builder: this tool answers WIDGET_REENABLE_DASHBOARD_ONLY for it, and you should tell the user instead of retrying.

  • Needs: Publish access or above. Scopes: widgets:write. Also requires: level:publish.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: { type, status, versions }. Turning a version off stops it on the store at once, without a publish.
InputRequiredTypeDetails
typeYesstringA custom widget type, such as 'custom.promo-banner'. at least 1 characters; at most 120 characters
versionNointegerOne version; every version when left out. min 1; max 9007199254740991
statusYesenumOne of: active, disabled
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
NOT_FOUNDNo component of that type (or version).
WIDGET_NOT_FOUNDThe type name is malformed.
WIDGET_REENABLE_DASHBOARD_ONLYA merchant turned it off, and only the merchant can turn it back on, in the Builder. Do not retry.
PERMISSION_REQUIREDNeeds Publish (required: level:publish). Turning a version back on at draft level also needs Draft access or above for code (required: level:draft).

delete_widget

Permanently delete a custom widget type and all its versions. Destructive and not undoable: ask the user first. The type must already be turned off (set_widget_status) and no page may use it (WIDGET_NOT_DISABLED, WIDGET_IN_USE). A widget a merchant turned off can only be deleted by the merchant, in the Builder.

  • Needs: Publish access or above. Scopes: widgets:write. Also requires: level:publish.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: { type, deleted: true }.
InputRequiredTypeDetails
typeYesstringA custom widget type, such as 'custom.promo-banner'. at least 1 characters; at most 120 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
NOT_FOUNDNo component of that type.
WIDGET_NOT_FOUNDThe type name is malformed.
WIDGET_NOT_DISABLEDThe type is still on. Turn it off with set_widget_status first.
WIDGET_IN_USEA page still uses the component.
WIDGET_DELETE_DASHBOARD_ONLYA merchant turned it off, and only the merchant can delete it. Do not retry.
PERMISSION_REQUIREDNeeds Publish (required: level:publish).

create_code_widget

Create a code widget: markup and CSS plus a script that runs on the store page (not in the Builder editor, which only draws it). Needs Draft access or above (no separate code permission). Code widgets are on unless the store owner turned them off in Throttle Builder (CODE_WIDGETS_OFF then: tell the user, do not retry); only a person can switch that. Code can read and change anything on your store pages. It never runs on checkout, cart, account or sign-in pages. To check it, open storePreviewUrl from get_preview_url in your browser.

  • Needs: Draft access or above. Scopes: widgets:write. Also requires: draft.
  • Kind: writes.
  • Answers: { type, version, status, ... } for the first version. The script runs on the store, not in the editor.
InputRequiredTypeDetails
definitionYesobjectA code widget: { type: 'custom.<slug>', title, description, icon, settings?, html, css?, js }. html and css are drawn like a template widget's (no script, no on* attribute); js is the BODY of a function run with (root, input) once per element on the store page, where root is the widget's element and input is { props, data }. It runs with the page's own power: it can read and change anything on the store page. The kind, version 1 and group are set for you. Use validate_code_widget first.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
WIDGET_INVALIDThe definition is not valid. The answer lists each issue.
CODE_WIDGETS_OFFCode is switched off for the store. Only a person can switch it on; do not retry.
PERMISSION_REQUIREDNeeds Draft or above (required: draft).

update_code_widget

Save the next version of an existing code widget. Needs Draft access and code widgets turned on for the store. Every save is a version with your key as its author; roll back with rollback_code_widget.

  • Needs: Draft access or above. Scopes: widgets:write. Also requires: draft.
  • Kind: writes.
  • Answers: { type, version, status, ... } for the new version. Pages that already use the component keep the old version until they are republished.
InputRequiredTypeDetails
definitionYesobjectThe whole new definition of an existing code widget (the type must exist). It is saved as the next version; earlier versions stay in list_code_widget_versions. Pages keep the version they were published with until they are published again.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
WIDGET_INVALIDThe definition is not valid. The answer lists each issue.
WIDGET_NOT_FOUNDNo component of that type.
CODE_WIDGETS_OFFCode is switched off for the store.
PERMISSION_REQUIREDNeeds Draft or above (required: draft).

validate_code_widget

Check a code widget definition without storing it: markup and CSS rules and the script syntax (JS_SYNTAX with line and column). A valid answer can carry warnings, such as CODE_EMPTY_MARKUP (no text in the markup while the script writes content). Needs Draft access and code widgets turned on for the store.

  • Needs: Draft access or above. Scopes: widgets:write. Also requires: draft.
  • Kind: reads only.
  • Answers: { ok, issues, definition? }. Checks the markup, the CSS and that the script parses. Nothing is stored.
InputRequiredTypeDetails
definitionYesobjectA code widget definition, as for create_code_widget or update_code_widget. Nothing is stored. Answers its issues, including JS_SYNTAX with the line and column of a broken script.
ErrorWhen
PERMISSION_REQUIREDNeeds Draft or above (required: draft).

list_code_widget_versions

List the versions of a code widget with who saved each and when. Read-only.

  • Needs: Read access or above. Scopes: widgets:read.
  • Kind: reads only.
  • Answers: { type, latestVersion, versions } with each version number, status, date and author.
InputRequiredTypeDetails
typeYesstringA code widget type, such as 'custom.promo-timer'. at least 1 characters; at most 120 characters
ErrorWhen
WIDGET_NOT_FOUNDNo component of that type.

rollback_code_widget

Bring an earlier version's code back as a new version and turn OFF every version after the one you restore, so shoppers stop running them now. Rolling back TO a version that is off makes its code live again as the new version (the answer says so). Published pages keep the version they were published with: republish pages that use this widget to run the restored version. Needs Draft access and code widgets turned on for the store.

  • Needs: Draft access or above. Scopes: widgets:write. Also requires: draft.
  • Kind: writes.
  • Answers: { ..., disabledVersions, note }. The earlier version is saved as a new one and every version after it is turned off. Republish pages that use it to run the restored version.
InputRequiredTypeDetails
typeYesstringA code widget type. at least 1 characters; at most 120 characters
toVersionYesintegerThe version whose code to bring back. It is saved as a NEW version (the history is kept); every version after it is turned off. min 1; max 9007199254740991
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
WIDGET_NOT_FOUNDNo component or no such version.
CODE_WIDGETS_OFFCode is switched off for the store.
PERMISSION_REQUIREDNeeds Draft or above (required: draft).

Media

The image library.

list_media

List the store's media library.

  • Needs: Read access or above. Scopes: media:read.
  • Kind: reads only.
  • Answers: A page of images: id, alt text, size, width variants and URLs, plus a cursor for the next page.
InputRequiredTypeDetails
queryNostringSearch the library by file name or alt text. at least 1 characters; at most 200 characters
limitNointegermin 1; max 100
cursorNostringThe nextCursor of the previous page. at least 1 characters; at most 256 characters
ErrorWhen
MEDIA_UNAVAILABLEThe media library cannot be reached (HTTP 503). Try again shortly. A store whose Worker has no media connection at all answers MEDIA_NOT_AVAILABLE (503) instead; do not retry.

upload_media_from_url

Add an image to the media library from a public https URL. Answers the asset id to use in image settings.

  • Needs: Draft access or above. Scopes: media:write.
  • Kind: writes.
  • Answers: The new image asset: id, alt, width, height, bytes and variants. Throttle downloads the address; this server never does.
InputRequiredTypeDetails
urlYesstringA public https image URL. Throttle downloads it. at least 1 characters; at most 2048 characters
altNostringAlt text for the image. at most 500 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
MEDIA_UNAVAILABLEThe media library cannot be reached (HTTP 503). Try again shortly. A store whose Worker has no media connection at all answers MEDIA_NOT_AVAILABLE (503) instead; do not retry.
fetch_failed / file_too_large / unsupported typeThrottle refuses the image (HTTP 400, 413, 415, 422 or 502): the download failed, it is over 10 MB, or it is not PNG, JPEG, WebP, GIF or AVIF. The answer passes Throttle’s status and code through.

update_media

Change the alt text of a media asset in the library. It changes the library entry only: it does not change any page and nothing goes live. A page image's alt text is the image widget's own alt setting, so set it with update_node on that widget. Catalog data (products, collections, categories) is read-only here.

  • Needs: Draft access or above. Scopes: media:write.
  • Kind: writes.
  • Answers: The image asset with its new alt text.
InputRequiredTypeDetails
idYesstringA media asset id from list_media.
altYesstringThe new alt text. An empty string clears it. at most 500 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
MEDIA_UNAVAILABLEThe media library cannot be reached (HTTP 503). Try again shortly. A store whose Worker has no media connection at all answers MEDIA_NOT_AVAILABLE (503) instead; do not retry.
not_foundNo image with that id in this store (HTTP 404, passed through from the media library).

delete_media

Delete a media asset from the library. Throttle keeps a deleted file for 30 days, so published pages keep showing the image until then and show a broken image after that. Check where it is used first (get_page_references lists what links to a page; look through get_page on the pages that show the image). Destructive: ask the user first.

  • Needs: Publish access or above. Scopes: media:write. Also requires: level:publish. A key made before access levels also needs Allow publishing.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: The deletion answer from the media library. The image is soft-deleted: pages already published keep showing it for 30 days.
InputRequiredTypeDetails
idYesstringA media asset id from list_media.
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
MEDIA_UNAVAILABLEThe media library cannot be reached (HTTP 503). Try again shortly. A store whose Worker has no media connection at all answers MEDIA_NOT_AVAILABLE (503) instead; do not retry.
PUBLISH_NOT_ALLOWEDA key from before levels that does not have Allow publishing on. Not raised for a level key.
PERMISSION_REQUIREDNeeds Publish (required: level:publish).

upload_media

Add an image to the media library from bytes you hold: base64 data with its contentType (PNG, JPEG, WebP, GIF or AVIF; the library takes 10 MB but the MCP request is capped at 1 MB, so about 700 KB here, and a bigger file needs upload_media_from_url), or SVG markup as text in svg (sanitized, at most 20 KB). Use it when the image has no public URL; otherwise use upload_media_from_url. Answers the asset (its id goes in image settings); an svg answer also lists what the sanitizer removed. Needs Draft access or above. Throttle may refuse SVG files for a store; a short inline SVG is better set as the svg setting of an SVG widget.

  • Needs: Draft access or above. Scopes: media:write. Also requires: draft.
  • Kind: writes.
  • Answers: The new image asset: id, alt, width, height, bytes and variants. For an svg upload the answer also has removed, the list of what the sanitizer took out. The id goes in image settings.
InputRequiredTypeDetails
filenameYesstringThe file name, such as "stamp.png". Used for the activity log only. at least 1 characters; at most 200 characters
contentTypeNostringWith data: image/png, image/jpeg, image/webp, image/gif, image/avif. Not used with svg. at least 1 characters; at most 64 characters
dataNostringThe file, base64 encoded (standard or URL-safe alphabet, line breaks and missing padding are fine; the first bytes must match contentType), at most 10 MB decoded. Send exactly one of data and svg. at least 1 characters; at most 13981016 characters
svgNostringSVG markup as text, at most 20 KB. It is sanitized (script, event attributes, external references and style elements are removed) before it is stored. Send exactly one of data and svg. at least 1 characters; at most 81920 characters
altNostringAlt text for the image. at most 500 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
MEDIA_UNAVAILABLEThe media library cannot be reached (HTTP 503). Try again shortly. A store whose Worker has no media connection at all answers MEDIA_NOT_AVAILABLE (503) instead; do not retry.
INVALID_UPLOADBoth or neither of data and svg were sent. Send exactly one.
UNSUPPORTED_CONTENT_TYPEcontentType is missing or is not image/png, image/jpeg, image/webp, image/gif or image/avif. Send SVG as text in svg.
INVALID_BASE64data is not valid base64.
file_too_largeThe decoded file is over 10 MB (HTTP 413). The MCP request itself is capped at 1 MB, so keep to about 700 KB or use upload_media_from_url.
CONTENT_TYPE_MISMATCHThe first bytes of the file do not match contentType.
SVG_REFUSEDThe markup is not an svg element the sanitizer can keep (at most 20 KB), or it uses an entity that standalone XML does not define. The answer lists the issues.
MEDIA_UNAVAILABLE (402)The Throttle workspace is not live for this environment, so the media library refuses uploads.
Throttle status and codeAny other refusal from Throttle’s media library (for example a store that refuses SVG files) passes its status and code through.

Releases (build-time stores)

Freeze everything published and deploy it. Only for stores in build-time delivery.

create_release

Build-time stores only: freeze everything published right now into a release and call the store's deploy hook once. A release changes the live store, so it needs the Full level (a key from before levels: the releases:write scope AND the merchant's Allow publishing). Answers the release and its deploy status.

  • Needs: Full access or above. Scopes: releases:write. Also requires: level:full. A key made before access levels also needs Allow publishing.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: { release }: the new release and its deploy status.
InputRequiredTypeDetails
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
NOT_BUILD_MODEThe store is in live delivery, so it has no releases. The merchant switches it in the Builder.
RELEASE_COOLDOWN / RELEASE_RATE_LIMITEDReleases are limited (one every 10 seconds, 20 an hour). Retry later.
PERMISSION_REQUIREDNeeds Full (required: level:full).

list_releases

Build-time stores only: list releases, newest first, with their deploy status. Needs the releases:write scope.

  • Needs: Full access or above. Scopes: releases:write. Also requires: level:full.
  • Kind: reads only.
  • Answers: { releases } newest first, each with its deploy status.
InputRequiredTypeDetails
limitNointegermin 1; max 100
beforeNointegerThe nextBefore of the previous page. min 1; max 9007199254740991
ErrorWhen
NOT_BUILD_MODEThe store is in live delivery.

rollback_release

Build-time stores only: make a new release that re-deploys an earlier release. It changes the live store, so it needs the Full level (a key from before levels: the releases:write scope AND the merchant's Allow publishing).

  • Needs: Full access or above. Scopes: releases:write. Also requires: level:full. A key made before access levels also needs Allow publishing.
  • Kind: writes; changes the live store or throws work away, so a client may ask you first; changes what shoppers see.
  • Answers: { release }: a new release that holds exactly what the older one held.
InputRequiredTypeDetails
releaseIdYesstringA release id from list_releases. at least 1 characters; at most 64 characters
idempotencyKeyNostringOptional. Repeating a call with the same key within 24 hours returns the first answer instead of writing again. Use a fresh key for each distinct change. at least 1 characters; at most 128 characters
ErrorWhen
RELEASE_NOT_FOUNDNo release with that id.
NOT_BUILD_MODEThe store is in live delivery.
RELEASE_COOLDOWN / RELEASE_RATE_LIMITEDReleases are limited. Retry later.
PERMISSION_REQUIREDNeeds Full (required: level:full).

Contact forms

The store forms behind the contact form component.

list_site_forms

List the store's Throttle site forms (the ones a contact form widget posts to): id, publicKey (the frm_... value for the widget's form setting), name, allowed origins, whether the store owner is notified, recipients and whether each confirmed, and the redirect page. Never shows a submission.

  • Needs: Read access or above. Scopes: site:read.
  • Kind: reads only.
  • Answers: { forms }: the store forms with id and name.

No inputs.

ErrorWhen
FORMS_UNAVAILABLEThe store cannot reach Throttle Forms, or the installed Builder version lacks the Forms permission (the contact form needs a Builder update).

create_site_form

Create a Throttle site form that accepts posts from the store's published address (set and publish the store address first: STORE_URL_MISSING otherwise). name is required; redirectUrl (an https page on the store) and notifyAppOwner are optional. Answers the form, including the publicKey to use as the contact form widget's form setting. Recipients are added by the store owner in the Throttle dashboard.

  • Needs: Draft access or above. Scopes: site:write.
  • Kind: writes.
  • Answers: { form, warnings }. The form accepts posts from the store’s own address only.
InputRequiredTypeDetails
nameYesstringat least 1 characters; at most 200 characters
allowedOriginsNoarray of stringat most 10 items
notifyAppOwnerNoboolean
redirectUrlNostring | nullat most 2048 characters
ErrorWhen
FORMS_UNAVAILABLEThe store cannot reach Throttle Forms, or the installed Builder version lacks the Forms permission (the contact form needs a Builder update).
STORE_URL_MISSINGNo store URL is set in site settings and published yet.
ORIGIN_NOT_ON_STOREallowedOrigins names an address other than the store’s own. Leave it out.
REDIRECT_NOT_ON_STOREredirectUrl is not an https address on the store.
REDIRECT_NOT_SET (warning)The form was created but its redirect page could not be set. Ask the owner to set it in the Throttle dashboard.

list_form_submissions

List a form's recent submissions as metadata only: { total, items: [{ id, submittedAt, subject, status }] }. subject is one of the form's configured subject options (or null) and status is the email delivery status. Names, email addresses, phone numbers and messages are never returned: the store owner reads those in the Throttle dashboard. formId is the id from list_site_forms.

  • Needs: Read access or above. Scopes: site:read.
  • Kind: reads only.
  • Answers: { total, items: [{ id, submittedAt, subject, status }] }. Metadata only: subject is one of the form’s configured options (or null) and status is the email delivery status. Names, email addresses, phone numbers and messages are never returned.
InputRequiredTypeDetails
formIdYesstringat least 1 characters; at most 64 characters
limitNointegermin 1; max 100
ErrorWhen
FORMS_UNAVAILABLEThe store cannot reach Throttle Forms, or the installed Builder version lacks the Forms permission (the contact form needs a Builder update).