Changing settings through HTTP API


I’m trying to integrate Matomo in an automated system, and for that I would need to be able to add sites to the Trusted Hosts settings without using the UI.

I’ve seen that the webpage uses this method:


with a form where it sends the field (settingValues[CoreAdminHome][0][name]: trusted_hosts) and its contents (settingValues[CoreAdminHome][0][value][]: ).

I haven’t seen any documentation regarding this way of doing it. How should I procceed if I want to modify the settings via HTTP API?