With Matomo Cloud
Current call will return the visits/ hits aggregate by url :
https://xxxx.matomo.cloud/index.php?module=API&format=JSON&idSite=4&flat=1&filter_limit=100&period=range&date=2023-04-04,2023-05-05&method=API.getProcessedReport&apiModule=Actions&apiAction=getPageUrls&token_auth=xxx
Is there way to add a custom dimension to filter the result ?