There is a REST method:
GET /rest/private/devices/number/{number}
which returns the device information by its number.
It includes the timestamp (in milliseconds) when a device was online, so you can determine the online / offline status from this timestamp.
In Headwind MDM, the device is considered online when it was connected less than 1 hour ago. The yellow status (offline warning) is when it came online 1-4 hours ago. Otherwise, the device is considered offline.
The full output format can be found here.
Alternatively, you can reach the device online time directly in the database (the devices table). The field name is lastUpdate (timestamp in milliseconds).