API Reference
Themes
Themes store your design system tokens — color palettes, typography, and spacing — as named variants. Apply a theme to any frame to generate screens that match your brand.
GET
/api/v1/themes🔑 Auth requiredList all themes owned by the authenticated user, or fetch a single theme by ID.
- Pass ?id=thm_abc123 to fetch a single theme — response shape is { theme: {...} }.
- Themes belonging to other accounts return { theme: null }.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | When provided, returns a single theme object instead of the full list. |
Response
{ "themes": [ { "id": "thm_abc123", "name": "Brand Dark", "variants": { "default": { "--color-primary": "#6366f1", "--color-background": "#0f0f11", "--color-foreground": "#f4f4f5", "--font-sans": "Inter, sans-serif" } } } ]}POST
/api/v1/themes🔑 Auth requiredCreate a new design system theme.
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | No | Human-readable theme name. Defaults to "Untitled Theme". |
variants | Record<string, Record<string, string>> | No | Named variant map — e.g. { "default": { "--color-primary": "#6366f1" } }. Takes precedence over variables. |
variables | Record<string, string> | No | Flat CSS variable map. Automatically wrapped into a default variant. Use variants instead for multi-variant themes. |
Request body
{ "name": "Brand Dark", "variants": { "default": { "--color-primary": "#6366f1", "--color-background": "#0f0f11", "--color-foreground": "#f4f4f5", "--font-sans": "Inter, sans-serif" }, "light": { "--color-primary": "#4f46e5", "--color-background": "#ffffff", "--color-foreground": "#09090b" } }}Response
{ "id": "thm_abc123", "name": "Brand Dark", "variants": { "default": { "--color-primary": "#6366f1", ... }, "light": { "--color-primary": "#4f46e5", ... } }}PUT
/api/v1/themes🔑 Auth requiredUpdate an existing theme's name, replace all variants, or patch a single named variant.
- Passing variants replaces all variants. Passing variables + variantName merges into that variant only.
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the theme to update. |
name | string | No | New display name for the theme. |
variants | Record<string, Record<string, string>> | No | Replaces the entire variant map. Use this to update multiple variants at once. |
variables | Record<string, string> | No | Flat variable map to merge into a specific variant. Requires variantName. |
variantName | string | No | Target variant to patch when using variables (e.g. "light"). Required when variables is set. |
Request body
{ "id": "thm_abc123", "variantName": "default", "variables": { "--color-primary": "#7c3aed" }}Response
{ "id": "thm_abc123", "name": "Brand Dark", "variants": { "default": { "--color-primary": "#7c3aed", ... } }}DELETE
/api/v1/themes🔑 Auth requiredDelete a theme. Any frames referencing this theme will have their themeId cleared.
- Deletion is permanent. Frames that referenced this theme continue to render with their last-applied styles.
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the theme to delete. |
Request body
{ "id": "thm_abc123"}Response
{ "ok": true}