---
title: "Get all devices"
method: GET
path: "/api/v1/devices"
tags: ["Devices"]
---

# Get all devices

`GET /api/v1/devices`

All registered devices user is authorized to use are returned in form of a stream, chunk by chunk. Attach your reader and consume device by device. Various filters allows you to be more concrete in devices you would like to get. Error response might be returned immediately, but also anytime during the stream reading.

## Query parameters

- `deviceId` string, uuid
- `type` string[]
- `status` ConnectionStatus[]

## Response `200`

Stream of devices or errors.

- object
  - `result` Device
    - `id` string
    - `types` string[]
    - `name` string
    - `metadata` DeviceMetadata
      - `status` object
        - `value` 'OFFLINE' | 'ONLINE'
        - `validUntil` string, int64 — Unix timestamp in nanoseconds.
        - `connectedAt` string, int64 — Unix timestamp in nanoseconds.
        - `serviceId` string — The service.ID, which identify the device being served, must be set when the status is ONLINE. However, during an OFFLINE event, they will be sed to empty values.
        - `localEndpoints` string[] — The last local endpoints of the device, and it is set when the status is ONLINE.
      - `twinSynchronization` TwinSynchronization
        - `state` 'OUT_OF_SYNC' | 'DISABLED' | 'SYNCING' | 'IN_SYNC' — OUT_OF_SYNC - As soon as it connects after it was offline or when it goes errorless offline or when twin enabled has been changed to true. DISABLED - As soon as twin enabled is set to false. SYNCING - As soon as device connects, successfully signs in and batch observe is called on device from the cloud. IN_SYNC - As soon as current device resources values are received and applied to twin database. Twin was successfully reconciled after device reconnect and is kept up to date using an active subscription to device resource changes.
        - `syncingAt` string, int64
        - `inSyncAt` string, int64
        - `commandMetadata` CommandMetadata
          - `connectionId` string
          - `sequence` string, uint64
      - `twinEnabled` boolean
    - `manufacturerName` object[]
      - `language` string
      - `value` string
    - `modelNumber` string
    - `interfaces` string[]
    - `protocolIndependentId` string
  - `error` Error
    - `code` integer
    - `message` string
    - `details` object[]
      - `typeUrl` string
      - `value` string, byte

## Other responses

- `400` — Bad Request
- `401` — Not authorized

## Changes

> 42 revisions in range; 3 not diffed.

- **2024-02-29** `24b9261b39f3` — 2 info
  - added the optional property `result/metadata/status/localEndpoints` to the response with the `200` status
  - added the optional property `result/metadata/status/serviceId` to the response with the `200` status
- **2022-11-08** `482579a45b1d` — 1 warning, 2 info
  - removed the optional property `result/metadata/shadowSynchronization` from the response with the `200` status
  - added the optional property `result/metadata/twinEnabled` to the response with the `200` status
  - added the optional property `result/metadata/twinSynchronization` to the response with the `200` status
- **2022-10-17** `1e8fcc1d1354` — 1 info
  - added the optional property `result/metadata/status/connectedAt` to the response with the `200` status
- **2022-01-05** `afc9b9af73b5` — 6 info
  - added the optional property `error/details/items/typeUrl` to the response with the `200` status
  - 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/value` to the response with the `200` status
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/changes/api/v1/devices/get.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)
