Store Email Layouts
List Brand Layouts
Lists the tenant default layout first, then each store override (summary only: id, store_id, store_name, store, is_default, updated_at, created_at). Creates the default from SKU's built-in layout when the tenant has none yet.
Create Store Brand Layout
Gives a store its own layout, copied from `copy_from_id` (default: the tenant default). Records a version.
Get Brand Layout
Returns a layout for the editor: `html`, `settings` (every quick-setting key, built-in values filling the gaps), `variables_tree` (the `{{content}}`, `{{preheader}}` and `{{brand.*}}` tokens), `affected_templates_count` (templates it wraps — a store override wraps that store's templates; the default wraps every template whose store has no override), `reset_available`, `updated_by`.
Update Brand Layout
Saves the layout's HTML and quick settings.
Delete Store Brand Layout
Removes a store override; that store's emails fall back to the default layout. The tenant default can't be deleted (422 `default_layout_undeletable`).
Reset Brand Layout
Replaces the layout's HTML and quick settings with SKU's built-in layout and records a `reset` version (the previous one stays in Versions).
List Brand Layout Versions
Lists the layout's saved versions, newest first (paginator).
Get Brand Layout Version
Returns one saved layout version (HTML + settings).
AI Edit Brand Layout (stream)
Server-Sent Events: one AI assistant turn on a brand layout document. `:storeId` is a store id, or `default` for the tenant default layout; `layout_id` in the body names the layout explicitly. An empty `current_html` uses the saved layout HTML.