---
title: "UpdateDeviceState"
method: PATCH
path: "/devices/{deviceId}/state"
tags: ["IP Devices"]
---

# UpdateDeviceState

`PATCH /devices/{deviceId}/state`

Modify the device's state as stored in its shadow. You do not have to pass the entire shadow. You can update a specific portion by setting the correct JSON field path:
```sh
export DEVICE_VERSION=$(curl $API_HOST/v1/devices/$DEVICE_ID -H "Authorization: Bearer $API_KEY" | jq -r '.["$meta"].version')
curl -X PATCH $API_HOST/v1/devices/$DEVICE_ID/state -d '{ "reported": { "device": { "serviceInfo": { "fota_v1": ["BOOT"] } } } }' -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -H "If-Match: $DEVICE_VERSION"
```

## Path parameters

- `deviceId` string, required — This is the canonical device id used in the device certificate, and as the MQTT client id.

## Request body

- DeviceStateInput
  - `reported` object
  - `desired` object

## Response `202`

---

[API](https://skmtc.dev/nrfcloud/apis/nrf-cloud-rest-api.md) · [All operations](https://skmtc.dev/nrfcloud/apis/nrf-cloud-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nrfcloud/nrf-cloud-rest-api/revisions/c4e56e458ebf/schema)
