---
title: "Create a new device and the monitors relation which connects this device to a role"
method: POST
path: "/v1/device"
tags: ["Device"]
---

# Create a new device and the monitors relation which connects this device to a role

`POST /v1/device`

A user can only execute this call is he is a member of an authorizing role which satisfies one of the following conditions:
      <ul>
        <li>
          The authorizing role has *direct or indirect* deviceManagement rights for the role for which a device is created
        </li>
        <li>
          The authorizing role has *indirect* roleManagement rights for the role for which a device is created
        </li>
      </ul>

## Query parameters

- `roleId` integer, required
- `validate` boolean

## Request body

- Def7
  - `properties` object, required

## Response `200`

The newly created device and monitors relation

- object
  - `monitors` Def32, required
    - `id` integer, required — Id of the monitors relation
    - `roleId` integer, required — Id of the role which monitors a device via the monitors relation
    - `deviceId` integer, required — Id of the device which is monitored via the monitors relation
    - `monitorManagement` boolean, required — Indicates whether the role has the right to create new monitors relations to the monitored device. If true, the role may read and edit any device property.
    - `reads` string[], required — A list of device properties which may be read by the role monitoring the device
    - `edits` string[], required — A list of device properties which may be both read and edited by the role monitoring the device
  - `device` Def8, required
    - `id` integer, required — Id of the device
    - `lastUpdate` string, required — Last update of the device in server time, formatted as an ISO 8601 string
    - `properties` object, required
    - `userRights` object, required — An object specifying which device properties a user may view or edit
      - `propertyEditabilities` object, required
      - `monitorManagement` boolean, required

## Other responses

- `400` — Invalidly formatted body or query parameters
- `401` — Authentication required or token invalid
- `403` — User does not have appropriate device management rights

---

[API](https://skmtc.dev/eniris/apis/eniris-metadata-telemetry-query-api.md) · [All operations](https://skmtc.dev/eniris/apis/eniris-metadata-telemetry-query-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/eniris/eniris-metadata-telemetry-query-api/revisions/fe3723575e19/schema)
