This is achieved by unsharing the components of a workspace. Take a look at IUnshareOperation which also allows you to specify whether to delete the content in the filesystem when you unshare the component.
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means.
Learn more here.