Support suggested a way to export the user list (which I can filter in code to the inactive users):
To generate a list of inactive users, you can go to the User Management and click on Export Users in the top right corner, that will generate a CSV file with the users.
Then suggested the REST API to archive the spaces:
It is not possible to bulk archive Spaces, however, you could check our public Confluence Rest API page and see if you come up with something, as this would involve custom development.
The API doc isn't clear on how this could be achieved or even if it can be... I can't find anything that definitively suggests it's possible to set the status of a space, though it does seem like https://developer.atlassian.com/cloud/confluence/rest/#api-space-spaceKey-property-key-put would possibly allow this by setting the key "status" to the value "archived" - like this:
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property/status' \
--user 'email@example.com:' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"value": "archived",
"version": {
"number": 197,
"minorEdit": true
}
}'Am I on the right track here? This is the first API task I've had to do with Confluence Cloud.
Is there a better way to achieve what I'm after (which is to have inactive users' spaces not appear in search/browsing)?