v1

latestOpenAPI 3.0.42026-08-068161,1253.1 MB
Groups

Assign Role Group Membership

Assigns a specific role to a user within a group. If the user already holds the specified role, no action is taken.

post/cloud/v2/groups/{group_id}/memberships/{membership_id}:assignRole

Path parameters

group_idstring required

The group ID.

membership_idstring required

The membership ID.

Request body

rolestring required

The resource path of the role to assign.

Format: groups/{group_id}/roles/{group_role_id}

Example request

{
  "role": "groups/123/roles/456"
}

Response

OK

pathstring

The resource path of the group membership.

Format: groups/{group_id}/memberships/{group_membership_id}

createTimestring date-time

The timestamp when the group membership was created.

updateTimestring date-time

The timestamp when the group membership was last updated.

userstring

The resource path of a member of the group.

rolestring

The resource path of the member's highest-ranked role. When the member holds multiple roles, this reflects only the highest-ranked one. Prefer using the roles field, which always contains the complete set of assigned roles.

rolesstring[]

The resource paths of all roles assigned to the group member. This is the recommended field for reading a member's roles, as it always contains the complete set of roles held by the member.

Example response

{
  "path": "groups/123/memberships/123",
  "createTime": "2023-07-05T12:34:56Z",
  "updateTime": "2023-07-05T12:34:56Z",
  "user": "users/21557",
  "role": "groups/7/roles/99513316"
}