# List child project relationships

Canonical page: https://docs.ovok.com/slim-apis/project/list-child-project-relationships

| Method | Path |
| --- | --- |
| `GET` | `/v1/slim/project/child` |

[Authentication](/authentication) · [Access policies](/access-policies)

Returns your current project together with its parent project and its direct child projects. Use it to build a project switcher or hierarchy view.

**Auth:** Bearer token for a practitioner, project admin or System Owner session. The caller's access policy must grant `AccessPolicy:read` (project admins skip this check).
**Scope:** The caller's project (from the token).

## Request [#request]

No parameters.

## Behaviour [#behaviour]

- `currentProject` is the caller's project.
- `parentProject` is the project your project is a child of, or `null` when it has none.
- `childProjects` lists every direct child, with no cap. Grandchildren are not included.
- A child whose project no longer exists is left out.
- Each project carries `name` (the project id when it has none), `address`, `contact` and `settings`. `settings.timeZone` defaults to `Europe/Berlin`; `settings.trendsPeriod` defaults to `start: "09:00:00"` and `durationSeconds: 86400`.
- `GET /v2/slim/project/child` returns the same lists with a device count per project.


## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/project/child' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — Project relationships retrieved successfully.

```json
{
  "currentProject": {
      "resourceType": "Project",
      "id": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68",
      "name": "Example project",
      "address": [{ "line": ["Hauptstrasse 1"], "city": "Berlin", "postalCode": "10115", "country": "DE" }],
      "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
    },
  "parentProject": {
      "resourceType": "Project",
      "id": "c6e2a4f8-0b3d-4719-a5c7-9e1f3b5d7a20",
      "name": "Parent project",
      "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
    },
  "childProjects": [
    {
        "resourceType": "Project",
        "id": "f0a2c4e6-8b1d-4357-9f9b-1d3e5a7c9b46",
        "name": "Child project",
        "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
      }
  ]
}
```

| Field | Type | Description |
| --- | --- | --- |
| `currentProject` | `object \| null` | The caller's project. |
| `parentProject` | `object \| null` | The project the caller's project is a child of. `null` when it has none. |
| `childProjects` | `object[]` | Every direct child project. Empty array when there are none. |

Each project, in `currentProject`, `parentProject` and `childProjects`, has these fields:

| Field | Type | Description |
| --- | --- | --- |
| `resourceType` | `"Project"` | Always `Project`. |
| `id` | `string (uuid)` | Project id. |
| `name` | `string` | Project name. The project id when the project has no name. |
| `address` | `object[]` | Postal addresses of the project. Left out when there are none. Each entry has the fields `use`, `type`, `text`, `line`, `city`, `district`, `state`, `postalCode` and `country`. |
| `contact` | `object[]` | Contact persons of the project. Left out when there are none. Each entry has the fields `telecom`, `name` and `address`. |
| `settings` | `object` | Project settings. |
| `settings.timeZone` | `string` | Time zone name. `Europe/Berlin` when none is stored. |
| `settings.trendsPeriod` | `object` | The daily window that trends cover. |
| `settings.trendsPeriod.start` | `string` | Start time as `HH:MM:SS`. `09:00:00` when none is stored. |
| `settings.trendsPeriod.durationSeconds` | `number` | Length of the window in seconds. `86400` when none is stored. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`401`](/errors/unauthenticated) | The bearer token is missing or invalid, or the session carries no project. |
| [`403`](/errors/forbidden) | The session is not a practitioner, admin or System Owner session, or its access policy lacks `AccessPolicy:read`. |
