Adding/removing users to/from groups

as per the API documentation, you can update the groups property using

PATCH /api/v2/users/{userId}

So, I did that with this content

{
  "groups": [
    {
      "type": "official",
      "name": "name of an existing group"
    }
  ],
  "version": version_of_the_user
}

The operation passes just fine, returns the user object, with it's groups property still empty. So, how do I update the groups property on the user?

I'm now trying the other way outlined here hoping I'll get where I want to go. But if even the API explorer lists the groups property as updateable, how do I change the assigned groups that way?

There are four required fields and you're only providing two;

Gosh, you're right. Unfortunately, adding the additional two parameters doesn't work either. I'm now sending

{"version":5,"groups":[{"type":"official","visibility":"public","name":"name of my group - HC","rulesVisible":true}]}

Same result as before - HTTP 200, but the groups property is not filled out and a subsequent GET on the user shows the same picture. I also checked the group membership using the groups API which shows the same picture: nothing was done.

The alternative approach using the groups API works. But it seems the user PATCHING doesn't work. Plus, I'd argue that if I leave out required fields, I should get an HTTP 400 back telling me I left out a required field. I've seen this behavior when I do a search when I don't provide a required field (e.g. the type in a SearchCriteria)

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.