Invite a Practitioner to the project
- Sandbox: available
- Staging: available
- Production: unknown
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
emailis trimmed and lowercased.firstNameandlastNamedefault toNewandMember;admindefaults tofalse.- 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 legacyCLINICIAN_DASHBOARD_URL, then your request'sOriginwhen CORS allows it, then the deployment default). The response haspending: trueandexistingAccount: 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.
accesssets the membership'saccess[]entries. Each must name an AccessPolicy of this project. Withaccess, the membership's baseaccessPolicyis the project'sDEFAULT_PRACTITIONER_ACCESS_POLICYsetting.- A member with this email already exists on the project: 409. Setting
accesson a project with no default practitioner access policy: 409invitation_not_configured. No practitioner app URL resolves: 409app_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 }'bearerAuthorizationBearer <JWT>application/json- body
email*stringemail1 <= lengthfirstName*string1 <= lengthlastName*string1 <= lengthadmin*booleanaccess?array<>1 <= items <= 100The newly-added project member (pending until they set a password).
application/json- response
id*stringemail*stringdisplayName*stringfirstName*stringlastName*stringadmin*booleanprofileType*string"Practitioner""Patient""RelatedPerson"profileId*stringpending*booleaninvitedAt*stringemailVerified*booleanexistingAccount*booleancurl -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}'{ "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' ```