Developer API
Developer APICore ConceptsGeofences

Geofences

Draw circles, areas and routes on the map to track tag entry and exit

Overview

Geofences are geographic boundaries that monitor when tracked tags enter or exit defined places. You can set up geofences for locations like warehouses, customer sites, or yards, or along a delivery route, and receive notifications whenever a tagged asset crosses the boundary.

A geofence is a circle, an area, or a route. In the TagLogger app you draw it on the map: place a circle by searching for an address or place name or by clicking the map, click the corners of an area, or click along a route. Geofences can also be imported in bulk from a CSV file, where a shape column picks circle, area, or route.

Shapes

Circle

A center point and a radius from 10 to 100,000 meters. Every geofence created before areas and routes existed is a circle.

Area

A closed outline of 3 to 500 corners, for a site that is not round: a lot, a building block, a port terminal. The edges are the straight lines drawn on the map and may not cross each other.

Route

A line of 2 to 1,000 points with a width from 500 to 20,000 meters (1,000 by default), centered on the line. A tag is on the route while it is inside that band, so leaving the band is a route deviation.

An area spans at most 2,000 km either way, and a route is at most 10,000 km long. Geofences may overlap; each one tracks its own entries and exits, so a tag inside two geofences is reported for both.

Geofence Object

{
  "id": "gF7kP2mQ9xRt",
  "name": "Distribution Center",
  "type": "circle",
  "center": {
    "lat": 40.7128,
    "lng": -74.0060
  },
  "radiusMeters": 500,
  "targetTagIds": ["tag_1", "tag_2", "tag_3"],
  "targetsAllTags": false,
  "alerts": {
    "onEntry": true,
    "onExit": true,
    "dwellEnabled": false,
    "dwellMinutes": null,
    "emailEnabled": true,
    "includeMapLink": true,
    "emailAddress": "alerts@example.com",
    "emailAddresses": ["alerts@example.com", "ops@example.com"],
    "emailCcAddresses": ["manager@example.com"],
    "pushEnabled": false,
    "webhookEnabled": false,
    "webhookTargetIds": []
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-06-19T13:45:23Z"
}

An area or a route carries its outline instead of a radius:

{
  "type": "polygon",
  "center": { "lat": 42.4712, "lng": -83.3986 },
  "radiusMeters": null,
  "vertices": [
    { "lat": 42.4700, "lng": -83.4000 },
    { "lat": 42.4718, "lng": -83.4000 },
    { "lat": 42.4718, "lng": -83.3976 },
    { "lat": 42.4700, "lng": -83.3976 }
  ]
}

{
  "type": "corridor",
  "center": { "lat": 42.3311, "lng": -83.2702 },
  "radiusMeters": null,
  "path": [
    { "lat": 42.3314, "lng": -83.0458 },
    { "lat": 42.3297, "lng": -83.4891 }
  ],
  "widthMeters": 1000
}

Fields

id

Unique geofence identifier.

name

Human-readable name (e.g., "Main Warehouse" or "Customer Site A").

type

The shape: "circle", "polygon" (an area in the app), or "corridor" (a route in the app). Always present.

center

A point as lat/lng in decimal degrees. For a circle it is the center the radius is measured from. For an area it is a point inside the outline, and for a route the point halfway along the line; TagLogger computes both, and they mark where the map shows the geofence's name.

radiusMeters

Radius of a circle in meters. Tags within this radius are considered "inside". null for an area or a route.

vertices

Areas only. The corners in drawing order, as lat/lng. The outline closes from the last corner back to the first; the first corner is not repeated.

path, widthMeters

Routes only. The points of the line in travel order, as lat/lng, and the full width of the band around it in meters (half on each side).

targetTagIds

Array of tag IDs monitored by this geofence. Entry/exit events are only triggered for these tags. When the geofence monitors every tag, this array contains the sentinel value "all".

targetsAllTags

Boolean. True when the geofence monitors all tags in the workspace (equivalent to targetTagIds containing "all"). When false, only the listed tags are monitored.

alerts

Alert configuration for this geofence. The writable alerts object on create/update uses the same preferences as the dashboard:

  • onEntry, onExit — whether entry and exit transitions generate alerts.
  • dwellEnabled, dwellMinutes — whether a dwell alert fires after a tag stays outside for the given number of minutes.
  • emailEnabled, emailAddresses, emailCcAddresses — email delivery and its To/CC recipient lists. Setting or clearing recipient lists through the API requires read:locations in addition to manage:geofences, because alert emails contain event coordinates. The deprecated emailAddress compatibility alias follows the same rule and accepts or returns the first To recipient.
  • includeMapLink — whether geofence alert emails include the TagLogger Open Map button. It defaults to true and does not enable email by itself.
  • pushEnabled — push-notification delivery. An active push device must already be registered before this can be enabled.
  • webhookEnabled, webhookTargetIds — delivery through existing active dashboard integrations returned by GET /v1/integrations. Integration credentials are never exposed.

createdAt, updatedAt

ISO 8601 timestamps for creation and last modification.

Events

Geofences generate entry and exit events when a monitored tag crosses the boundary. An entry is the tag's check-in at the place and an exit its check-out; there is no separate check-in step. These are distinct from tag-movement webhooks:

geofence.entry

A tag has entered the geofence (moved from outside to inside).

geofence.exit

A tag has exited the geofence (moved from inside to outside).

geofence.dwell

A tag has stayed outside the geofence past its configured dwell threshold (a "still outside" reminder).

These transitions are delivered to webhook subscriptions as geofence.entry, geofence.exit, and geofence.dwell events. Webhook delivery is operator-gated and off by default at launch; once production delivery is enabled, subscriptions receive these events automatically. Geofence email alerts configured in the geofence settings continue to fire independently. See Webhook Events for the payload.

Route Deviation

A route reports the same three events, worded for the road. Alerts, the Events page, and the map's Events panel say:

Left the route

The route's exit event: the tag is reported outside the band around the line.

Back on the route

The route's entry event: the tag is inside the band again.

Still off the route

The route's dwell reminder, when the tag stays off the route past the dwell threshold.

Circles and areas keep Entered, Exited, and Still outside. Webhooks use the same three event types for every shape.

Visit Length

An exit event records how long the tag was inside, from its entry to its exit. Alerts and event lists show it after the geofence name, for example "Distribution Center after 2 h 13 min" or "Highway 5 after 45 min". The length is rounded down to the minute; a visit under a minute reads "less than 1 min". Some exits have no visit length, for example the first exit after the geofence was reshaped. The Events page's CSV download adds it as a "Visit length (min)" column.

Visits Report

Where the visits report is available to the workspace, select a geofence on the Map to see its Activity for the last 24 hours, 7 days, or 30 days. Visits lists each tag that was inside, how many visits it made, the total time inside, and whether it is inside now. Visits are replayed from the recorded locations with the same rules as the alerts, so they match the entry and exit events, for circles, areas, and routes alike. For a circle, where the workspace has it, Seen here also lists every tag with a reported location inside it, crossing or not.

The same report is available through the API for any past window of up to 400 days, with each visit's entry time, exit time, and length. It needs the read:geofences and read:locations scopes, and the visits report must be available to the workspace:

GET /v1/geofences/{geofenceId}/visits?from=2026-10-01T00:00:00Z&to=2026-10-08T00:00:00Z HTTP/1.1
Host: api.taglogger.com
Authorization: Bearer tl_live_xxx

Retrieving Geofences

List all geofences in your workspace:

GET /v1/geofences HTTP/1.1
Host: api.taglogger.com
Authorization: Bearer tl_live_xxx

Get a single geofence:

GET /v1/geofences/{geofenceId} HTTP/1.1
Host: api.taglogger.com
Authorization: Bearer tl_live_xxx

Common Use Cases

  • Warehouse tracking: Create a geofence around your distribution center and alert when packages or pallets arrive or depart.
  • Site access: Monitor restricted areas; alert when assets unexpectedly enter sensitive zones.
  • Route verification: Draw a delivery route as a route geofence and alert when a vehicle leaves it, or set geofences at the stops and check each visit.
  • Time on site: Use the visits report to see how long equipment spent at each customer site.
  • Loss prevention: Create a geofence around your store and alert if an asset with a tracked tag leaves the premises unexpectedly.

See Also