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)
ParameterTypeRequiredDefaultDescription
macstringno""MAC address to filter to one client. Empty (default) returns sessions for all clients.
hoursintegerno24Look-back window in hours (default 24, max 720 = 30 days).
limitintegerno50Max number of sessions to return (default 50, max 1000).
controllerstringno”default”Name of the UniFi controller to target. Defaults to "default".