pipedrive更新使用php,curl和REST处理put / post请求

I'm trying to update a deal in pipedrive CRM using the API. What I'm trying to do is to update the owner of a deal to a new user. But this is not successful.

docs

Here is my code:

$deal_id = 31811; //the id of the add that i want to update

$deal = array(
    "user_id" => 1858654, //the id of the user that will be the new owner
    "stage_id" => 1 //the stage id where the deal should be
);

$api_token = "x";
$url = "https://api.pipedrive.com/v1/deals/".$deal_id."?api_token=" . $api_token;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $deal);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

Here is the returned error.

array (
  'url' => 'https://api.pipedrive.com/v1/deals/31811?api_token=X',
  'content_type' => NULL,
  'http_code' => 0,
  'header_size' => 0,
  'request_size' => 0,
  'filetime' => -1,
  'ssl_verify_result' => 1,
  'redirect_count' => 0,
  'total_time' => 0.32900000000000001,
  'namelookup_time' => 0,
  'connect_time' => 0.157,
  'pretransfer_time' => 0,
  'size_upload' => 0,
  'size_download' => 0,
  'speed_download' => 0,
  'speed_upload' => 0,
  'download_content_length' => -1,
  'upload_content_length' => -1,
  'starttransfer_time' => 0,
  'redirect_time' => 0,
  'redirect_url' => '',
  'primary_ip' => 'x.x.x.x',
  'certinfo' => 
  array (
  ),
  'primary_port' => x,
  'local_ip' => 'x.x.x.x',
  'local_port' => x,
)error occured during curl exec. Additioanl info: