There is a list in which every item has unique permissions. I used this very helpful topic, where it is described how to break inheritance and create unique permissions and after that to add permissions.
I did all fine and this works great, but I have to edit unique permissions, once some action happens in list. So I have to edit permissions of item again and to change from lets say Contribute to Read level to particular user.
Example:
Item has unique permissions and one user has contribute permissions, after one of column's value is changed, I have to remove his contribute permissions and give him only read or to remove his permissions at all.
I tried standard rest call
SiteURL/_api/web/lists(guid'GUID')/items(ID)/roleassignments/addroleassignment(principalid=userID,roleDefId=1073741826)
But all I get is that that user beside Contribute permissions get Read permissions. Contribute stay, they are not removed.
Any suggestion how can I achieve what I want?