Skip to main content

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 required

List 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

NameTypeDescription
idstringWhen 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 required

Create a new design system theme.

Body Parameters

NameTypeDescription
namestringHuman-readable theme name. Defaults to "Untitled Theme".
variantsRecord<string, Record<string, string>>Named variant map — e.g. { "default": { "--color-primary": "#6366f1" } }. Takes precedence over variables.
variablesRecord<string, string>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 required

Update 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

NameTypeDescription
idstringID of the theme to update.
namestringNew display name for the theme.
variantsRecord<string, Record<string, string>>Replaces the entire variant map. Use this to update multiple variants at once.
variablesRecord<string, string>Flat variable map to merge into a specific variant. Requires variantName.
variantNamestringTarget 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 required

Delete 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

NameTypeDescription
idstringID of the theme to delete.
Request body
{  "id": "thm_abc123"}
Response
{  "ok": true}