How to delete user using rest api?

ayushi May 31, 2020

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 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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events