---
title: "Get device summary for a geofence"
method: GET
path: "/geofence/v1/geofences/{geofence_id}/device-summary"
tags: ["geofence_Device State"]
---

# Get device summary for a geofence

`GET /geofence/v1/geofences/{geofence_id}/device-summary`

## Request

- Base URL: `https://develop-api.esper.cloud/api`
- URL: `https://develop-api.esper.cloud/api/geofence/v1/geofences/{geofence_id}/device-summary`
- Auth: HTTP bearer

Returns aggregate device statistics for a specific geofence — total device count, how many devices are currently inside the boundary, and how many are outside. Use it for a quick, single-call summary rather than pulling the full device list.

Scoped to a single geofence_id and returns counts only, not individual device records — use the devices sub-resource for per-device detail.

**About Geofences**

A geofence is a virtual geographic boundary tied to device location tracking; devices are continuously evaluated as inside or outside the fence to trigger configured actions. This endpoint gives an at-a-glance rollup of that inside/outside state across all devices tied to the geofence.

**Key Fields / Query Parameters**

- geofence_id — path parameter identifying the geofence to summarize

**Common Use Cases**

- Powering a geofence dashboard tile showing total/inside/outside device counts
- Quickly checking compliance for a location-restricted fleet without listing every device

## Path parameters

- `geofence_id` string, uuid, required

## Headers

- `X-Esper-Tenant-Id` string, uuid, required
- `X-Caller-Id` string, required

## Response `200`

Device summary retrieved successfully

- object
  - `content` GeofenceDeviceSummaryResponse: Summary statistics of devices in relation to a geofence
    - `total_devices` integer, required: Total number of devices associated with the geofence
    - `inside_count` integer, required: Number of devices currently inside the geofence
    - `outside_count` integer, required: Number of devices currently outside the geofence
    - `unknown_count` integer, required: Number of devices with unknown state (neither inside nor outside)

## Other responses

- `400`: Invalid geofence ID or missing tenant ID
- `401`: Unauthorized
- `500`: Server error

---

[API](https://skmtc.dev/esper/apis/esper-api-reference.md) - [All operations](https://skmtc.dev/esper/apis/esper-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/esper/apis/esper-api-reference/revisions/fa7b9b652fb2?raw)
