
Hi @Мария Михальская ,
As far as I know, currently, there are no other Graph APIs that implement file sharing other than direct invitations and sharing links. As a workaround, I recommend you use the following methods to remove a specific user access to a SharePoint list item via REST API:
1.You have to break the inheritance from the parent which can be done using the below endpoint:
_api/web/lists/getByTitle(<List Title>)/items/getById(<Item id>)/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)
2.Find the permission level ID.
_api/web/roledefinitions/getByName('contribute')
3.Get the user id.
4.Remove user permissions from the list item
<siteUrl>/_api/web/lists/getbytitle('<listName>')/items(<ID>)/roleassignments/removeroleassignment(principalid=<userID>,roleDefId=1073741827)
Similar issues for reference:
Remove Specific User Access to a SharePoint List Item
How to remove specific user from item level permission through Rest API
Hope it can help you. Thanks for your understanding.
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.