Error when trying to update the watchlist for a group via API (PUT groups/{id}.json)

Priority/Severity:

medium to high

Platform:

Python script as well as cURL command line

Discourse server version:

3.6.0.beta3-latest (6adb4f8e84)

Description:

when trying to update the ‘watching_category_ids’ of an existing group, my python script (using simple “requests.put” reports the following error:

_doPut> ERROR from request:  422 Unprocessable Entity {‘user_count’: 2, ‘errors’: [‘You supplied invalid parameters to the request: update_existing_users’]}

even if there is no parameter called update_existing_users in my json data.

Using cURL to check via:

curl -k -L -X PUT -H 'api-key:xyz’ \
   -H 'api-username:system'  \
   -H 'Accept:application/json;charset=utf-8'  \
   -H 'Content-Type:application/json'   \
   --data '{"group":{"name":"eb-chair-exo","watching_category_ids":[336,337]}}' \
   https://cms-phys-talk.web.cern.ch/groups/46.json

I get the same error:

{“user_count”:2,“errors”:[“You supplied invalid parameters to the request: update_existing_users”]}%

Reproducible steps:

curl -k -L -X PUT -H 'api-key:xyz’ \
   -H 'api-username:system'  \
   -H 'Accept:application/json;charset=utf-8'  \
   -H 'Content-Type:application/json'   \
   --data '{"group":{"name":"eb-chair-exo","watching_category_ids":[336,337]}}' \
   https://cms-phys-talk.web.cern.ch/groups/46.json

edit: added discourse server version