Theme Session
Edit a theme through an edit session, the same way the theme editor in the admin does
An edit session, identified by oseid, is one opening of the theme editor. Changes made in
a session are isolated from other sessions and take effect only after they are saved to the
theme's draft; saving checks whether the draft has changed since the session began.
Provides endpoints to create an edit session, check it for conflicts, and save it to the draft; read and write the session's files and apply batch edits; read and update the theme's global configuration (theme settings and global cards such as the header and footer); work with the cards on a page: list the cards added to a template, get a card's details, set card and block properties, add and remove blocks, and remove cards from a page; create cards in the session: list the session's card library, create and manage AI cards (block cards created from liquid code, where every write can be reverted), look up page-builder block definitions, and save a page-builder block into the session; and list, enable, and disable app embeds and script tags. To browse the cards available to add and work with page-builder templates, see Theme Card.
Create theme edit session
Open a temporary edit session (oseid) for the specified theme.
Check edit session conflict
Check whether the draft has been changed by another session since this edit session started.
Save edit session as draft
Save an edit session as the draft.
Get edit session file
Read a single file within a theme edit session.
Update edit session file
Overwrite a template file in the edit session with the given card configs; cards missing from
Batch edit operations
Execute multiple edit operations in one request; each operation runs and is saved
Get theme global config
Get the current values of the theme settings within an edit session, plus the configuration
Update theme global config
Partially update the theme's global config within an edit session: pass only the settings to
List cards added to a template
List all cards added to a template within an edit session, including global card groups such
Get card details
Render the specified card with its current config and return the rendered HTML, the card
Set card properties
Set/merge properties into a card's settings within an edit session.
Set block properties in a card
Set/merge properties into a specific block's settings within a card.
Add block to a card
Append/insert a block into a card within an edit session.
Remove block from a card
Remove a block from a card by index within an edit session.
Remove card from page
Remove a card from the page within an edit session.
List edit-session card library
List the cards available in the theme: regular cards (`card_list`, `block_list`) come from the
Get AI card details
Get an AI card's file info and its usage in the current session (whether it is saved, how many
Create AI card
Create an AI card from liquid code (must contain a `{% schema %}` tag) within an edit session.
Delete AI card
Delete an AI card and remove it from every page of the theme.
Update AI card
Update an AI card with new source code and its full settings. If the card is unused or used in
Revert AI card operation
Restore the card to its state before the operation identified by `revert_id` (returned by any
Get page-builder block details
Batch-fetch page-builder blocks by `source_ids`: each returns its name, full block `type`, and
Save page-builder block
Apply edit operations (`ops`) to a page-builder template and save the result as a new card,
List app embeds
List the embed cards (app embeds) provided by the store's installed apps, plus injected script
Enable app embed
Enable a specific app-embed block or script tag within an edit session.
Disable app embed
Disable a specific app-embed block or script tag within an edit session.