Skip to main content

Geofence Report

Vehicle entries and exits across geofenced zones, including dwell time and visit filtering.

GET/apidev/v1/reports/avl/geofence
PermissionAPICLI_RPTAVL_GEOCERCA
Rate Limit10 req/min (sliding window)
Cache300s (5 min)
Max Range31 days

Overview

Returns entry and exit events for vehicles crossing predefined geographic zones (geofences). Each record represents a single visit — from entry to exit.

  • Zone filtering — restrict to specific geofences with the geofences parameter
  • Dwell time threshold — use idletime to exclude visits shorter than a minimum duration
  • Visit analytics — calculate total time spent per zone for route compliance and SLA monitoring

Query Parameters

ParameterTypeRequiredDefaultDescription
startdatestringYesISO 8601 start date-time (e.g. 2026-03-01T00:00:00)
enddatestringYesISO 8601 end date-time. Max range 31 days
devicesstringNoAll visibleComma-separated device IDs. Max 500
geofencesstringNoAll visibleComma-separated geofence IDs. Max 500
idletimenumberNo0Minimum dwell time in minutes. Visits shorter than this are excluded
limitintegerNo25Records per page (1100)
offsetintegerNo0Records to skip
Geofence visibility

Only geofences visible to the authenticated user can be queried. Requesting an inaccessible geofence ID returns no data for that zone — no error is raised.


Code Examples

curl -s "https://$TENANT/apidev/v1/reports/avl/geofence?startdate=2026-03-01T00:00:00&enddate=2026-03-15T23:59:59&limit=50&geofences=101,102,103" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"

Response Fields

FieldTypeDescription
device_namestringDisplay name of the vehicle/device
peoplestringName of the assigned driver at the time of the visit
geofencestringName of the geofence zone visited
datetime_instring | nullTimestamp when the device entered the geofence
datetime_outstring | nullTimestamp when the device exited. null if still inside
idlenumberDwell time inside the geofence in minutes
Timestamps

All timestamps are returned without timezone (e.g. "2026-03-05T08:12:33"). See Pagination & Envelope for the standard response wrapper.

Example Response

{
"success": true,
"data": [
{
"device_name": "Van B-205",
"people": "Carlos Medina",
"geofence": "Warehouse Central",
"datetime_in": "2026-03-05T08:12:33",
"datetime_out": "2026-03-05T09:35:10",
"idle": 82.6
},
{
"device_name": "Truck A-101",
"people": "Maria Lopez",
"geofence": "Client Site North",
"datetime_in": "2026-03-05T10:05:00",
"datetime_out": null,
"idle": 0
}
],
"meta": {
"total": 47,
"limit": 50,
"offset": 0
}
}

Using idletime to filter short visits

With idletime=5, visits under 5 minutes are excluded — useful to filter GPS drift near zone boundaries:

GET /apidev/v1/reports/avl/geofence?startdate=...&enddate=...&idletime=5

Only visits with idle >= 5 are returned.


Errors

CodeHTTPDescription
BAD_REQUEST400Missing required headers
VALIDATION_ERROR400Invalid params: missing dates, range > 31 days, malformed ISO date, limit > 100, > 500 devices/geofences
UNAUTHORIZED401Invalid or expired JWT / API Key
FORBIDDEN403User lacks APICLI_RPTAVL_GEOCERCA permission
RATE_LIMITED429Exceeded 10 req/min
INTERNAL_ERROR500Unexpected server error