---
title: "Update device sensor"
method: PATCH
path: "/api/v2/devices/{id}/sensors/{sensorId}"
tags: ["Sensors"]
---

# Update device sensor

`PATCH /api/v2/devices/{id}/sensors/{sensorId}`

## Request

- Base URL: `https://api.kiloiot.io`
- URL: `https://api.kiloiot.io/api/v2/devices/{id}/sensors/{sensorId}`
- Auth: API key in header `X-API-Key` and API key in header `X-Organization-Id`

Update a sensor attached to a device.

**Required scope:** `sensors:write`

## Path parameters

- `id` string, required
- `sensorId` string, required

## Query parameters

- `organizationId` string, required

## Request body

- object
  - `sensorTemplateId` string, required

## Response `200`

OK

- object
  - `createdAt` string
  - `dataSendingInterval` object
    - `unit` 'minute' | 'hour' | 'day' | 'week' | 'month'
    - `value` integer
  - `id` string
  - `images` object[]
    - `contentType` string
    - `createdAt` string
    - `filename` string
    - `id` string
    - `isCover` boolean
    - `position` integer
    - `sizeBytes` integer
    - `url` string
  - `lastSeen` string
  - `name` string
  - `organizationId` string
  - `physicalDevice` object
    - `clientDeviceId` string
    - `configuration` object
    - `connectionId` string
    - `createdAt` string
    - `id` string
    - `sensorMappings` object[]
      - `createdAt` object
      - `id` object
      - `sensorId` object
      - `sourcePath` object
      - `updatedAt` object
    - `updatedAt` string
  - `sensors` object[]
    - `createdAt` string
    - `id` string
    - `sensorTemplateId` string
    - `updatedAt` string
  - `updatedAt` string

## Other responses

- `401`: Missing or invalid API key
- `403`: Insufficient permissions (missing required scope)

---

[API](https://skmtc.dev/kiloiot/apis/kiloiot-public-api.md) · [All operations](https://skmtc.dev/kiloiot/apis/kiloiot-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kiloiot/apis/kiloiot-public-api/revisions/faf39bde186c?raw)
