Mikrotik Hotspot PHP API

i’m working with php api by Mikrotik, but i do not how control if the user is disconnected do not run the limit-uptime?

this is my code

$API->write(“/ip/hotspot/user/add”, false);
$API->write(“=name=”.$usuario, false);
$API->write(“=limit-uptime=”.$segundos, false);
$API->write(“=password=”.$password, true);