// Delete the user even if they still have files in their account
client.users.delete('123', {force: true})
.then(() => {
// deletion succeeded — no value returned
});
client.users.rollOutOfEnterprise(userId: "33333") { (result: Result<User, BoxSDKError>) in
guard case let .success(user) = result else {
print("Error removing user from enterprise")
return
}
print("User \(user.name) successfully removed from enterprise")
}
There are also two optional parameters that may be set when deleting a user
account:
force: Whether the user should be deleted even if the account still has content in it.
notify: Whether the user will receive a notification that the account was deleted.
The delete user request will fail if the user account still has content in
it. To resolve this, either
transfer all files or folders
to another account or use the optional force parameter.