Per-device MQTT connect and disconnect counts

For every device the token and the device filters select, the number of
connect and disconnect device events in one window [start, end),
counted across every data partition the token can read. events is
connects + disconnects; latest_at is the time of the latest of those
events. Devices with no connect or disconnect in the window are not rows.

Use it to find devices that reconnect often: events_gt=100 keeps the
devices with more than 100 events in the window. Thresholds are ANDed.
total is the number of devices matching every filter, thresholds
included, across all pages.

Device filters are the ones GET /devices accepts, as
<field>_<operator>=<value> (for example company_id_in,
device_type_id_eq, tags_incany); the most used are listed below.
A count under an operator other than _gt (for example events_gte), or
start/end under any operator, is a 400, not an ignored filter.
page_meta is accepted and has no effect: the response always carries
the paging fields.

The token needs read access to devices and to device events.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
date-time

Window start, RFC 3339. Defaults to end minus 24 hours. The window must span at least one whole second (bounds floored to the second, as on /stats/devices/uptime) and at most 31 days.

date-time

Window end (exclusive), RFC 3339. Defaults to now. Must be after start.

integer
≥ 0

Only devices with more than this many connect plus disconnect events.

integer
≥ 0

Only devices with more than this many connect events.

integer
≥ 0

Only devices with more than this many disconnect events.

string
enum
Defaults to -events

Sort key, ascending; prefix with - for descending. Ties are broken by device_id ascending.

integer
≥ 1
Defaults to 1

Page number. A page past the end returns an empty resources.

integer
0 to 1000
Defaults to 100

Devices per page. 0 returns no rows, only total.

boolean
Defaults to false

Include pagination metadata in response

Partial case-insensitive search term

string

Only devices of this company. company_id_in takes a comma-separated list.

string

Only devices of this company and its descendants. A company the token may not read is a 403; an unknown one is a 404.

string

Only devices in this fleet.

string
string

Only devices carrying any of these tags (comma-separated, exact spelling; see GET /devices/tags).

Responses

400

Invalid window, threshold, order_by or paging value, a stats key under an unsupported operator, or unparseable device filters.

401

You are not authorized

403

The token may not read devices or device events, or names an ancestor_company_id it may not read.

404

The ancestor_company_id names no company.

500

An unexpected error was encountered.

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json