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 number. Default is 0.
Size number. Default is 0.
Whether to list uninstalled themes
Label selector. e.g.: hidden!=true
Field selector. e.g.: metadata.name==halo
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}"
The currently activated theme object
Display name of the theme
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"
The installed theme object
Display name of the theme
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"
}'
URL of the theme ZIP file to install
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}"
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}"
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}"
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
}'
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}"
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}"
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}"
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"
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"
}'
URL of the new theme version ZIP file
The upgraded theme object