magento2 – How to update the value of an option of a product attribute programmatically?

I’m using the rest api and believe that we can’t update the value of an option of a product attribute: we only have the POST method and no PUT.

So, what would be the best to do it code? In fact, I would like to create a custom api endpoint to do that.

Thanks a lot!