Skip to main content
The Theme Management APIs allow you to manage themes in Halo CMS, including installation, activation, configuration, and upgrades.

Theme Listing

List Themes

Retrieve a list of themes with optional filtering.
curl -X GET "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes?page=0&size=20" \
  -H "Authorization: Bearer {token}"
page
integer
default:"0"
Page number. Default is 0.
size
integer
default:"0"
Size number. Default is 0.
uninstalled
boolean
Whether to list uninstalled themes
labelSelector
array
Label selector. e.g.: hidden!=true
fieldSelector
array
Field selector. e.g.: metadata.name==halo
items
array
Array of theme objects
page
integer
Current page number
size
integer
Size of each page
total
integer
Total number of themes
totalPages
integer
Total number of pages

Fetch Activated Theme

Retrieve the currently activated theme.
curl -X GET "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/-/activation" \
  -H "Authorization: Bearer {token}"
theme
object
The currently activated theme object
metadata.name
string
Theme identifier
spec.displayName
string
Display name of the theme
spec.version
string
Theme version

Theme Installation

Install Theme (File Upload)

Install a theme by uploading a ZIP file.
curl -X POST "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/install" \
  -H "Authorization: Bearer {token}" \
  -F "file=@/path/to/theme.zip"
theme
object
The installed theme object
metadata.name
string
Theme identifier
spec.displayName
string
Display name of the theme
spec.version
string
Theme version
spec.author
object
Theme author information

Install Theme from URI

Install a theme from a remote URL.
curl -X POST "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/-/install-from-uri" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "uri": "https://example.com/themes/my-theme.zip"
  }'
uri
string
required
URL of the theme ZIP file to install
theme
object
The installed theme object

Theme Activation

Activate Theme

Activate a theme by name.
curl -X PUT "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/activation" \
  -H "Authorization: Bearer {token}"
name
string
required
Theme name to activate
theme
object
The activated theme object

Theme Configuration

Fetch Theme Setting

Retrieve the setting schema for a theme.
curl -X GET "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/setting" \
  -H "Authorization: Bearer {token}"
name
string
required
Theme name
setting
object
The theme setting schema

Fetch Theme Config

Retrieve the current configuration values for a theme.
curl -X GET "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/json-config" \
  -H "Authorization: Bearer {token}"
name
string
required
Theme name
config
object
JSON configuration object for the theme

Update Theme Config

Update the configuration of a theme.
curl -X PUT "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/json-config" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "primaryColor": "#007bff",
    "layout": "grid",
    "showSidebar": true
  }'
name
string
required
Theme name
config
object
required
Configuration object with key-value pairs

Reset Theme Config

Reset the theme configuration to default values.
curl -X PUT "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/reset-config" \
  -H "Authorization: Bearer {token}"
name
string
required
Theme name
configMap
object
The reset configuration object

Theme Operations

Reload Theme

Reload theme settings.
curl -X PUT "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/reload" \
  -H "Authorization: Bearer {token}"
name
string
required
Theme name to reload
theme
object
The reloaded theme object

Invalidate Theme Cache

Invalidate the theme template cache.
curl -X PUT "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/invalidate-cache" \
  -H "Authorization: Bearer {token}"
name
string
required
Theme name

Theme Upgrades

Upgrade Theme (File Upload)

Upgrade a theme by uploading a new ZIP file.
curl -X POST "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/upgrade" \
  -H "Authorization: Bearer {token}" \
  -F "file=@/path/to/theme-v2.zip"
name
string
required
Theme name to upgrade

Upgrade Theme from URI

Upgrade a theme from a remote URL.
curl -X POST "http://localhost:8091/apis/api.console.halo.run/v1alpha1/themes/{name}/upgrade-from-uri" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "uri": "https://example.com/themes/my-theme-v2.zip"
  }'
name
string
required
Theme name to upgrade
uri
string
required
URL of the new theme version ZIP file
theme
object
The upgraded theme object

Build docs developers (and LLMs) love