Update theme
update_themeUpdate theme variables (colors, typography, spacing) and publish them to the live site.
Merge semantics (RFC 7396 JSON Merge Patch):
Fields you send override the server's values.
Fields you omit are preserved unchanged.
To explicitly clear a field, send it as null.
Arrays (spacing, accentScale, grayScale) are REPLACED wholesale: send the full array you want.
Publishing: by default the merged theme is published immediately (live site restyles, page caches purge). Pass publish=false to only stage a draft the user can review and publish from the theme editor. If the theme editor already holds an unpublished draft, the change is layered on that draft, so publishing also publishes it. With publish=false the result's draftVariables is what was saved and variables is what the site still renders.
Call get_theme first to see the current values. Every color value must be a CSS color (a hex value, rgb(), hsl(), oklch() or color(), a CSS color name, or var(--name)); a change with any other color is refused before anything is saved.
Supports appearance, radius, scaling, font (defaultFontFamily, headingFontFamily), color (accent, background, gray, accentScale, grayScale, accentSurface, accentContrast), spacing (array), fontSize, fontWeight, lineHeight, headingLineHeight, letterSpacing, container, icon (style: regular, thin, light, bold, fill or duotone; the style the editor's icon picker, suggestions and new sections use for new icons; existing icons keep theirs and nothing on the live site changes).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| publish | No | Publish after saving so the change is live on the site (default true). false stages a draft only. | |
| themeId | Yes | The theme ID | |
| projectId | Yes | The project ID | |
| variables | Yes | Theme variables to update. Send only the fields you want to change; omitted fields are preserved. Pass nested objects like { color: { accent: '#FF5C00' } } to update specific tokens without affecting others. |