Trying to use the API to create a site


I’m trying to use curl to create a new site.

curl -v --data “?module=API&method=SitesManager.addSite&” https://myserver/matomo/

I get a code 302 from this, with a redirect

location: index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

Is there a way to see what has gone wrong?

Using v3.8.1 on PHP 7.3.


I’m pretty sure the --data parameter of curl shouldn’t start with ?.


thanks, I fixed it by just using “normal” curl requests.
Also found the examples near the top of the page.

I’ll rewrite my perl/shell conglomerate into perl and use libwww…

1 Like