Skip to main 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 group

For example, to delete a group:

Delete a group
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 user

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.

Go

Delete a user
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 can't remove another admin.

Was this page helpful?