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
Next: Root
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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello all,
I need to disable 900 Atlassian cloud users, I followed https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-lifecycle-disable-post
I generated the API token for myself and using in a python script to test it, but I am getting error "{"code":401,"message":"Unauthorized"}". I have site admin access as well as directory admin access. I am able to disable the users via Atlassian portal. My token is also showing as valid in portal.
My code:
import requests
import json
url = "https://api.atlassian.com/users/FirstName.LastName@MyCompany.com/manage/lifecycle/disable"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer MyApiToken"
}
payload = json.dumps( {
"message": "Disabling Users who have left Company"
} )
response = requests.request(
"POST",
url,
data=payload,
headers=headers
)
print(response.text)
Hi @Balaji Shinde , did you follow the instructions here to generate your API token? https://confluence.atlassian.com/cloud/create-an-admin-api-key-969537932.html
It's important to understand that the organization API key is not the same as a personal API key.
Hi @Balaji Shinde ,
This is the API you're looking for api-group-Users , although there isn't a way of deactivating users in cloud at the moment.
Authenticating to this you'll use your username and api token as the password.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @edwin I think @Balaji Shinde has the correct API, this is indeed a new API that we provide to organization administrators for deactivating accounts across all Atlassian products. Deactivating accounts for users that have left the company is the type of scenario it's designed for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gotcha, thanks for the clarification @Dave Meyer !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.