Get group statistics via query params
GET
/api/v1/groups/query
const url = 'http://localhost:3000/api/v1/groups/query';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/groups/query \ --header 'X-API-Key: <X-API-Key>'Retrieves statistics for devices matching label query parameters. Pass label key-value pairs as query parameters (e.g., ?env=prod®ion=us-east). Reserved keys limit and offset are excluded from label matching.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Group statistics retrieved successfully
Media type application/json
object
total
required
Total number of matching devices
number
byStatus
required
Status breakdown of matching devices
object
online
required
Number of online devices
number
offline
required
Number of offline devices
number
pending
required
Number of pending devices
number
error
required
Number of devices in error state
number
labelSelector
The label selector used for filtering
object
key
additional properties
string
Example
{ "total": 25, "byStatus": { "online": 45, "offline": 5, "pending": 2, "error": 1 }, "labelSelector": { "environment": "production" }}Unauthorized
Forbidden — caller lacks required permission