---
title: "POST /v1/{+name}:modifyMembershipRoles"
method: POST
path: "/v1/{+name}:modifyMembershipRoles"
tags: ["groups"]
---

# POST /v1/{+name}:modifyMembershipRoles

`POST /v1/{+name}:modifyMembershipRoles`

Modifies the `MembershipRole`s of a `Membership`.

## Path parameters

- `name` string, required

## Request body

- ModifyMembershipRolesRequest — The request message for MembershipsService.ModifyMembershipRoles.
  - `addRoles` MembershipRole[] — The `MembershipRole`s to be added. Adding or removing roles in the same request as updating roles is not supported. Must not be set if `update_roles_params` is set.
    - `name` string — The name of the `MembershipRole`. Must be one of `OWNER`, `MANAGER`, `MEMBER`.
    - `expiryDetail` ExpiryDetail — The `MembershipRole` expiry details.
      - `expireTime` string, google-datetime — The time at which the `MembershipRole` will expire.
    - `restrictionEvaluations` RestrictionEvaluations — Evaluations of restrictions applied to parent group on this membership.
      - `memberRestrictionEvaluation` MembershipRoleRestrictionEvaluation — The evaluated state of this restriction.
        - `state` 'STATE_UNSPECIFIED' | 'COMPLIANT' | 'FORWARD_COMPLIANT' | 'NON_COMPLIANT' | 'EVALUATING' — Output only. The current state of the restriction
  - `removeRoles` string[] — The `name`s of the `MembershipRole`s to be removed. Adding or removing roles in the same request as updating roles is not supported. It is not possible to remove the `MEMBER` `MembershipRole`. If you wish to delete a `Membership`, call MembershipsService.DeleteMembership instead. Must not contain `MEMBER`. Must not be set if `update_roles_params` is set.
  - `updateRolesParams` UpdateMembershipRolesParams[] — The `MembershipRole`s to be updated. Updating roles in the same request as adding or removing roles is not supported. Must not be set if either `add_roles` or `remove_roles` is set.
    - `fieldMask` string, google-fieldmask — The fully-qualified names of fields to update. May only contain the field `expiry_detail.expire_time`.
    - `membershipRole` MembershipRole — A membership role within the Cloud Identity Groups API. A `MembershipRole` defines the privileges granted to a `Membership`.
      - `name` string — The name of the `MembershipRole`. Must be one of `OWNER`, `MANAGER`, `MEMBER`.
      - `expiryDetail` ExpiryDetail — The `MembershipRole` expiry details.
        - `expireTime` string, google-datetime — The time at which the `MembershipRole` will expire.
      - `restrictionEvaluations` RestrictionEvaluations — Evaluations of restrictions applied to parent group on this membership.
        - `memberRestrictionEvaluation` MembershipRoleRestrictionEvaluation — The evaluated state of this restriction.
          - `state` 'STATE_UNSPECIFIED' | 'COMPLIANT' | 'FORWARD_COMPLIANT' | 'NON_COMPLIANT' | 'EVALUATING' — Output only. The current state of the restriction

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/cloudidentity.md) · [All operations](https://skmtc.net/google/apis/cloudidentity/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/cloudidentity/versions/179b4eeed5a2/schema)
