{"record":{"id":"78deddc6310d7c7c","repo":"phacility/phabricator","slug":"the-value-for-parameter-s-is-not-valid-json-al","errorCode":null,"errorMessage":"The value for parameter '%s' is not valid JSON. All parameters must be encoded as JSON values, including strings (which means you need to surround them in double quotes). Check your syntax. Value was: %s.","messagePattern":"The value for parameter '(.+?)' is not valid JSON\\. All parameters must be encoded as JSON values, including strings \\(which means you need to surround them in double quotes\\)\\. Check your syntax\\. Value was: (.+?)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/conduit/controller/PhabricatorConduitAPIController.php","lineNumber":665,"sourceCode":"\n    $params = $request->getArr('params', null);\n    if ($params !== null) {\n      foreach ($params as $key => $value) {\n        if ($value == '') {\n          // Interpret empty string null (e.g., the user didn't type anything\n          // into the box).\n          $value = 'null';\n        }\n        $decoded_value = json_decode($value, true);\n        if ($decoded_value === null && strtolower($value) != 'null') {\n          // When json_decode() fails, it returns null. This almost certainly\n          // indicates that a user was using the web UI and didn't put quotes\n          // around a string value. We can either do what we think they meant\n          // (treat it as a string) or fail. For now, err on the side of\n          // caution and fail. In the future, if we make the Conduit API\n          // actually do type checking, it might be reasonable to treat it as\n          // a string if the parameter type is string.\n          throw new Exception(\n            pht(\n              \"The value for parameter '%s' is not valid JSON. All \".\n              \"parameters must be encoded as JSON values, including strings \".\n              \"(which means you need to surround them in double quotes). \".\n              \"Check your syntax. Value was: %s.\",\n              $key,\n              $value));\n        }\n        $params[$key] = $decoded_value;\n      }\n\n      $metadata = idx($params, '__conduit__', array());\n      unset($params['__conduit__']);\n\n      return array($metadata, $params, true);\n    }\n\n    // Otherwise, look for a single parameter called 'params' which has the","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/conduit/controller/PhabricatorConduitAPIController.php#L647-L683","documentation":"When parameters arrive console-style as array fields (params[key]=value), Phabricator JSON-decodes each value individually. If json_decode() returns null for a value that is not the literal string 'null', the value is not valid JSON and this exception is raised, echoing the offending key and raw value. Bare, unquoted strings are the classic cause.","triggerScenarios":"In the Conduit API Console, entering a string parameter as phabricator instead of \"phabricator\"; unbalanced quotes or braces in a parameter value; copying a value from documentation that strips the surrounding quotes.","commonSituations":"First-time console users assuming parameters are plain form text; hand-editing the params textarea of a previously working console call and accidentally removing quotes around one value.","solutions":["Surround every string value in double quotes so it is a valid JSON value.","Paste the whole params blob into a JSON linter before submitting the console call.","For programmatic calls, build params with a real JSON encoder instead of string concatenation."],"exampleFix":"// before (console params box)\n{\"name\": phabricator}\n// after\n{\"name\": \"phabricator\"}","handlingStrategy":"validation","validationCode":"// Browser console: validate the params box before submitting the call.\ntry {\n  const parsed = JSON.parse(document.querySelector('textarea[name=\"params\"]').value);\n  // Each top-level value must also be a valid JSON *value* (strings quoted).\n} catch (e) {\n  alert('Params are not valid JSON: ' + e.message);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat every string in the console params box as a quoted JSON string.","Run the params blob through a JSON linter before clicking Call Method.","For repeated testing, save the last known-good params JSON and edit incrementally."],"tags":["conduit","json","parameters","console","phabricator"],"backgroundTag":"json-parse-error","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}