# Get project device counts

Canonical page: https://docs.ovok.com/slim-apis/project/get-project-device-counts

| Method | Path |
| --- | --- |
| `GET` | `/v1/slim/project/:id/device-counts` |

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

Returns summary counts of the devices in a project: total, assigned to a resident, active and by manufacturer. Use it for project overview tiles.

**Auth:** Bearer token. The caller's access policy must grant `Device:search` and `Device:read` (project admins skip this check).
**Scope:** The project in the path. It must be the caller's project (from the token) or a direct child of it.

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Project id. Your own project or a direct child of it. |

## Behaviour [#behaviour]

- Counts come from the project's live device list, the same rows that back the live device views. That list is cached, so a device change can take a moment to show.
- A row is left out when its device, resident, location or organization belongs to another project.
- `assignedResidentDeviceCount` counts devices with a resident; `unassignedDeviceCount` is the rest.
- `activeDeviceCount` counts devices whose latest telemetry reports them active; `inactiveDeviceCount` is the rest.
- `withingsDeviceCount` counts devices whose serial number resolves to Withings. Every other device is counted in `radarDeviceCount`.
- If the device list fails to build, the last complete list is used. When there is none, the route answers 503. When there is none, the route answers 503.


## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/project/b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68/device-counts' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — Device counts retrieved successfully.

```json
{
  "projectId": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68",
  "totalDeviceCount": 14,
  "assignedResidentDeviceCount": 11,
  "unassignedDeviceCount": 3,
  "activeDeviceCount": 12,
  "inactiveDeviceCount": 2,
  "radarDeviceCount": 10,
  "withingsDeviceCount": 4
}
```

| Field | Type | Description |
| --- | --- | --- |
| `projectId` | `string (uuid)` | The project id from the path. |
| `totalDeviceCount` | `integer` | Devices in the project. |
| `assignedResidentDeviceCount` | `integer` | Devices with a resident. |
| `unassignedDeviceCount` | `integer` | Devices without a resident. |
| `activeDeviceCount` | `integer` | Devices that are currently active. |
| `inactiveDeviceCount` | `integer` | Devices that are not active. |
| `radarDeviceCount` | `integer` | Devices whose serial number does not resolve to Withings. |
| `withingsDeviceCount` | `integer` | Devices whose serial number resolves to Withings. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`400`](/errors/malformed-request) | The project is neither the caller's project nor a direct child of it. |
| [`401`](/errors/unauthenticated) | The bearer token is missing or invalid. |
| [`403`](/errors/forbidden) | The session has no profile, or its access policy lacks `Device:search` or `Device:read`. |
| [`422`](/errors/validation-failed) | `id` is empty. |
| [`503`](/errors/service-unavailable) | The device list cannot be built and no earlier complete list exists. Retry shortly. |
