HTTP API to detect Theia activities

Is there any APIs that can be used to detect if the Theia session is still active? I would like to implement a scheduled task to check the Theia session regularly if the session is inactive for a while the machine will be shut down automatically. Thanks.