A user (apf) reported a 422 error when trying to update a group’s watching_category_ids via the Discourse REST API, even though no update_existing_users parameter was included. The server mistakenly flagged this as an invalid parameter. zogstrip explained the endpoint’s design — it warns staff about affected users and requires an explicit update_existing_users flag. The error message was improved, and zogstrip clarified that the value must be the lowercase string “true”, not a boolean. apf confirmed the fix works when passing update_existing_users: True (in Python, which serializes to “true”) outside the group object in the JSON payload. The issue was resolved with improved documentation and backend handling in PR #37184.
Yeah, that endpoint is a little odd. We wanted to warn staff members about the number of potentially affected users and offer them the ability to choose between applying the change retroactively or not.
That’s why you’re seeing the “{ 'user_count': 2, ... }” in the response from the server.
I’ve clarified the error message so it makes more sense and also improved the front-end code to better handle this “use case” as well as adding specs
Unfortunately I’m still confused: I need to set the value for the watching_category_idsfor a given group, and even if the error message now is changed, it’s still a 422 error. So how can I update the group with the new list of watching_category_ids via a script using the rest-API ?
I have already tried to add "update_existing_users”=True in the json data of the PUT call, the error was the same as reported.
(and just for reference, the "update_existing_users”=True has to be outside/parallel to the “group” item in the json sent over (shown here in Python syntax, so True gets translated to the string “true”):