Configuring Kibana darkMode via API Call

Is there an API call you can do against the Kibana endpoint to setup the darkMode to the default space?

The following POST command gives an error status code 409:

curl -w '%%{http_code}\n' -u "${elasticadmin_user}:${elasticadmin_password}" -X POST -v $KIBANA_URL/api/saved_objects/config/${kibana_version} \
-H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
-d '{"attributes": {"theme:darkMode": true}}'

I'm using Kibana v7.12.0 - the ${kibana_version} variable is set to '7.12.0' in this request.

I just changed the settings in Kibana -> Advanced Settings and looked in the developer console to see what was going on and below is what it was doing.

POST http://localhost:5601/api/kibana/settings

body {"changes":{"theme:darkMode":false}}

This doesn't seem like the correct way to do it but it also doesn't look like it's part of the documented API. So.... ya, it works but use at your own risk and could break in future versions.

works well! Thank you @aaron-nimocks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.