Skip to main content

Practitioner registration

Creates a practitioner account in a tenant and signs the practitioner in straight away. It is off by default: turn it on only if you want anyone who can reach the route to become a practitioner of your project.

MethodPath
POST/auth/tenant/Practitioner/register

No bearer token is needed. The tenant is named by tenantCode.

What the project needs​

RequirementDetail
Registration switched onPRACTITIONER_REGISTRATION_ENABLED must be true. It is off when unset.
A default practitioner AccessPolicyDEFAULT_PRACTITIONER_ACCESS_POLICY must be AccessPolicy/<id> of a policy in this project. Every registered practitioner receives it.

Set the policy first, then switch registration on. The commands are in set up your project. With the switch on and no valid policy, the route answers 409 rather than creating a practitioner without limits.

Request​

curl --request POST \
--url 'https://api.sandbox.ovok.com/auth/tenant/Practitioner/register' \
--header 'Content-Type: application/json' \
--data '{
"email": "practitioner@example.com",
"password": "your-password",
"name": "Grace",
"surname": "Hopper",
"tenantCode": "big-health-company"
}'
Body fieldRequiredDescription
emailYesThe practitioner's email. Ovok lowercases it.
passwordYes1 to 128 characters. Enforce your own password rules in your app.
nameYesGiven name.
surnameYesFamily name.
tenantCodeYesThe tenant to register in.

Response​

On success the answer is the same as a finished sign-in:

Response fieldExampleMeaning
accessTokenToken stringBearer token for API calls.
refreshTokenToken stringToken used to renew the session.
expiresIn3600Access-token lifetime in seconds.
project.reference, project.displayProject/<id>, Big Health CompanyProject the tokens are for.
profile.reference, profile.displayPractitioner/<id>, Grace HopperPractitioner profile that was registered.

The account, the practitioner profile and the membership are created together or not at all. No email is sent.

What can go wrong​

Checks run in this order, so the first one that fails is the one you see.

OrderStatusResponseCause
1429More than 5 requests in a minute from the same IP address.
2422A list of path and messageA body field is missing or invalid, for example an empty password.
3404Tenant not found.The tenant code is wrong.
4403Registration is not enabled for this project.PRACTITIONER_REGISTRATION_ENABLED is not true.
5409error practitioner_registration_not_configuredRegistration is on, but there is no valid default practitioner AccessPolicy.
6409Another registration for the same email is in progress. Retry.
7400Registration failed.The email already has an account.

Gotchas​

  • The email check spans Ovok. A practitioner whose email already has an account in any project gets 400 Registration failed. The message is generic and does not say why. Add that person to your project with a practitioner invitation instead.
  • A policy that stops being valid breaks registration. If the AccessPolicy is deleted, cannot be read, or belongs to another project, step 5 returns 409 until you set a valid one. Changing the policy does not touch practitioners who already registered.
  • Registration returns tokens even when PRACTITIONER_LOGIN_ENABLED is false.
  • The new account is signed in immediately and nothing confirms the email address. Do not treat a registration as proof that the person owns the address.
  • Choose the policy with care. With the switch on, the default policy is what a stranger gets.
  • Every error takes at least a second, so a spinner is the right UI.