Skip to main content

Invitations

Registration lets people create their own account. Invitations let you, or a patient, bring someone in. Three routes do it, and they do different jobs: pick by who is calling and what should exist afterwards.

I want to…Who callsRoutePage
Add a colleague to my projectA project adminPOST /v1/projects/me/membersInvite a team member
Let a clinician see my recordA patientPOST /v1/invites/practitionerShare a record with a practitioner
Onboard a patient and see their recordA practitionerPOST /v1/invites/patientInvite a patient

The first creates a project membership. The other two create a data share: one patient's record becomes reachable by a practitioner. They are not interchangeable. An admin cannot use the two share routes to bring in a colleague, and a patient cannot use the members route at all.

How they differ​

Team memberShare with practitionerInvite a patient
CallerProject adminPatientPractitioner with an AccessPolicy
CreatesA practitioner membershipA practitioner who holds the patient's recordA patient whose record the inviter holds
Answer200 with the new member202 { "status": "sent" }, always202 { "status": "sent" }, always
Existing addressGets a membership, no emailGets an offer to accept, by emailGets an invite to accept, by email
Needs sharing switched onNoYesYes
LastsUntil the member is removedUntil the patient ends the shareUntil the patient ends the share

What the project needs​

Every invitation depends on project settings. The setup is the same idea as sign-in and registration: decide deliberately, and do not rely on defaults.

SettingUsed byWhen unset
PRACTITIONER_INVITATION_ENABLEDTeam member; share with practitionerOn
PATIENT_INVITATION_ENABLEDInvite a patientOn
PRACTITIONER_APP_URLEvery link sent to a practitionerFalls back; see the page
PATIENT_APP_URLEvery link sent to a patientFalls back; invitations answer 409 if nothing resolves
DEFAULT_PRACTITIONER_ACCESS_POLICYA new practitioner's policyRoutes that need it answer 409
Default patient AccessPolicyA new patient's policyRoutes that need it answer 409
practitionerSharingEnabled, set with PUT /v1/patient-sharing/settingsBoth share routesOff

Sharing is off by default. The two share routes refuse every call until an admin turns it on.

Before you turn sharing on. With it on, a signed-in patient can create a practitioner account for a new address, and a practitioner can create a patient account. Each new practitioner receives your default practitioner AccessPolicy, so make sure it gives a new practitioner nothing a patient should not hand out. Do not turn it on in a project whose practitioners use the Ovok care dashboard: a practitioner who only holds shared patients could see project-wide data there.

An invitation is an email with a link, and the link points at your app, built on the matching app URL.

LinkShapeYour app must
Set a password<app URL>/setpassword/<id>/<secret>Serve a page where the person chooses a password, then send them to sign in.
Accept an invitation<app URL>/accept-invite?invite=<inviteId>&code=<code>Sign the person in, then post inviteId and code to the matching accept route.

Each email is rendered from a template that must be mapped to one of yours first, and whose provider must be ready: INVITE_TO_PROJECT for team members, PRACTITIONER_INVITED_BY_PATIENT and PRACTITIONER_PATIENT_SHARED for patient-to-practitioner shares, and PATIENT_INVITE and PATIENT_ASSIGNMENT_REQUEST for patient invitations. See Email templates and the parameters each one carries.

If an invitation's email cannot be sent, the invitation is undone, but the routes report it differently:

RouteWhat you see
POST /v1/projects/me/members500 Failed to send invite email. Please add the user manually if the issue persists. Nothing was created.
POST /v1/invites/practitioner and /patientStill 202. Nothing was created and nothing was sent.

Limits and shared behaviour​

  • A share invitation is single use and expires 7 days after it is sent.
  • A patient may hold at most 20 pending practitioner offers, and a practitioner at most 20 pending patient invitations. The next answers 429.
  • Every route here needs a bearer token, and the project comes from the token.

Next​

  1. Invite a team member
  2. Share a record with a practitioner
  3. Invite a patient
  4. Email templates, which choose what each invitation email says