Skip to content

Deleting users and groups

Deleting users and groups uses a similar pattern to the retrieval operations. For this you can use static methods provided by the AtlanUser and AtlanGroup classes.

All delete operations are permanent

All delete operations on users and groups are permanent, hard-deletes. There is no way to archive (soft-delete) users and groups.

Delete a group

0.0.13 1.3.3 4.0.0

For example, to delete a group:

Delete a group
1
AtlanGroup.delete(client, "e79cb8eb-2bb6-4821-914c-f8dfd21fedc7"); // (1)
  1. To delete a group, you must specify its GUID and can simply call the AtlanGroup.delete() method. Because this operation will remove the group from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Delete a group
1
2
3
4
from pyatlan.client.atlan import AtlanClient

client = AtlanClient()
client.group.purge("e79cb8eb-2bb6-4821-914c-f8dfd21fedc7") # (1)
  1. To delete a group, you must specify its GUID and can simply call the group.purge() method.
Delete a group
1
AtlanGroup.delete(client, "e79cb8eb-2bb6-4821-914c-f8dfd21fedc7") // (1)
  1. To delete a group, you must specify its GUID and can simply call the AtlanGroup.delete() method. Because this operation will remove the group from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Delete a group
1
ctx.GroupClient.Purge("a99f50bc-46bf-4d08-a987-3411ef5cfc33") // (1)
  1. To delete a group, you must specify its GUID and can simply call the GroupClient.Purge() method.
POST /api/service/groups/e79cb8eb-2bb6-4821-914c-f8dfd21fedc7/delete
1
// (1)
  1. All details are in the URL itself.

    Group ID in the URL

    Note that you must provide the unique ID (GUID) of the group to delete it.

Delete a user

0.0.16

Irreversible operation that requires admin user's bearer token

Deleting a user is irreversible — be certain you want to fully remove the user and all references to the user (their ownership of assets, workflows, and so on) before running this operation. This operation can only be done using an admin user's bearer token, not an API token.

Delete a user
1
2
3
4
5
6
7
8
response, atlanErr := ctx.UserClient.RemoveUser(
    "test-user-1", 
    "test-user-2", 
    "test-user-3",
) // (1)
if atlanErr != nil {
    logger.Log.Errorf("Error deleting user: %v", atlanErr) // (2)
}
  1. Call the ctx.UserClient.RemoveUser() method with the following parameters :

    • userName: The username of the user to be removed ("test-user-1" in this example).
    • transferToUserName: The username of the user to whom the assets should be transferred ("test-user-2" in this example).
    • wfCreatorUserName (optional): The username of the workflow creator ("test-user-3" in this example). If nil, it defaults to transferToUserName.
  2. If an error occurs during the deletion, it will be logged.

Note: A user can only be removed if they have fewer permissions than an admin. An admin cannot remove another admin.