Projects

Invite a Practitioner to the project

  • Sandbox: available
  • Staging: available
  • Production: unknown
POST
/v1/projects/me/members

Adds a Practitioner to your current project and emails them a link to set their password.

Auth: bearer token of a project admin (ProjectMembership.admin). Scope: the caller's project (from the token). The project setting PRACTITIONER_INVITATION_ENABLED must be on.

Behaviour

  • email is trimmed and lowercased. firstName and lastName default to New and Member; admin defaults to false.
  • Creates the User (when the address has no account yet), the Practitioner and the membership in one write.
  • The invitee is emailed a link to set a password, built on the project's practitioner app URL (the project's PRACTITIONER_APP_URL, then the parent project's, then the legacy CLINICIAN_DASHBOARD_URL, then your request's Origin when CORS allows it, then the deployment default). The response has pending: true and existingAccount: false.
  • An address that can already sign in (it has a password, or belongs to another project) gets the membership but no email, and the response has existingAccount: true.
  • If the email cannot be sent, the new account is removed again and the request fails.
  • access sets the membership's access[] entries. Each must name an AccessPolicy of this project. With access, the membership's base accessPolicy is the project's DEFAULT_PRACTITIONER_ACCESS_POLICY setting.
  • A member with this email already exists on the project: 409. Setting access on a project with no default practitioner access policy: 409 invitation_not_configured. No practitioner app URL resolves: 409 app_url_not_configured, and nothing is created.
  • Practitioner invitations disabled on the project: 403.

Example

curl -X POST 'https://api.sandbox.ovok.com/v1/projects/me/members' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \  -H 'Content-Type: application/json' \  -d '{    "email": "max.mustermann@example.com",    "firstName": "Max",    "lastName": "Mustermann",    "admin": false  }'

Authorization

bearer
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
email*string
Formatemail
Length1 <= length
firstName*string
Length1 <= length
lastName*string
Length1 <= length
admin*boolean
access?array<>
Items1 <= items <= 100

Response Body

The newly-added project member (pending until they set a password).

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
existingAccount*boolean
Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/projects/me/members' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "firstName": "string",  "lastName": "string",  "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,  "existingAccount": true}

List current project members GET

Lists the Practitioner members of your current project, one page at a time. **Auth:** bearer token. The caller must be a Practitioner, a project admin, or hold the System Owner access policy. **Scope:** the caller's project (from the token). ## Behaviour - Only memberships with a Practitioner profile are returned; patient, bot and client memberships are left out. - Filters: `accessPolicyId` (the membership's access policy), `profileId` (a Practitioner id) and `userId`. - `page` (from 0, default 0) and `count` (1 to 100, default 20) page the results. `total` is the exact number of matches. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/members?page=0&count=20' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```

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