Share an Item or a View via Automation or the API

I would like to share a filter view or individual records with an external partner. This should be done either via an automation or an API call.