I'm trying to figure out if there's a way to tell if current user is logged in. I see that there's an "isActive" flag = in many of the endpoints - but this is always set to true. Even if I log out. Thanks.
You can't query directly how many users are logged in, but you can query their sessions on the platform.
The following query will get you the Ids of the users who logged into your Salesforce org and have a valid session (were logged in recently).
SELECT LoginHistory.UserId FROM AuthSession WHERE LoginType = 'Application' AND SessionType = 'UI'