Sub Project

Delete a sub tenant

  • Sandbox: available
  • Staging: available
  • Production: unknown
DELETE
/sub-project/{subProjectId}

Deletes a child project of your current project, with the setup Ovok created for it.

Auth: bearer token of a project admin (ProjectMembership.admin). Scope: :subProjectId must be a direct child of the caller's project (from the token).

Behaviour

  • A project that still holds a Patient, Device or Location, or is the parent of another project, is refused with 409 project_not_empty. The body names the count per type in counts and the child ids in childProjectIds. Move or delete those first.
  • Otherwise the route unlinks the project from its parent, deletes its memberships, Practitioners, AccessPolicies, PlanDefinitions, ClientApplications, Organizations and tenant code in one atomic write, deletes the Project, revokes its Signals tenant and finally deletes the parent-child relationship. Audit records (Provenance, AuditEvent) are kept.
  • Users are never deleted; they may belong to other projects.
  • Retry-safe: if the Signals revoke fails, the project is already deleted and the route answers 502 signals_tenant_revoke_failed. Call it again to finish.
  • A second delete of the same project while the first runs answers 409.

Example

curl -X DELETE 'https://api.sandbox.ovok.com/v1/internal/sub-project/c3499c27-2973-0a7f-807e-fb8676a92dcb' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Path Parameters

subProjectId*string
Length1 <= length

Response Body

The sub tenant was deleted successfully.

application/json
  1. response
success*true
Value intrue
Example Request
curl -X DELETE 'https://api.sandbox.ovok.com/sub-project/string'
Example Response
{  "success": true}

Create a sub tenant POST

Creates a child project (sub-tenant) of your current project. Use it from admin tooling and from headless integrations that hold an admin client token. **Auth:** bearer token of a project admin (`ProjectMembership.admin`). Setting `parentProjectId` also requires a super admin. **Scope:** the parent is the caller's project (from the token), or `parentProjectId` for a super admin. ## Behaviour - Creates, all or nothing: the `Project` (with the standard Ovok project features, `extension` copied as given, and its own Signals tenant), its tenant code, the parent's link to it, a Practitioner and an admin membership in the new project, and the parent-child relationship. If a step fails, the steps already done are undone. - **User session:** the new project is owned by your user, the Practitioner copies your profile, and the membership is yours. The response is `{ "success": true }`. - **Client application session** (no user): the new project is owned by the parent project. The response is `{ "success": true, "projectId": "..." }`. - A concurrent create of the same name under the same parent is refused with 409 and writes nothing. A later create with the same name makes a second project. - Served at both `/v1/internal/sub-project` and `/sub-project`. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/internal/sub-project' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "My Medical Project" }' ```

Delete a sub tenant DELETE

Deletes a child project of your current project, with the setup Ovok created for it. **Auth:** bearer token of a project admin (`ProjectMembership.admin`). **Scope:** `:subProjectId` must be a direct child of the caller's project (from the token). ## Behaviour - A project that still holds a `Patient`, `Device` or `Location`, or is the parent of another project, is refused with 409 `project_not_empty`. The body names the count per type in `counts` and the child ids in `childProjectIds`. Move or delete those first. - Otherwise the route unlinks the project from its parent, deletes its memberships, Practitioners, AccessPolicies, PlanDefinitions, ClientApplications, Organizations and tenant code in one atomic write, deletes the `Project`, revokes its Signals tenant and finally deletes the parent-child relationship. Audit records (`Provenance`, `AuditEvent`) are kept. - Users are never deleted; they may belong to other projects. - Retry-safe: if the Signals revoke fails, the project is already deleted and the route answers 502 `signals_tenant_revoke_failed`. Call it again to finish. - A second delete of the same project while the first runs answers 409. ## Example ```bash curl -X DELETE 'https://api.sandbox.ovok.com/v1/internal/sub-project/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```