---
title: "Update a resource"
method: PUT
path: "/api/v1/devices/{deviceId}/resources/{resourceHref}"
tags: ["Resources"]
---

# Update a resource

`PUT /api/v1/devices/{deviceId}/resources/{resourceHref}`

Resource update request is send directly to the device, carrying values which should be modified. Update confirmation doesn't have to carry updated content, this is up to the device implementation if it replies with an up to date values. If subscribed to the websocket, after the update command is successfully accepted by the device, event `RESOURCE_UPDATED` with matching `correlationId` is emitted. At the moment values are applied / changed on the device (e.g. resource update might trigger some processing, which was successfully requested but operation is in progress) event `RESOURCE_CHANGED` is emitted and resource shadow updated.

## Query parameters

- `interface` string
- `timeToLive` integer
- `onlyContent` boolean

## Request body

- ResourceContent

## Response `200`

Confirmation of an update. Presence of the content in the response depends on the device implementation.

- ResourceContent

## Other responses

- `400` — Bad Request
- `401` — Not authorized
- `403` — Forbidden
- `404` — Entity was not found.

## Changes

> 42 revisions in range; 3 not diffed.

- **2024-05-15** `bb6060e9c93c` — 1 info
  - added the new optional `query` request parameter `onlyContent`
- **2022-01-05** `afc9b9af73b5` — 6 info
  - added the optional property `error/details/items/typeUrl` to the response with the `400` status
  - added the optional property `error/details/items/typeUrl` to the response with the `401` status
  - added the optional property `error/details/items/typeUrl` to the response with the `403` status
  - added the optional property `error/details/items/value` to the response with the `400` status
  - …2 more
- **2021-08-05** `750a4952762c` — 2 info
  - added the new optional `query` request parameter `interface`
  - added the new optional `query` request parameter `timeToLive`
- **2021-07-27** `4d121732b593` — 1 info
  - endpoint added
- **2020-04-11** `562192db9767` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/changes/api/v1/devices/:deviceId/resources/:resourceHref/put.md)

---

[API](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway.md) · [All operations](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/plgd-dev/plgd-http-gateway/revisions/bbfd9fa43407/schema)
