Settings

DEFAULT_PATIENT_ACCESS_POLICY

The AccessPolicy Ovok gives to new patients, how to set it, which routes read it, and what happens when it is missing.

The AccessPolicy that a new patient receives when Ovok creates their account: through self-registration or a care invitation.

TypeText setting, stored as the project's defaultPatientAccessPolicy field
Change withPUT /v1/project/settings/values/DEFAULT_PATIENT_ACCESS_POLICY
ValueAccessPolicy/<id> of an AccessPolicy in this project, or null to remove it
Who can change itProject admin
When unsetPatient registration and patient invitations are refused
Set on new projectsNot set by any project-creation route
InheritedNo. A child project reads only its own value.

Why it exists

A project membership with no AccessPolicy is not limited by one. For that reason Ovok will not create a patient without a policy: registration and the care invitation refuse until this setting is set. Set it once, to a policy that holds only what a brand-new patient should be able to do, such as reading and writing their own records.

Set it

curl --request PUT \
  --url 'https://api.sandbox.ovok.com/v1/project/settings/values/DEFAULT_PATIENT_ACCESS_POLICY' \
  --header "Authorization: Bearer ${OVOK_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{"value":"AccessPolicy/patient-policy-id"}'

The response is the full settings record; the value appears under values. Send {"value":null} to remove it.

ResponseMeaning
422 with code INVALID_SETTING_VALUEThe value is not AccessPolicy/<id>, no such policy exists, or the policy belongs to another project.
400 with code UNKNOWN_SETTINGThe key is misspelled. The body lists acceptedKeys.
403The caller is not a project admin.
409The project changed during the write. Read the settings again and retry.

To write the policy itself, see access policies and the policy model.

Where Ovok reads it

RouteWhat it does with the policyWhen it is missing
POST /v1/auth/tenant/Patient/registerGives it to the new patient.403 Registration is not enabled for this project., the same answer as when the switch is off
POST /v1/invites/care (formerly /v1/invites/patient)Gives it to a patient account it creates for a new email address.409, error invitation_not_configured

GET /v1/project/settings also reads it: while it is missing or names a policy that cannot be read, PATIENT_REGISTRATION_ENABLED reports false, and while it is missing, PATIENT_INVITATION_ENABLED reports false, whatever was saved.

Gotchas

  • A parent's policy id does not work in a child project. Creating a child with POST /v1/slim/project/child copies the parent's AccessPolicies under new ids. Read the child's own policies and use those ids.
  • Changing it does not touch patients who already have an account. It applies to patients created afterwards.
  • Off and "not configured" look the same on registration. Both answer 403 with the same message. If you did not turn registration off, check this setting first.

Last updated on

On this page