# Update a project member

Canonical page: https://docs.ovok.com/api/projects/update-a-project-member

`PATCH /v1/projects/me/members/{membershipId}`

Changes a Practitioner member of your current project: their admin flag, their `access[]` entries, or both.

**Auth:** bearer token of a project admin (`ProjectMembership.admin`).
**Scope:** the caller's project (from the token). A membership of another project answers 404.

## Behaviour

- `admin`: `true` or `false` sets the flag; `null` leaves it as it is.
- `access`: replaces the membership's `access[]` entries; an empty array removes them. Omit it to leave them as they are. Each entry must name an AccessPolicy of this project. A membership without a base `accessPolicy` cannot have its entries removed, because Medplum would then grant access to the whole project.
- `versionId`: pass the `meta.versionId` you read. If the membership changed since, the request answers 409. A concurrent write that lands first also answers 409.
- A request that changes nothing returns the member unchanged.
- Demoting the last admin of the project is refused.
- After the change, Ovok renews its cached session data for every session of the member. Medplum applies the change on the member's next request.

## Example

```bash
curl -X PATCH 'https://api.sandbox.ovok.com/v1/projects/me/members/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{ "admin": true }'
```
