Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete user using rest api?

ayushi May 31, 2020 edited

used delete user api but it is still giving the user access to site.

https://******.atlassian.net/rest/api/3/user?accountId=5**********************b

status: 204 but still the user has access to site.

I am able to delete user in UI but unable to remove them using rest api.

Thanks in advance.

2 answers

0 votes
Srecko Anzic
Contributor
May 19, 2021

How to trigger the switch “Has access on site” via API in Administration > Users > User details in Access section?

We want to disable certain users access but still want to keep the user disabled in the system for next 90days(as per our policy) and in order to reassign users issues,filters… before we delete the user.

I referred to JIRA Cloud Developer REST API documentation.

I tried:
$url = “JIRA_url/user?accountId=yyy”
$body = @{
active = “False”
}
Invoke-RestMethod -Method PUT -Uri $url -Body $body

I simplified the code above to make it easier. I got the error:
Invoke-RestMethod : The remote server returned an error: (405) Method Not Allowed

0 votes
Warren
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.
June 1, 2020

Hi @ayushi 

A couple of possibilities with your question :

  • The API call that you;re using is marked as Experimental, which means it could change at any time
  • What user details are you using for the API call? According to the documentation the user requires Site Administration rights

Hope this helps

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events