Invites

Accept a practitioner's care invite

  • Sandbox: available
  • Staging: available
  • Production: unknown
POST
/v1/invites/care/accept

The signed-in patient accepts a practitioner's invite into their care from a PATIENT_ASSIGNMENT_REQUEST email. From then on their whole record is shared with the inviting practitioner.

Auth: bearer token of a Patient. Scope: the caller's project (from the token).

Behaviour

  • Send the invite and code values from the email's accept link as inviteId and code.
  • Gates: practitioner sharing must be on for the project, and PATIENT_INVITATION_ENABLED must not be false.
  • Only the patient the invite names can accept it. The invite is single use and expires 7 days after it was sent.
  • On success the invite's Consent becomes active and a grant for the caller's record is added to the practitioner's membership, in one atomic write. The practitioner's cached sessions are refreshed.
  • The practitioner gets the access described on POST /v1/invites/record-share/accept: the patient's whole compartment, with no delete.
  • The share lasts until the patient ends it (DELETE /v1/patient-sharing/shares/{consentId}).
  • A 409 with practitioner_without_access_policy means the practitioner has full project access, which a share would narrow.

Example

curl -X POST 'https://api.sandbox.ovok.com/v1/invites/care/accept' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \  -H 'Content-Type: application/json' \  -d '{    "inviteId": "c3499c27-2973-0a7f-807e-fb8676a92dcb",    "code": "<code from the accept link>"  }'

Authorization

bearer
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
inviteId*string
Formatuuid
code*string
Length16 <= length <= 128

Response Body

The practitioner share that started.

application/json
  1. response
consentId*string
sharer*
practitioner*
startedAt*string
endsAt*string
Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/invites/care/accept' \  -H 'Content-Type: application/json' \  -d '{  "inviteId": "14ca54c2-5d85-4c93-81b5-495a2e7e0ca4",  "code": "stringstringstri"}'
Example Response
{  "consentId": "string",  "sharer": {    "patientId": "string",    "name": "string"  },  "practitioner": {    "practitionerId": "string",    "name": "string"  },  "startedAt": "string",  "endsAt": "string"}

Invite a patient into my care POST

A signed-in practitioner invites a patient into their care, by email. A new address gets a patient account whose record is already shared with the inviter; a patient of the project gets an invite to accept. **Auth:** bearer token of a Practitioner. **Scope:** the caller's project (from the token). ## Behaviour - **Gates**, checked before the address is looked up, in this order: - practitioner sharing (`practitionerSharingEnabled` on `PUT /v1/patient-sharing/settings`) is on; it is off by default; - `PATIENT_INVITATION_ENABLED` is not `false`; - the project has a patient app URL; - the project has a default patient access policy; - the inviter's membership has an access policy (a membership with full project access is refused, because a share would narrow it); - the inviter has fewer than 20 pending invites. - **What happens, by address:** - No User has the address: a patient account of the project is created with the default patient access policy, and its record is shared with the inviter, in one atomic write. The address gets a `PATIENT_INVITE` email with a set-password link on the patient app. - The address belongs to exactly one active patient of the project: a pending invite is created and the address gets a `PATIENT_ASSIGNMENT_REQUEST` email with an accept link, `<patient app URL>/accept-invite?invite=<inviteId>&code=<code>`, valid for 7 days. The share starts only when that patient, signed in, posts both values to `POST /v1/invites/care/accept`. - The patient already shares their record with the inviter: nothing is sent, unless their account has no password yet, in which case the set-password email goes out again. - Anything else (a User that is not a patient of this project): nothing is written or sent. - The answer is always `202 { "status": "sent" }`, whichever case applied, so it does not reveal whether the address has an account. If the email cannot be sent, everything the invite wrote is undone, and the answer is still 202. - Each email is sent as the last step of the write. Map the email templates named above in the project's email configuration first. - Do not enable practitioner sharing in projects whose practitioners use the carehub dashboard: its route guard checks resource types only, so a practitioner who only holds shared patients could see project-wide data there. - A 409 with `app_url_not_configured` means the project has no patient app URL; `invitation_not_configured` means it has no default patient access policy; `practitioner_without_access_policy` means the inviter has full project access. None of these is fixed by retrying. - A 429 means the practitioner already has 20 pending invites. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/invites/care' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "email": "max.mustermann@example.com", "firstName": "Max", "lastName": "Mustermann" }' ```

Get Pulsene MQTT settings POST

Returns the MQTT connection settings for a Pulsene MC01 device. The device calls this route on startup to learn which broker to connect to. **Auth:** None at the HTTP level (no bearer token). The body must carry an `apiKey` that matches the key the device firmware ships with. A wrong or missing key is rejected with 401. ## Behaviour - The body must contain `serialNumber` (non-empty string) and `apiKey` (non-empty string). - Ovok does not look the device up. Any serial that passes the key check receives the same response shape: `mqtt.clientId` is the serial you sent, `username` and `password` are the fixed MC01 broker credentials, and `url` is the broker URL configured for the environment. - `wifi` and `pairing` are not returned for this device family. - The route answers `200`. It does not write anything. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/iot-device/pulsene/setup' \ -H 'Content-Type: application/json' \ -d '{ "serialNumber": "<serial>", "apiKey": "<device-api-key>" }' ```