List sub-projects
| Method | Path |
|---|---|
GET | /v1/sub-project |
Returns the id of your current project, the id of its parent and the ids of its direct sub-projects. Use it to find out which projects hang below yours, for example after you create one.
The same route also answers at /sub-project, without /v1.
Auth: Bearer token of a project admin, meaning the membership of the caller in the token's project is an admin one. A practitioner who is not an admin is refused. Scope: The caller's project (from the token).
Request
No parameters.
Behaviour
currentProjectIdis the project in your token.parentProjectIdis the project yours is a sub-project of, ornullwhen yours has no parent.subProjectIdslists direct children only. Grandchildren are not included.- The list is not paged and has no cap. It is empty when the project has no sub-projects.
- The ids come from the parent-child records, and the route does not read the projects themselves. It returns ids, not names. For project details use
GET /v1/slim/project/child, which also allows practitioners who are not admins. - The result is kept for up to 5 minutes. Creating or deleting a sub-project with
POST /v1/sub-projectorDELETE /v1/sub-project/:subProjectIdrefreshes it at once. Other changes to the hierarchy can take up to 5 minutes to show. - No access policy permission is checked beyond the admin role.
Example
curl -X GET 'https://api.sandbox.ovok.com/v1/sub-project' \
-H "Authorization: Bearer ${OVOK_TOKEN}"
Successful response
200 — The project's place in the hierarchy.
{
"currentProjectId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21",
"parentProjectId": null,
"subProjectIds": [
"8c5e7a21-4b9d-4f36-a1c8-0d2e6b9f3a54",
"5d2a9c64-7e1b-4830-b6f5-9a3c1e8d7b02"
]
}
| Field | Type | Description |
|---|---|---|
currentProjectId | string (uuid) | The project in your token. |
parentProjectId | string (uuid) | null | The parent project. null when the project has no parent. |
subProjectIds | string[] | Ids of the direct sub-projects. Empty array when there are none. |
Errors
| Status | Meaning |
|---|---|
400 | The session carries no project. |
401 | Bearer token is missing, invalid, revoked or expired. |
403 | The caller is not an admin of the project in the token. |
429 | Too many requests. Retry after a short wait. |