Skip to main content

Get Session Locations

GET 

/api/v1/devices/:device_id/sessions/:session_id/locations

Get locations for a specific session with pagination or simplification.

Returns GPS track points recorded during the session.

Pagination mode (default): Use limit and offset to paginate through all points. The first response includes snapshot_at; reuse it on every later page so live appends and delayed historical uploads cannot shift offsets. Start a new snapshot to refresh the trail.

Simplification mode: Set max_points to return a simplified track using Douglas-Peucker algorithm (PostGIS ST_Simplify). Useful for rendering long tracks without loading all points. When max_points is set, pagination is ignored.

CSV export: Set format=csv to download every recorded point of the session as a streamed CSV attachment (timestamp,latitude,longitude,accuracy,speed,heading,source). limit, offset and max_points are ignored; timestamps are ISO-8601 and never interpolated. Same authorization as the JSON response.

Important notes for simplification mode:

  • max_points is a target, not a hard cap. Actual count may vary based on track shape.
  • When simplified=true, timestamps are linearly interpolated between session start/end and should not be used for speed or pause analysis.
  • Accuracy, speed, and heading are lost during simplification (returned as null).

Note: Track history only includes location updates that pass quality filters (accuracy < 100m, minimum movement distance). This ensures clean GPS tracks without jitter or poor-quality readings.

  • Managers/owners: Can view locations for any workspace device
  • Field workers: Can only view locations for their own device

Request​

Responses​

Session locations (JSON) or, with format=csv, the streamed track

Response Headers
    Content-Disposition

    Attachment filename (format=csv only)