---
title: "Update a device"
method: PATCH
path: "/v1/projects/{projectId}/devices/{deviceId}"
tags: ["Devices"]
---

# Update a device

`PATCH /v1/projects/{projectId}/devices/{deviceId}`

Use the `PUT` method to replace a device in its entirety, or the `PATCH` method to replace a subset of the device properties.

For the `PATCH` method, hardware IDs and tags can be added or removed with the `add_...` and `remove_...` properties respectively, or the entire set of hardware IDs or tags can be replaced by assigning a value to their respective properties.

## Path parameters

- `projectId` string, required
- `deviceId` string, required

## Request body

- GoliothDeviceUpdate
  - `addHardwareId` string[]
  - `addTagId` string[]
  - `blueprintId` string
  - `cohortId` string — Optional Cohort ID to assign the device to. Setting to an empty string removes the device from its cohort without assigning it to a new one.
  - `enabled` boolean
  - `hardwareIds` string[]
  - `name` string
  - `removeHardwareId` string[]
  - `removeTagId` string[]
  - `tagIds` string[]

## Response `200`

A successful response.

- GoliothUpdateDeviceResponse
  - `data` GoliothDevice
    - `blueprintId` string
    - `certificateId` string
    - `cohortId` string
    - `createdAt` string, date-time
    - `data` object
    - `enabled` boolean
    - `hardwareIds` string[]
    - `id` string
    - `lastReport` string, date-time
    - `metadata` GoliothDeviceMetadata
      - `lastReport` string, date-time
      - `lastSeenOffline` string, date-time
      - `lastSeenOnline` string, date-time
      - `lastSettingsStatus` GoliothSettingsStatus
        - `errors` GoliothSettingError[]
          - `code` integer
          - `codeDescription` string
          - `deviceDetails` string
          - `key` string
        - `reportedVersion` string
        - `status` string
        - `statusDetail` string
        - `syncTime` string, date-time
      - `status` string
      - `update` object — Latest Firmware Update information.
    - `name` string
    - `status` string
    - `tagIds` string[]
    - `updatedAt` string, date-time

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.dev/golioth/apis/golioth-api.md) · [All operations](https://skmtc.dev/golioth/apis/golioth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/golioth/golioth-api/revisions/47c98ae69a55/schema)
