---
title: "Read Devices collection"
method: GET
path: "/api/devices"
tags: ["Devices"]
---

# Read Devices collection

`GET /api/devices`

*Devices* collection with at least the `threadBorderRouter` item representing the Thread Border Router.

## Background Logic
A `updateDeviceCollectionTask` posted on `/api/actions` triggers an update of this resource.
For updating the resource, it performs a procedure similar to the `ot-ctl meshdiag topology` CLI command:
- for each router, query the following Diagnostic TLVs using multicast and unicast retries:
    - TLV 0: MAC Extended Address (64-bit)
    - TLV 1: MAC Address (16-bit)
    - TLV 8: IPv6 Address List
    - TLV 24: Version
    - TLV 29: Child
    - TLV 30: Child IPv6 Address List
- look up hostname and services instance name for each SRP-registered IPv6 address
- augment local data for the local `threadBorderRouter` item
- generate `threadDevice` or `threadBorderRouter` items based on the TLV and networkData

On GET request, the collection is returned, with following attributes for each device:
- extAddress
- mlEidIid
- mode
- omrIpv6Address
- eui (optional)
- hostname
- role
- created
- updated (optional)

And additional attributes for this *threadBorderRouter* item:
- rloc16
- extPanId
- networkName
- routerId (optional)
- leaderData
- routerCount
- rlocAddress
- baId

## Query parameters

- `fields` object

## Response `200`

(JSON:API) document with one or more `data` objects representing *threadDevice* items.

- union
  - object[]
  - object

## Other responses

- `400` — The client sent an invalid request. The client SHOULD perform action(s) to provide valid syntax before retrying the request.
- `404` — The client requested a target resource that does not exist. The client SHOULD perform action(s) to re-align with the API or re-synchronize application state before retrying the request.
- `406` — The client requests a content-type that is not supported by the target resource. The client SHOULD perform action(s) to re-align with the API before retrying the request.

---

[API](https://skmtc.net/openthread/apis/swagger-openthread-rest-api.md) · [All operations](https://skmtc.net/openthread/apis/swagger-openthread-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openthread/swagger-openthread-rest-api/revisions/7996e8479177/schema)
