# DEFAULT_PRACTITIONER_ACCESS_POLICY

Canonical page: https://docs.ovok.com/settings-and-features/settings/default-practitioner-access-policy

The AccessPolicy that a new practitioner receives when Ovok creates their account on your behalf: through self-registration, a business-email sign-up, or one of the invitation routes.

| | |
| --- | --- |
| Type | Text setting |
| Change with | `PUT /v1/project/settings/values/DEFAULT_PRACTITIONER_ACCESS_POLICY` |
| Value | `AccessPolicy/<id>` of an AccessPolicy **in this project**, or `null` to remove it |
| Who can change it | Project admin |
| When unset | Routes that need it refuse with `409`; others create the practitioner without a policy |
| Set on new projects | Not set by any project-creation route |
| Inherited | No. A child project reads only its own value. |

## Why it exists [#why-it-exists]

A project membership with no AccessPolicy is not limited by one. For that reason Ovok will not create a practitioner without a policy where it can avoid it: registration, business-email sign-up and the patient and practitioner invitations all refuse until this setting resolves to a valid policy. Set it once, to a policy that holds only what a brand-new practitioner should be able to do.

## Set it [#set-it]

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

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

| Response | Meaning |
| --- | --- |
| `422` with `code` [`INVALID_SETTING_VALUE`](/errors/invalid-setting-value) | The value is not `AccessPolicy/<id>`, no such policy exists, or the policy belongs to another project. |
| `400` with `code` [`UNKNOWN_SETTING`](/errors/unknown-setting) | The key is misspelled. The body lists `acceptedKeys`. |
| `403` | The caller is not a project admin. |
| `409` | The project changed during the write. Read the settings again and retry. |

The check is strict on purpose: a policy from another project is never accepted, so a setting cannot grant access that the project does not own.

## Where Ovok reads it [#where-ovok-reads-it]

| Route | What it does with the policy | When it is missing or invalid |
| --- | --- | --- |
| `POST /v1/auth/tenant/Practitioner/register` | Gives it to the new practitioner. | `409`, `error` [`practitioner_registration_not_configured`](/errors/practitioner-registration-not-configured) |
| `POST /v1/auth/tenant/Patient/register` with [business-email sign-ups](/settings-and-features/settings/clinician-invite-on-business-email) on | Gives it to the invited clinician. | Falls back to a normal patient registration, silently. |
| `POST /v1/invites/record-share` with `recipient` `practitioner`, and `/accept` (formerly `/v1/invites/practitioner`) | Gives it to the invited practitioner. | `409`, `error` [`invitation_not_configured`](/errors/invitation-not-configured) |

Two invitation routes do **not** read it:

- `POST /auth/invite` with `type` `Practitioner` creates a practitioner with no AccessPolicy.
- `POST /v1/slim/invite/practitioner` uses the `accessPolicyId` you send in the request.

## Gotchas [#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 practitioners who already have an account.** It applies to practitioners created afterwards.
- **A set but broken value does not fall back.** If the policy is deleted or cannot be read, routes behave as if the setting were unset. They do not try the older setting below.
- **The reader is more forgiving than the writer.** Ovok will read a bare id that was stored by hand, but `PUT` requires the `AccessPolicy/` prefix.
- **Error identifiers are not in one field.** [`practitioner_registration_not_configured`](/errors/practitioner-registration-not-configured) and [`invitation_not_configured`](/errors/invitation-not-configured) are in `error`; [`INVALID_SETTING_VALUE`](/errors/invalid-setting-value) and [`UNKNOWN_SETTING`](/errors/unknown-setting) are in `code`.

## Older setting: CLINICIAN_INVITE_ACCESS_POLICY [#older-setting-clinician_invite_access_policy]

Projects that configured clinician invitations before this setting existed may have `CLINICIAN_INVITE_ACCESS_POLICY`. Ovok uses it only when `DEFAULT_PRACTITIONER_ACCESS_POLICY` is absent or blank. It is written the same way (`PUT /v1/project/settings/values/CLINICIAN_INVITE_ACCESS_POLICY`) and follows the same validation. New integrations should set only `DEFAULT_PRACTITIONER_ACCESS_POLICY`.

## Business-email sign-ups [#business-email-sign-ups]

With [`CLINICIAN_INVITE_ON_BUSINESS_EMAIL`](/settings-and-features/settings/clinician-invite-on-business-email) on, a patient registration with a work email invites that person as a **practitioner** and gives them this policy. If the policy is missing or invalid the invitation does not go out and the person is registered as a patient, silently. See that page for the full list of requirements.

## Related [#related]

- [Access policies](/access-policies)
- [Invite a project admin](/invitations/team-members)
- [Practitioner registration](/authentication/practitioner-registration)
- [Set up your project](/authentication/project-setup#4-give-new-users-an-accesspolicy)
- [PRACTITIONER_REGISTRATION_ENABLED](/settings-and-features/settings/practitioner-registration-enabled)
- [PRACTITIONER_INVITATION_ENABLED](/settings-and-features/settings/practitioner-invitation-enabled)
- [PRACTITIONER_APP_URL](/settings-and-features/settings/practitioner-app-url)
