GHE management via API

I’ve been asked to review our GHE appliance to look at suspended users (i.e. people who have left our LDAP servers, but still have now inaccessible GHE accounts), their repositories (private and public), and the amount of storage they’re consuming.  

I can do this manually my generating csv reports from the site admin menu and reports button, but I was hoping to be able to do this in a repeatable automated form. So I looked at the API. 

Is there a way to get information about all the repo’s? Or all of a users repo’s (public and private)?  Or, if not, is there a way to trigger or download the ‘all respositories’ and ‘suspended users’ reports? I can’t find any references to this sort of thing in the api documention. 



Hi @wembleyford2,

Thank you for being here and my sincere apologies for the delayed response. 

The suspended users report can be accessed programmatically, using:

curl -L -u username:password http(s)://hostname/stafftools/reports/suspended_users.csv 

I hope this helps!