Skip to main content

Theme

The theme endpoints expose everything the Theme Editor controls as one JSON document: the template and base theme, brand colors, fonts, dark mode, the hero (text, background media, colors), buttons, homepage sections, the footer, brand images, the per-template settings, the editable front-end labels, the submitter panel and the raw DaisyUI CSS variables. A write goes through the same save path as the editor’s Save button and is live at once. This is what lets an AI assistant restyle a directory: the MCP server exposes these endpoints as the get_theme, update_theme and preview_theme tools, and the CLI as directify theme.
Always read the theme first. The response carries an options block with the valid values for the directory’s template — templates, themes, fonts, palettes, section keys, template settings, labels, CSS variables and languages — so you only send keys the template renders. A key the template doesn’t support returns a 422 naming the templates that do.

Get Theme

Parameters:
  • directory_id (integer, required): The ID of the directory
  • locale (string, optional): An extra language code. The hero title and subtitle, the homepage content and the labels come back as that language’s translations (see Languages).
Response:
translations is present on multilingual directories when no locale is given. The options block also carries the allowed hero_heights, logo_sizes, category_counts, map_placements, slideshow_intervals, footer_link_targets and the *_supported flags that say which groups this template renders.

Update Theme

A partial update: send only the groups and keys you want to change. Everything else keeps its value. The response is the full theme document after the change (same shape as the GET). Body (every key optional):
Errors: 422 with a message per field. Messages list the valid choices (templates, themes, fonts, section keys, template settings, CSS variables), so a wrong value can be corrected from the error alone. ?locale is rejected on writes — use translations.
A template switch changes which design row the directory renders. Colors and hero settings are stored per template, so the new template shows its own saved values (or its defaults) until you set them.

Preview (screenshot)

Captures one of the directory’s pages so you can look at the result of a change. Parameters:
  • page (string, optional): home (default), browse, categories, category, listing, blog, map or submit. category, listing and blog need at least one record.
  • width (integer, optional): viewport width 375, 768, 1280 (default) or 1440
  • locale (string, optional): an extra language code to capture that language’s pages
Response:
Captures are cached for a minute and limited to 20 per hour per account. A 422 explains why a capture wasn’t possible (the page doesn’t exist yet, or the screenshot provider is unavailable).

Example: restyle a directory