Is there an api to set the primary group for a user

Thanks for the pointer – I tried using it – I updated the primary_group_name, primary_group_id, and even the groups array entry for it [‘primary_group’] = true – I get a 200 back when I call update_user – using the gem, but no dice yet. I’ll take a closer look tomorrow, see if there is some indication of what’s going wrong. I didn’t see anything obvious though.

this is the code I ran and got back a 200 code from the server:

client = DiscourseApi::Client.new("https://myforumurl.example.com")
client.api_key = 'an api key with global permissions for testing this'
client.api_username = 'my admin username -- I think this doesnt matter though'
user = client.user('joepowell')
user['primary_group_name'] = 'dojo'
user['primary_group_id'] = 42
# this is group 42 in the groups array
user['groups'][2]['primary_group'] = true
client.update_user('joepowell', user)