You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have around 500 users who need to be deactivated from the confluence. Is there any query to run in DB to disable or is there any possible solution via Rest API.
can someone provide suggestion on this.
Unofficially you might want to take a look in network tab of your browser, deactivate a sample user, and work with the HTTP request you see - this way you might be able to automate it with some small local automation script.
Replicating the http forms, and removing unnecessary clutter gets me to
curl 'https://confluencebaseurl.com/admin/users/deactivateuser-confirm.action' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Cookie: JSESSIONID=55B07A765493F5F108D211F0CDB36CF8' \
-H 'X-Atlassian-Token: no-check' \
confluencebaseurl - obviously
JSESSIONID - you need to get this cookie from your current session once you log in, when you log in, you get a JSESSIONID cookie which servers as your authentication, but you could replace this with PAT or basic auth
X-Atlassian-Token - I added this because the data originally contained atl_token, but since this would be automated from outside, we would not have a valid token, so this will skip the token check
testuser - the username
And locally, this seems to be working.
Alternatively you could use groovy (if you have a plugin allowing to), or write a java plugin, but if you just need to do this one time I don't see a big harm in just cracking the http form. Mind you - not official, so do test this first if it does what you expect it to.