When attempting to delete a user via the Delete Users endpoint with the force parameter set to true, the following error message is returned:
Status: 403 Forbidden
{
"type": "error",
"status": 403,
"code": "forbidden",
"help_url": "http://developers.box.com/docs/#errors",
"message": "User cannot be deleted due to retention policies. Please transfer user content first",
"request_id": "o0xqrhhtjjdlp3u9"
}
Root Cause
The above error occurs due the following conditions:
- the user owns contents (file/folder)
- the enterprise has a retention policy(including ones that are now retired) or a legal hold policy that has not been fully released
This is regardless of whether any of the policies actually apply to the user's content.
Resolution
Transfer the user's content to another user first by using Transfer owned folders API and then try user deletion again.
platform_swarm_kb