
Provisioning Account asked a question.
Hi ShareFile,
We currently have an API integration to automatically create ShareFile accounts for temporary 30 day usage which works great.
At the end of the usage we want to be able to delete an account along with all its shared data.
At this moment we perform following calls
1) Disable the user
PATCH /Users?Id=
2) Downgrade employee to client
POST /Users/Employees/Downgrade
=> In the body we provide mandatory ReassignItemsToId + ReassignGroupsToId to a separate "backup account"
3) Delete client
POST /Users/Clients/BulkDelete
A this moment all Items & Groups get re-assigned which still consumes lots of data. Goal would be in our process the data gets either destroyed first or after they are re-assigned.
Can you please suggest an approach an which API calls we can make to destroy the shared data?
Do we best perform this BEFORE the downgrade & mandatory re-assignment, or should we do it after?
We are looking ShareFile recommended / best practice advice for a future-proof approach.
Thank you!
Hello!
Thanks for reaching out.
Since your goal is to ultimately remove both the user and their associated data, there are a couple of approaches you could take.
One important consideration is that ShareFile requires ownership to be reassigned when a user owns content or groups. As a result, some form of reassignment will need to occur as part of the process.
You could delete content before downgrading the employee user, but this can become more complex because Personal Folders cannot be removed prior to reassignment. In practice, this means performing content cleanup both before and after the reassignment.
For that reason, the simpler approach is typically to perform the required reassignment first and then remove the content afterward. Once ownership has been transferred to your designated "backup" account, you can identify and permanently remove the reassigned content.
A common workflow would be:
You may also be able to simplify your workflow by eliminating the employee-to-client conversion entirely. Rather than:
You could delete the employee user directly while still satisfying the ownership reassignment requirements:
This performs the reassignment and user deletion in a single operation. You can then perform the content cleanup against the reassignment account using the process described above.
From a long-term maintenance perspective, the "reassign first, then clean up" approach is generally the simplest to automate, as it centralizes ownership transfer into a single step and allows content removal to occur in a predictable, repeatable manner afterward.
Please let us know if you have any questions about implementing either approach.