Delete records example:

<?php
$params = array(
  'key' => 'MjBm7iKWaEubxvLvVW1lF5HFbrWzOFILh216iGKJ',  
  'username' => 'admin',
  'password' => 'admin',
  'action' => 'delete',
  'entity_id' => 21, 
  'delete_by_field' => ['id'=>40],
);
 						                                    
$ch = curl_init('http://localhost/rukovoditel/product_2.5/api/rest.php');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);			
$result = curl_exec($ch);
curl_close($ch);

if($result)
{
  $result = json_decode($result,true);
}

 

Field Description
entity_id ID of the entity from which the data will be deleted
delete_by_field The field on which the record will be deleted. You can delete a record by ID or by field value, for example, delete all records with a specific status.
Примеры  
'delete_by_field' => ['id'=>37] Delete records where ID = 37
'delete_by_field' => ['id'=>[37,38]], Delete record where ID 37 and 38
'delete_by_field' => ['field_156'=>34] Delete records where field number 156 is set to 34