# Method: spaces.members.patch

- [HTTP request](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#body.request_body)
- [Response body](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#body.aspect)
- [Try it!](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members/patch#try-it)

Updates a membership. For an example, see [Update a user's membership in a space](https://developers.google.com/workspace/chat/update-members).

Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):

- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and the authorization scope:

  - `https://www.googleapis.com/auth/chat.app.memberships` (only in spaces the app created)
- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:

  - `https://www.googleapis.com/auth/chat.memberships`
  - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)
  - User authentication grants administrator privileges when an administrator account authenticates, `useAdminAccess` is `true`, and the following authorization scope is used:
    - `https://www.googleapis.com/auth/chat.admin.memberships`

### HTTP request

`PATCH https://chat.googleapis.com/v1/{membership.name=spaces/*/members/*}`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `membership.name` | `string` Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}` |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Required. The field paths to update. Separate multiple values with commas or use `*` to update all field paths. Currently supported field paths: - `role` |
| `useAdminAccess` | `boolean` Optional. When `true`, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.memberships` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). |

### Request body

The request body contains an instance of `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#Membership`.

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#Membership`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/chat.app.memberships`
- `https://www.googleapis.com/auth/chat.admin.memberships`
- `https://www.googleapis.com/auth/chat.import`
- `https://www.googleapis.com/auth/chat.memberships`

For more information, see the [Authorization guide](https://developers.google.com/workspace/chat/authenticate-authorize).