Time-on-site / job-site report (RPT-02)
GET/api/v1/reports/time-on-site
Time on each job-site geofence per device per workspace-tz day.
Derived from GeofenceEvent entry/exit pairing (event_type "entry"/"exit",
NOT "enter"). Each entry pairs with the NEXT exit per (device, geofence); an
entry still open at range end clamps its exit to range_end (open interval,
not dropped). SignalEvent signal_type="dwell" enriches the totals where
entry/exit pairing is incomplete.
Precedence: entry/exit-derived seconds are PRIMARY. A dwell signal supplements a (device, geofence, day) bucket only when no entry/exit pairing produced a visit there (so a workflow-only dwell still surfaces job-site time).
visit_count counts visits that STARTED on the row's local day, so a row for a
continuation day carries seconds with a zero count; is_continuation flags those
rows so nothing can render "a full day on site, zero visits". For per-visit
arrival/departure timestamps and billable overage, use /reports/detention.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 422
- 500
OK
Bad Request
Unauthorized
Forbidden
Not Found
Validation Error
Internal Server Error