list_client_sessions
Get historical client connection sessions from UniFi with up to 90 days of retention. Filter by host, site, time range, and session type to view past client activity.
Instructions
List historical client connection sessions from the Classic REST /stat/session endpoint.
This is the highest-value history tool: retention is ~90 days, so it covers far more than the currently-connected client list.
host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID. start/end: epoch SECONDS (UTC). This endpoint uses seconds natively — passing milliseconds returns HTTP 200 with an EMPTY array and no error, so seconds are enforced (millisecond-magnitude values are rejected). session_type: session class filter. The values that actually narrow the result are "all" (default — the full unfiltered set), "user" (regular clients), and "guest" (guest-network clients). WARNING: an unrecognised value is NOT rejected and does NOT return an empty array — the endpoint silently ignores it and returns the full "all" set, so a typo yields everything rather than a visible error or "no data". (UniFi documents "voucher" as a fourth class; on tested firmware it returned the full set, so prefer "user"/"guest" for real narrowing.)
Each session includes mac, is_wired, assoc_time (session start, epoch seconds), duration (seconds), ap_mac, rx_bytes, tx_bytes, satisfaction, hostname, ip, _id, and roaming_sessions[]. Two things that surprise callers:
There is NO explicit disconnect timestamp — session end is assoc_time + duration.
Radio band lives ONLY inside roaming_sessions[] (radio_band: na/ng/6e), never at the top level. Wired sessions have ap_mac=null and carry sw_mac/sw_port instead.
The response is passed through verbatim, including identifiers (MAC/IP/hostname).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | ||
| host | Yes | ||
| site | Yes | ||
| start | Yes | ||
| session_type | No | all |