Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


ELI5: How do I disable a user in Confluence using a rest API

Hey all

I'm trying to automate as much of my life as possible so I want to disable users via a script. I just can't seem to figure out why I can't get any joy on disabling users in my confluence space. The command I'm running is as follows

curl -i -H "Authorization: Bearer <TOKEN>" -X PUT --data '{"active":"false"}' https://<URL>/rest/api/user?username=<username> --header 'Content-Type: application/json' --header 'Accept: application/json'

And I've tried a bunch of different variations but I cant get any joy


Explain like I'm 5: How do I make it work?

1 answer

1 accepted

3 votes
Answer accepted
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 03, 2022

Hi @Mark Robbins .
Welcome to the Atlassian Community :)

Currently there's no REST API to deactivate a user on Confluence.
See CONFSERVER-56205 and CONFSERVER-54928 for future reference on this feature.

As a workaround you may want to use the legacy RPC API methods for it.

You may need to do the following:

  1. Turn off secure administrator sessions.
  2. Enable the remote API .
  3. Run the API call below, making the necessary changes on the parameters.




curl -s \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "jsonrpc" : "2.0", "method" : "'${JSON_RPC_METHOD}'", "params" : ["'${TARGET_USERNAME}'"], "id": 7 }' \


On the above I'm using basic authentication with username and password.
You can change it to the access token authentication as you mentioned.

Let me know if that works.


Kind regards,
Thiago Masutti

Hey @Thiago Masutti 

Thanks for coming back to me. That's probably not gonna work out in my environment unfortunately. 

I assume that in the SQL db there is something flagging that the user is active yes? something that could be modified or deleted to switch the user to inactive?


Kind Regards 


Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 17, 2022

Hi @Mark Robbins

if I get it right the question is how to deactive an user via database.
While it is reported to be possible - it is agains best practise and on top it seems a restart of Confluence is needed.

Not that I would promote that route, there has been a similar discussion here in Community:

You could check if this is what you are after.


It worked for me - I just loop inside a bash script and it cleaned 3k users in 2--25 minutes.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events