# Update a Compliance Group

## PUT /v2/admin/usergroups/{groupId}/assignments/{userId}

> Assign a group to the 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/usergroups/{groupId}/assignments/{userId}":{"put":{"summary":"Assign a group to the user","parameters":[{"schema":{"type":"string"},"name":"sessionToken","description":"Session authentication token.","in":"header","required":true},{"schema":{"type":"string"},"name":"groupId","description":"URL-Safe encoded Group ID","in":"path","required":true},{"schema":{"type":"integer","format":"int64"},"name":"userId","description":"Session authentication token.","in":"path","required":true}],"responses":{"200":{"description":"Group assigned successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroupAssignmentResponse"}}}},"201":{"description":"User Group assignment response object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroupAssignmentResponse"}}}},"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: Either the group or the user cannot be found.","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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroupMembershipUpdate"}}},"required":true}}}},"components":{"schemas":{"UserGroupAssignmentResponse":{"description":"User Group assignment response object","type":"object","properties":{"id":{"type":"string","description":"Assignment ID"},"groupId":{"type":"string","description":"Group ID"},"group":{"type":"object","$ref":"#/components/schemas/GroupRoleScope"},"userId":{"type":"integer","format":"int64","description":"User ID"},"user":{"type":"object","$ref":"#/components/schemas/UserCompp"},"userRoles":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean","description":"Group membership status"},"lastAddedDate":{"type":"integer","format":"int64","description":"Date of group membership last added"},"lastRemovedDate":{"type":"integer","format":"int64","description":"Date of group membership last removed"}}},"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"}}},"Error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}},"UserGroupMembershipUpdate":{"description":"User Group membership update object","type":"object","properties":{"active":{"description":"Group membership status","type":"boolean"}}}}}}
```

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rest-api.symphony.com/main/compliance-barrier-groups/compliance-group-assignments/update-a-compliance-group.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
