How to disconnect web client session via 4GL?

I am looking for the possibility to terminate a web client session via 4GL code. If I am doing so via X3 GUI, there's a REST POST fired using the representation "sessionStates" with the endpoint "disconnect". Is there any chance to do this by code? I need to terminate all web client sessions for a specified list of users (except open admin and sa connections) at once and since this could be a lot of connections, it's no option to do this via GUI.