# List Compliance Group Memberships

## GET /v2/admin/users/{userId}/groupmemberships

> Filter and list Group Memberships for an user.

```json
{"openapi":"3.1.1","info":{"title":"Restricted Pod API","version":"20.17.1"},"servers":[{"url":"https://yourpodURL.symphony.com/pod"}],"paths":{"/v2/admin/users/{userId}/groupmemberships":{"get":{"summary":"Filter and list Group Memberships for an user.","parameters":[{"schema":{"type":"string"},"name":"sessionToken","description":"Session authentication token.","in":"header","required":true},{"schema":{"type":"integer","format":"int64"},"name":"userId","in":"path","required":true},{"schema":{"type":"string","enum":["ROLE_SCOPE","CEP_VISIBILITY_GROUP"]},"name":"groupType","in":"query","required":true},{"schema":{"type":"string"},"name":"groupId","in":"query"},{"schema":{"type":"boolean"},"name":"active","in":"query"},{"schema":{"type":"string"},"name":"expand","in":"query"},{"schema":{"type":"integer"},"name":"limit","description":"Max number of records to return.","in":"query"},{"schema":{"type":"string"},"name":"before","in":"query"},{"schema":{"type":"string"},"name":"after","in":"query"},{"schema":{"type":"string"},"name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroupMembershipResponse"}}}},"400":{"description":"Client error, see response body for further details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Session tokens invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Caller lacks necessary entitlement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found: User cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity: Error on getting memberships for an user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error, see response body for further details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"UserGroupMembershipResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserGroupMembershipResponseData"}},"pagination":{"type":"object","$ref":"#/components/schemas/Pagination"}}},"UserGroupMembershipResponseData":{"description":"User object response","type":"object","properties":{"id":{"type":"string"},"groupId":{"type":"string"},"group":{"type":"object","$ref":"#/components/schemas/GroupRoleScope"},"userId":{"type":"integer","format":"int64"},"user":{"type":"object","$ref":"#/components/schemas/UserCompp"},"active":{"type":"boolean"},"lastAddedDate":{"type":"integer","format":"int64"},"lastRemovedDate":{"type":"integer","format":"int64"}}},"GroupRoleScope":{"description":"User Group info to include in other models","type":"object","properties":{"id":{"type":"string","description":"Group ID"},"name":{"type":"string","description":"Group name"},"area":{"type":"string","description":"An optional string attribute used for categorizing groups"},"type":{"type":"string","description":"Group type"},"active":{"type":"boolean","description":"Group status"}}},"UserCompp":{"description":"Basic user information to include in other models","type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"username":{"type":"string","description":"Username"},"firstName":{"type":"string","description":"User first name"},"lastName":{"type":"string","description":"User last name"},"emailAddress":{"type":"string","description":"User email addressIntegrationUserManagerTest"}}},"Pagination":{"type":"object","required":["cursors"],"properties":{"cursors":{"type":"object","required":["before"],"properties":{"before":{"type":"string","description":"This is the opaque url-safe string that points to the start of the page of data\nthat has been returned.\n"},"after":{"type":"string","description":"This is the opaque url-safe string that points to the end of the page of data\nthat has been returned.\n"}}},"previous":{"type":"string","description":"API endpoint that will return the previous page of data. If not included, this is\nthe first page of data.\n"},"next":{"type":"string","description":"API endpoint that will return the next page of data. If not included, this is the\nlast page of data. Due to how pagination works with visibility and privacy, it is\npossible that a page may be empty but contain a 'next' paging link. Stop paging when\nthe 'next' link no longer appears.\n"}}},"Error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}}}}
```

> #### 🚧 Roles and Privileges
>
> Calling this endpoint requires the **Scope Management** role.\
> See [Bot Permissions](https://docs.developers.symphony.com/building-bots-on-symphony/configuration/bot-permissions) for a list of roles and associated privileges.

> #### 📘 Note
>
> `limit` query parameter: A query may return fewer than the value of limit due to filtering or service-side maximums. Do not depend on the number of results being fewer than the limit value to indicate your query reached the end of the list of data, use the absence of next instead as described in the following example:\
> If you set `limit` to 10 and only 9 results are returned, there may be more data available, but one item was removed due to privacy filtering. Some maximums for limit may be enforced for performance reasons.
>
> `sort` query parameter: if the name of the field is preceded by a "-", then the results will be returned in descending order, otherwise results will be returned in ascending order. For example, a sort param value of "-name" would return results sorted by the "name" field in descending order, while a value of "name" would return results sorted by the "name" field in ascending order.\
> The fields available for sorting are "lastAddedDate" and "lastRemovedDate".
