Is there any way to deactivate unmanaged accounts?

Related to: API REST /manage/lifecycle/disable and response 401 (you are unauthentificated)

Is there any way to deactivate the unmanaged accounts?
The both Restcalls below are failed:
https://admin.atlassian.com/gateway/api/adminhub/um/org/00j8dc92-9cb8-17d7-65c4-kb317bb61kd2/users/635f467db7b39379d7209a11/deactivate
Output:

{
    "code": 401,
    "message": "Unauthorized"
}

https://api.atlassian.com/users/635f467db7b39379d7209a11/deactivate
Output:

{
    "code": 401,
    "message": "Unauthorized"
}

Welcome to the Atlassian developer community @AhmetKilic,

https://admin.atlassian.com/gateway/api/adminhub/um/org/...

That’s not a public API. You should not expect that to work for you.

https://api.atlassian.com/users/...

That is a public API but you haven’t given us enough information to know what might be going wrong:

  • Did you use HTTP POST per the documentation on deactivate a user?
  • Did you provide the API key as a bearer token in the Authentication header?
  • Are you an org admin for your company?

Hi ibuchanan,

thanks for your quick response.
I would deactivate the unmanaged users.
I was org admin and yes, l provided the API key as a bearer token in the Authentication header.

Atlassian Support let me know that is currently not possible over RestApi. Or do you have any tricks?:blush:

Best,
Ahmet KILIC

@AhmetKilic,

Well, who am I to argue with our own support. Except I’m quite confused because this REST API says it does exactly what you want:

https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/#api-users-account-id-manage-lifecycle-disable-post

Neither of your prior examples had that particular path. Have you tried it?

Hi @ibuchanan,

I’m happy to specify the open questions again here:

  • Did you use HTTP POST per the documentation on [deactivate a user → Yes
  • Did you provide the API key as a bearer token in the Authentication header? → Yes
  • Are you an org admin for your company? → Yes

Furthermore, I used the following endpoint:

curl --request POST --url 'https://api.atlassian.com/users/XYZ/manage/lifecycle/disable

Thereby it worked to disable managed user.
When trying to disable unmanaged users I get the above error message from Ahmet.

The Admin REST API documentation (https://developer.atlassian.com/cloud/admin/user-management/rest/intro/#about) also states that only managed users can be customized in an organization.

“Use this REST API to administer and edit the managed accounts in your organization by account ID. You can find the account ID for a user with get users in an organization.”

Many greetings
Alex

1 Like