File Share Update API Issue

im trying to update permissions of a shared file with API, it works when i pass permissions=1, but it doesnt work and says, Shares need at least read when i try to update permissions=2

$data = array(
ā€œpermissionsā€ => 1, // this works
ā€œpermissionsā€ => 2, // this doesnt work it says, Shares need at least read permissions
);
$payload = json_encode($data);
$ch = curl_init();
$headers = array();
$headers = ā€˜Content-Type: application/jsonā€™;
$headers = ā€˜Ocs-Apirequest: trueā€™;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $this->nc_url.ā€˜ocs/v2.php/apps/files_sharing/api/v1/shares/123ā€™);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ā€˜PUTā€™);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_USERPWD, 'User:Password);
$result = curl_exec($ch);