HyperTrackDocs
WebhooksGeotags, Geofences & Trips

Geofence

Webhook payload sent when a device enters or exits a geofence.

[
  {
  "device_id": "00112233-4455-6677-8899-AABBCCDDEEFF",
  "driver_handle": "James",
  "data": {
    "arrival": {
      "location": {
        "coordinates": [
          -122.394223, 37.792763, 822.58
        ],
        "type": "Point"
      },
      "recorded_at": "2021-07-15T13:29:21.085Z"
    },
    "duration": 3738,
    "exit": {
      "location": {
        "coordinates": [
          -122.394223, 37.792763, 822.58
        ],
        "type": "Point"
      },
      "recorded_at": "2021-07-15T14:31:38.789Z"
    },
    "geofence_id": "00001111-d30d-4a4a-b965-95f3f743256e",
    "geofence_metadata": {
      "name": "Main store"
    },
    "place_handle": "Store-North-Square",
    "geometry": {
      "coordinates": [
        -122.394223, 37.792763

      ],
      "type": "Point"
    },
    "marker_id": "00001111-b97b-490d-8d04-a539477df0be",
    "radius": 50,
    "route_to": {
      "distance": 1234,
      "duration": 3600,
      "idle_time": 1800,
      "prev_marker_id": "00001111-2dac-40a7-973b-9e3d66898a7d",
      "started_at": "2021-07-15T12:29:16.424Z"
    },
    "value": "exit"
  },
  "location": {
    "type": "Point",
    "coordinates": [
      -122.394223,
      37.792763
    ]
  },
  "recorded_at": "2021-07-15T13:29:21.085Z",
  "created_at": "2021-07-15T13:29:21.085Z",
  "version": "2.0.0",
  "type": "geofence"
  }
]
NameTypeDescription
device_idstringUnique device identifier, case sensitive
driver_handlestringUnique identifier for a worker
data.arrivalobjectObject representing details about the geofence arrival
data.arrival.locationobjectLocation object that triggered geofence arrival
data.arrival.location.typestringAs of right now, only Point is supported
data.arrival.location.coordinatesarrayArray of longitude, latitude and (optional) elevation
data.arrival.recorded_atstringISO 8601 date when the location triggering arrival was recorded
data.exitobjectObject representing details about the geofence exit. Does not exist when the user is still inside the geofence. {optional}
data.exit.locationobjectLocation object that triggered geofence exit. Only set when geofence was exited due to a location. Can be empty when marker was closed to due a health event. (optional)
data.exit.location.typestringAs of right now, only Point is supported
data.exit.location.coordinatesarrayArray of longitude, latitude and (optional) elevation
data.exit.recorded_atstringISO 8601 date when the event triggering exit was recorded
data.durationintDuration of the visit in [seconds]
data.geometryObjectGeofence geometry of the geofence creating this marker
data.marker_idStringUnique identifier for this geofence marker
data.place_handleStringUnique Identifier of the place for which entry/exit is recorded. It will be present if geofence is associated with a place created via Places API
data.route_toobjectObject describing the route since last geofence marker (optional)
data.route_to.distanceintDistance travelled since last geofence marker or start of tracking session in [meters]
data.route_to.durationintDuration since last geofence marker or start of tracking session in [seconds]
data.route_to.idle_timeintDuration at stops since last geofence marker or start of tracking session in [seconds]
data.route_to.started_atStringISO 8601 Date and time when route_to calculation started
data.valueString'entry' - value indicating entry inside geofence
'exit' - value indicating exit from geofence
'delete' - value indicating that previously sent out visit was removed due to more accurate ground truth arriving*
locationobjectDeprecated legacy payload, new users will find it null

[*] we are adjusting geofence visits as data arrives - we get more ground truth from the sdk which can lead us to classify a previous visit as not a meaningful enough (e.g., a drive through).
our customers also rely on the detection to have low latencies. so we can't wait for all the data to arrive and the create the visits.
that's why in same cases, we send a geofence visit out and then later delete it again. it's rare that this happens