Projects

Update a project member

  • Sandbox: available
  • Staging: available
  • Production: unknown
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

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 }'

Authorization

bearer
headerAuthorizationBearer <JWT>

Path Parameters

membershipId*string

Id of the ProjectMembership.

Request Body

application/json
  1. body
admin*boolean
access?array<>
Itemsitems <= 100
versionId?string
Length1 <= length

Response Body

The updated member.

application/json
  1. response
id*string
email*string
displayName*string
firstName*string
lastName*string
admin*boolean
profileType*string
Value in"Practitioner""Patient""RelatedPerson"
profileId*string
pending*boolean
invitedAt*string
emailVerified*boolean
Example Request
curl -X PATCH 'https://api.sandbox.ovok.com/v1/projects/me/members/string' \  -H 'Content-Type: application/json' \  -d '{  "admin": true}'
Example Response
{  "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' ```