Sub Project

Create a sub tenant

  • Sandbox: available
  • Staging: available
  • Production: unknown
POST
/sub-project

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

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" }'

Request Body

application/json
  1. body
name*string
Length1 <= length
extension?unknown
parentProjectId?string
Formatuuid

Response Body

The sub tenant was created successfully.

application/json
  1. response
success*true
Value intrue
projectId?string

Id of the new project. Present only when the caller is a client application.

Example Request
curl -X POST 'https://api.sandbox.ovok.com/sub-project' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "success": true,  "projectId": "string"}

List project relationships GET

Returns where your current project sits in the project hierarchy: its parent and its direct children. **Auth:** bearer token of a project admin (`ProjectMembership.admin`). **Scope:** the caller's project (from the token). ## Behaviour - `parentProjectId` is `null` for a project with no parent. - `subProjectIds` lists direct children only. - The result is cached for up to 5 minutes. Creating or deleting a child through Ovok clears the cache; other changes can take that long to show. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/internal/sub-project' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```

List project relationships GET

Returns where your current project sits in the project hierarchy: its parent and its direct children. **Auth:** bearer token of a project admin (`ProjectMembership.admin`). **Scope:** the caller's project (from the token). ## Behaviour - `parentProjectId` is `null` for a project with no parent. - `subProjectIds` lists direct children only. - The result is cached for up to 5 minutes. Creating or deleting a child through Ovok clears the cache; other changes can take that long to show. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/internal/sub-project' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```