DIRECTORY_PROTECTED error when deleting a user’s home folder

Remove the user from the workspace, then you can delete the home folder.

Written by Gihyeon Lee

Last published at: April 7th, 2025

Problem

You are attempting to delete a user’s home folder using the Delete a workspace object (AWSAzureGCP) API when you get a “directory protected” error message.

{"error_code": "DIRECTORY_PROTECTED", "message": "Folder <user-email> is protected"}

 

Cause

Home folders are created by the system and cannot be modified as long as the user exists. This means they cannot be renamed, moved, deleted, etc. Trying to delete a home folder while the corresponding user exists in the workspace fails with an error.

 

Solution

An admin must remove the user from the workspace before attempting to delete the user’s home folder. Once a user is removed, the corresponding home folder becomes a modifiable folder and can be deleted by an admin.

Review the Manage users (AWSAzureGCP) documentation for information on removing users via the account console UI, workspace settings UI, or the API. 

After the user has been deleted, you can delete the corresponding home folder using the workspace UI or by using the delete a workspace object API.