---
name: cumulocity-manage-dm-dashboards
description: "Create a dashboard for a device, list the dashboards of a device, check that a dashboard belongs to the device, and delete it. Use when the user wants to create, list, or delete the dashboards of a device."
compatibility: "Requires network access to a Cumulocity tenant and the C8Y_BASEURL, C8Y_TENANT, C8Y_USER, and C8Y_PASSWORD environment variables."
---

# Manage device dashboards

Source: https://cumulocity.com/docs/skills/device-management/manage-dm-dashboards/
Sector: Skills, Device management & connectivity
Release: Latest
Description: Create a dashboard for a device, list the dashboards of a device, check that a dashboard belongs to the device, and delete it.

## Before you start

Use these skills first:

- `cumulocity-authentication` skill: [Authenticate REST API requests](https://cumulocity.com/docs/skills/platform-administration/authentication/index.md)

A device dashboard is a managed object in the inventory that belongs to one device. It has the following fragments:

* `c8y_Dashboard`: The configuration of the dashboard, with its `name`, `priority`, `columns`, `widgetMargin`, and the widgets in `children`.
* `c8y_Dashboard!device!<device_id>`: An empty marker fragment. Its name contains the ID of the device.

The dashboard is a child addition of the device. You create the dashboard and assign it to the device with one request.


> **Requirements:**
> ROLES & PERMISSIONS:
>
> * To create and delete dashboards: ROLE_INVENTORY_ADMIN or ROLE_MANAGED_OBJECT_ADMIN
> * To read dashboards: ROLE_INVENTORY_READ



The examples use `<device_id>` for the ID of the device and `<dashboard_id>` for the ID of the dashboard. `<device_id>` is the ID of the managed object of the device, never its name. It appears both in the path of the request and in the name of the marker fragment.

### To create a dashboard for a device {#to-create-a-dashboard-for-a-device}

Send an [Assign a managed object as child addition](https://cumulocity.com/api/core/#operation/postManagedObjectChildAdditionsResource) request with the dashboard as body:

```http
POST /inventory/managedObjects/<device_id>/childAdditions
Content-Type: application/vnd.com.nsn.cumulocity.managedobject+json
Accept: application/json

{
  "name": "Overview",
  "c8y_Dashboard": {
    "name": "Overview",
    "priority": 10000,
    "columns": 12,
    "widgetMargin": 12,
    "children": {}
  },
  "c8y_Dashboard!device!<device_id>": {}
}
```

The `Content-Type` header `application/vnd.com.nsn.cumulocity.managedobject+json` makes the platform create the managed object and assign it as child addition of the device. The empty `children` object creates a dashboard without widgets. To add widgets, see [To edit a dashboard](https://cumulocity.com/docs/cockpit/working-with-dashboards/#to-edit-a-dashboard).

The platform returns HTTP 201 and the dashboard with its `id` and `name`. Note the `id` as `<dashboard_id>`.

If the platform returns HTTP 404, the device does not exist.

### To list the dashboards of a device {#to-list-the-dashboards-of-a-device}

Send a [Retrieve all managed objects](https://cumulocity.com/api/core/#operation/getManagedObjectCollectionResource) request with a query for the marker fragment:

```http
GET /inventory/managedObjects?query=$filter=has('c8y_Dashboard!device!<device_id>')&pageSize=100
```

The name of the marker fragment contains `!`, so put it in single quotes inside `has()`. URL-encode the whole value of the `query` parameter. The Device Management application uses the same query.

The platform returns HTTP 200. The `managedObjects` array contains the dashboards of the device. The name of each dashboard is in `c8y_Dashboard.name`.

### To check that the dashboard belongs to the device {#to-check-that-the-dashboard-belongs-to-the-device}

Send a [Retrieve all child additions of a specific managed object](https://cumulocity.com/api/core/#operation/getManagedObjectChildAdditionsResource) request:

```http
GET /inventory/managedObjects/<device_id>/childAdditions?pageSize=100
```

The platform returns HTTP 200. The `references` array contains one entry for each child addition. One of the entries has `<dashboard_id>` in `managedObject.id`.

### To delete a dashboard {#to-delete-a-dashboard}

Send a [Remove a specific managed object](https://cumulocity.com/api/core/#operation/deleteManagedObjectResource) request:

```http
DELETE /inventory/managedObjects/<dashboard_id>
```

The platform returns HTTP 204. The dashboard disappears from the child additions of the device and from the query in [To list the dashboards of a device](https://cumulocity.com/docs/skills/device-management/manage-dm-dashboards/#to-list-the-dashboards-of-a-device).


> **Info:**
> When you delete a device, its dashboards remain in the inventory. Delete them separately.



In the Device Management application, you add dashboards in the details of the device, see [Dashboard manager](https://cumulocity.com/docs/device-management-application/dashboard-manager/).

## API reference

### Core API

Reference: https://cumulocity.com/api/core/

- [POST /inventory/managedObjects/{id}/childAdditions](https://cumulocity.com/api/core/#operation/postManagedObjectChildAdditionsResource): Assign a managed object as child addition
- [GET /inventory/managedObjects](https://cumulocity.com/api/core/#operation/getManagedObjectCollectionResource): Retrieve all managed objects
- [GET /inventory/managedObjects/{id}/childAdditions](https://cumulocity.com/api/core/#operation/getManagedObjectChildAdditionsResource): Retrieve all child additions of a specific managed object
- [DELETE /inventory/managedObjects/{id}](https://cumulocity.com/api/core/#operation/deleteManagedObjectResource): Remove a specific managed object

## Linked from the documentation

- [Dashboard manager](https://cumulocity.com/docs/device-management-application/dashboard-manager/)
