Change environment color from API

Hi there. We’re using the environment colors as a easy way to identify which environment the editor is in. We also have automated scripts that migrate and fork data between environments.

The issue is that I couldn’t find any methods in the API to change a specific environment’s color. I see the JS and REST APIs that allow to change it site-wide, but it’s not tied to an environment. Does such feature exist right now?

Hello @flavio and welcome to the community!

You can specify the environment in the initialisation of your client: Using the Javascript client - DatoCMS

1 Like

That works. Thank you!

Hadn’t thought of instantiating a new client with the environment specified…

1 Like