Skip to content

get_client_sessions

List recent client connection sessions over a time window.

Side effects: None (read-only).

Returns one record per association, newest first, with mac, hostname, name, ip, assoc_time (epoch seconds), duration (seconds), rx_bytes/tx_bytes, is_wired, is_guest, ap_mac, and satisfaction. Pass mac to scope to one client; omit it for every client’s sessions in the window.

get_client_sessions(mac="aa:bb:cc:00:00:01", hours=48, limit=20)
Parameter Type Required Default Description
mac string no “” MAC address to filter to one client. Empty (default) returns sessions for all clients.
hours integer no 24 Look-back window in hours (default 24, max 720 = 30 days).
limit integer no 50 Max number of sessions to return (default 50, max 1000).
controller string no “default” Name of the UniFi controller to target. Defaults to "default".