Projects

List current project members

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

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

curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/members?page=0&count=20' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Authorization

bearer
headerAuthorizationBearer <JWT>

Query Parameters

accessPolicyId?string
Length1 <= length
profileId?string
Length1 <= length
userId?string
Length1 <= length
page?string
Default"0"
count?string
Default"20"

Response Body

Paginated Practitioner memberships (max 100 per page).

application/json
  1. response
total*number
Range0 <= value
page*number
Range0 <= value
count*number
Range1 <= value
resources*array<>
Example Request
curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/members'
Example Response
{  "total": 0,  "page": 0,  "count": 1,  "resources": [    {      "membershipId": "string",      "userId": "string",      "profile": {        "reference": "string",        "display": "string"      },      "accessPolicy": {        "reference": "string",        "display": "string"      },      "admin": true    }  ]}

List administered projects GET

Lists every project you administer, with the tenant code you need to switch to it. Every other `/v1/projects` route answers about the single project of your token; use this one to build a project picker. **Auth:** bearer token. The caller must be a Practitioner, a project admin, or hold the System Owner access policy. You do not need to be an admin of your current project. **Scope:** your own user's Practitioner memberships across all projects, kept only where the membership is an admin one. ## Behaviour - One row per project, in membership order, even when you hold two memberships on one project. - `page` (from 0, default 0) and `count` (1 to 100, default 20) page over the projects. `total` counts the projects you administer, not your memberships. - `tenantCode` is `null` for a project that has none. `name` is `null` when the project can no longer be read; the row is kept. - `isMainProject` is `true` for a project with no parent, `false` for a child, and `null` when the hierarchy could not be read. - `parentProjectId` is set only when the parent is also a project you administer; otherwise it is `null`. - To switch, pass `tenantCode` to `POST /v1/auth/tenant/Practitioner/login/token`. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/projects?page=0&count=20' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```

Invite a Practitioner to the project POST

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