there is no config API, but as you said you can (programmatically) update the config file and it gets reloaded
not sure what you want to achieve in the end, but consider that namespaces are
not isolated*
if you are looking for multi-tenancy, have a look at
https://www.ory.sh/docs/kratos/guides/multi-tenancy-multitenant or the
#ory-network