http://piwik.org/docs/analytics-api/reference/#UsersManager
http://piwik.org/docs/analytics-api/reference/#SitesManager
(and if there are some quirks in the way, file a ticket etc.)