Office 365 provides more and more extension points available as REST services. Recently, I was working with the control that allows to manage the themes. The official documentation presents 3 endpoints that allow to list, add and delete theme (https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-theming/sharepoint-site-theming-rest-api), the endpoints are:
Method allows to add tenant theme. As an argument, it accepts JSON with 2 properties: theme name and palette specifies the theme’s colors.
Method allows to delete theme. As an argument, it accepts the theme name.
Method lists all available themes and returns them in the form of ThemingOptions object.
Below I present two additional endpoints that are not officialy announced in the docs (you have to consider using theme on your production environment), but can really useful to bring more possibilities to your solutions:
Method allows to apply theme to the site.
Method allows to update the existing theme defition.
[2019-01-15]: I have created a PR to update the official docs.
I have created a service class that allows to work with O365 themes that can be used in SPFx projects.
In the next post, I will share some thoughts about forcing immediate inheritance of the themes in the connected sites. Stay tuned!