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).

FROM AuthSession
WHERE LoginType = 'Application'
AND SessionType = 'UI'

You can get this detail from Login History. The name of your Connected App (used in REST API Call) will be the name displayed in the application column.

enter image description here

  • this is good too - going through the UI. but i need to do it progmmatically. thanks tho. – Michael Soriano Feb 15 '18 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.