Get Device Sessions
GET/api/v1/devices/:device_id/sessions
Get completed session history for a device.
Returns a list of all completed tracking sessions (shifts) with computed stats like duration, location count, and distance traveled.
- Managers/owners: Can view sessions for any workspace device
- Field workers: Can only view sessions for their own device
started_after/started_before filter on started_at (both optional, inclusive/exclusive bounds respectively — started_at >= started_after, started_at < started_before). Naive datetimes are interpreted as UTC; pass timezone-aware ISO 8601 values to be explicit.
With include_open=true, open_session carries the open session of an
active or paused shift. The paging and started_* filters do not apply to it.
A shift started without its session row gets one, as with /active-session.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 422
- 500
OK
Bad Request
Unauthorized
Forbidden
Not Found
Validation Error
Internal Server Error