# List child projects with device counts

Canonical page: https://docs.ovok.com/slim-apis/project/list-child-projects-with-device-counts

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

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

Returns your current project together with its parent project and its direct child projects, each with its device count. Use it for a project switcher or hierarchy view that shows fleet size.

**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]

- Same lists as `GET /v1/slim/project/child`: `currentProject`, `parentProject` (`null` when there is none) and every direct child in `childProjects`. Grandchildren and children whose project no longer exists are left out.
- Every project also carries `deviceCount`: the number of `Device` resources in that project.
- `settings.timeZone` defaults to `Europe/Berlin`; `settings.trendsPeriod` defaults to `start: "09:00:00"` and `durationSeconds: 86400`.


## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v2/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",
      "deviceCount": 14,
      "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",
      "deviceCount": 120,
      "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
    },
  "childProjects": [
    {
        "resourceType": "Project",
        "id": "f0a2c4e6-8b1d-4357-9f9b-1d3e5a7c9b46",
        "name": "Child project",
        "deviceCount": 6,
        "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. |
| `deviceCount` | `integer` | Number of `Device` resources in the project. |
| `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`. |
