Thanks to Navin for this code snippet.
Use it for updating an existing form's JSON from PHP.
$url = "https://app.devicemagic.com/organizations/XXXX/forms/XXXXX";
$curl = curl_init($url);
$headers=array('Authorization: Basic '. base64_encode('XXXXXX:YYYY'),'Content-Type: application/json'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);