---
title: UserGroups
description: The User Groups resource allows an admin to query which groups a particular user belongs to. The only supported method is query
component: pingam
version: 8.1
page_id: pingam:entity-reference:sec-amster-entity-usergroups
canonical_url: https://docs.pingidentity.com/pingam/8.1/entity-reference/sec-amster-entity-usergroups.html
section_ids:
  sec-amster-entity-usergroups-realm-ops: Realm Operations
  sec-amster-entity-usergroups-realm-ops-query: query
  sec-amster-entity-usergroups-realm-ops-updatememberships: updateMemberships
---

# UserGroups

## Realm Operations

The User Groups resource allows an admin to query which groups a particular user belongs to. The only supported method is query

Resource path:

```
/users/{user}/groups
```

Resource version: `1.0`

### query

Query the user's groups

**Usage**

```
am> query UserGroups --realm Realm --filter filter --user user
```

**Parameters**

* *\--filter*

  A CREST formatted query filter, where "true" will query all. Fields that can be queried: \[\*]

* *\--user*

  The User Groups resource allows an admin to query which groups a particular user belongs to. The only supported method is query

### updateMemberships

**Usage**

```
am> action UserGroups --realm Realm --body body --user user --actionName updateMemberships
```

**Parameters**

* *\--body*

  The resource in JSON format, described by the following JSON schema:

  ```json
  {
    "$schema" : "http://json-schema.org/draft-04/schema#",
    "description" : "",
    "title" : "User groups schema",
    "type" : "object",
    "properties" : {
      "groups" : {
        "type" : "array",
        "title" : "Name",
        "description" : "The name of the group",
        "items" : {
          "type" : "string"
        }
      }
    }
  }
  ```

* *\--user*

  The User Groups resource allows an admin to query which groups a particular user belongs to. The only supported method is query
