Delete user
Delete user using Ovok’s Slim API.
| Method | Path |
|---|---|
DELETE | /v1/slim/user/:profileType/:profileId |
Authentication · Access policies
Removes a practitioner from a project: deletes their membership and practitioner profile, and their user account when this was their last membership. Use it to offboard a team member.
Auth: Bearer token for a practitioner, project admin or System Owner session. The caller's access policy must grant Practitioner:delete (project admins skip this check).
Scope: The practitioner's project must be the caller's project (from the token) or a direct child of it.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
profileType | "Practitioner" | Yes | Profile type. Only Practitioner is accepted. |
profileId | string (uuid) | Yes | Id of the practitioner to remove. |
Behaviour
-
The removal appears in change history as an
Accessrow with keyuserRemoved. See the key catalogue. -
profileTypemust bePractitionerandprofileIda UUID. -
The account is found through the practitioner's membership. When no membership, user or project can be resolved for the id, the route answers 404.
-
The membership, the practitioner and, when it has no other membership, the user are deleted together or not at all.
-
The owner of the caller's own project cannot be deleted. The owner of a child project can.
-
If another change to the same account is still running, the request fails with 409 and nothing is deleted. Retry.
-
After the delete, an account-deletion email is sent to the user's email address, if they have one. A failed email does not fail the request.
-
Returns
{ "success": true }.
Example
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/user/Practitioner/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
-H "Authorization: Bearer ${OVOK_TOKEN}"Successful response
200 — User deleted successfully.
{
"success": true
}| Field | Type | Description |
|---|---|---|
success | boolean | Always true. A failed delete returns an error status instead. |
Errors
| Status | Meaning |
|---|---|
400 | The FHIR server refused the delete. |
401 | The bearer token is missing or invalid. |
403 | The session is not a practitioner, admin or System Owner session, its access policy lacks Practitioner:delete, the practitioner is outside the caller's project and its direct children, or the practitioner owns the caller's project. |
404 | No account matches the profile. |
409 | Another change to the same account is in progress. |
422 | profileType or profileId fails validation. |
500 | The delete failed unexpectedly, or failed and could not be fully rolled back. |
503 | Your access policy could not be read, or the service is temporarily over capacity. Retry shortly, and honour Retry-After when it is present. |
Last updated on