How to check whether a user already logined?

I try to logout a user by calling an API “/admin/user/{user_id}/log_out”, but before that, I try to I need to check whether the user already login. Is there any API for this purpose?

1 Like

Using an API key with administrator privileges, you could fetch the user info (e.g., and then check the user_auth_tokens array for a list of active sessions. If it is empty, then the user is not logged in anywhere.


Thank you so much. This help me a lot!