Skip to content

Get devices for a geofence

Request

Returns a paginated list of devices and their current state relative to a specific geofence. Use it when you need the actual device records, not just aggregate counts.

Supports filtering by inside/outside status and by blueprint version ID, so you can drill into, for example, only the devices currently outside the boundary running a particular blueprint version.

About Geofences

A geofence is a virtual geographic boundary tied to device location tracking, and can be associated with blueprint-driven configuration so a device's blueprint version may factor into how it's managed inside vs. outside the fence. This endpoint exposes the per-device detail behind the aggregate device-summary statistics.

Key Fields / Query Parameters

  • geofence_id — path parameter identifying the geofence
  • inside/outside status — filters devices by whether they are currently within the geofence boundary
  • blueprint version ID — filters devices by the blueprint version they're currently running

Common Use Cases

  • Listing devices that have left a geofenced area for follow-up or remediation
  • Cross-referencing which blueprint versions are running on devices inside vs. outside a boundary
Security
geofence_bearerAuth
Path
geofence_idstring, (uuid)required

UUID of the geofence

Example:f5316a75-f186-4769-970e-28d6a1a0e110
Query
offsetinteger, >= 0

Number of items to skip before starting to collect the result set

Default:0
limitinteger, [ 1 .. 100 ]

Maximum number of items to return

Default:10
insideboolean

Filter devices by whether they are inside (true) or outside (false) the geofence

Example:inside=true
blueprint_idstring, (uuid)

Filter devices by blueprint ID

Example:blueprint_id=550e8400-e29b-41d4-a716-446655440000
blueprint_version_numberinteger

Filter devices by blueprint version number

Example:blueprint_version_number=1
Headers
X-Esper-Tenant-Idstring, (uuid)required

Esper tenant ID associated with the request

X-Caller-Idstring, [ 1 .. 255 ] charactersrequired

Unique identifier for the caller

cURL
curl -i -X GET \
  'https://api.esper.io/_mock/openapi/geofence/v1/geofences/f5316a75-f186-4769-970e-28d6a1a0e110/devices?offset=0&limit=10&inside=true&blueprint_id=550e8400-e29b-41d4-a716-446655440000&blueprint_version_number=1' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'X-Caller-Id: string' \
  -H 'X-Esper-Tenant-Id: 497f6eca-6276-4993-bfeb-53cbbbba6f08'

Responses

Device list retrieved successfully

Bodyapplication/json
contentobject
Response
{ "content": { "next": "/v1/geofences/f5316a75-f186-4769-970e-28d6a1a0e110/devices?offset=10&limit=10", "previous": null, "results": [] } }