Update a project member
- Sandbox: available
- Staging: available
- Production: unknown
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:trueorfalsesets the flag;nullleaves it as it is.access: replaces the membership'saccess[]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 baseaccessPolicycannot have its entries removed, because Medplum would then grant access to the whole project.versionId: pass themeta.versionIdyou 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
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 }'bearerAuthorizationBearer <JWT>membershipId*stringId of the ProjectMembership.
application/json- body
admin*booleanaccess?array<>items <= 100versionId?string1 <= lengthThe updated member.
application/json- response
id*stringemail*stringdisplayName*stringfirstName*stringlastName*stringadmin*booleanprofileType*string"Practitioner""Patient""RelatedPerson"profileId*stringpending*booleaninvitedAt*stringemailVerified*booleancurl -X PATCH 'https://api.sandbox.ovok.com/v1/projects/me/members/string' \ -H 'Content-Type: application/json' \ -d '{ "admin": true}'{ "id": "string", "email": "string", "displayName": "string", "firstName": "string", "lastName": "string", "admin": true, "profileType": "Practitioner", "profileId": "string", "pending": true, "invitedAt": "string", "emailVerified": true}Get a project member GET
Reads one Practitioner member of your current project. **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 - `emailVerified` is `true` once the member has used an emailed set-password link, and `null` when the User cannot be read. - `pending` is always `false` on this route. - The route requires a Practitioner membership; any other membership type is refused with 400. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/members/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Remove a project member DELETE
Removes a Practitioner from your current project. **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 - Deletes the membership and its Practitioner profile. The User is deleted only when it has no other membership in any project. - All or nothing: if one delete fails, the others are undone and the request fails. - Removing the last admin of the project is refused. - The response is `{ "success": true }`. ## Example ```bash curl -X DELETE 'https://api.sandbox.ovok.com/v1/projects/me/members/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```