---
title: "Gets a single geofence"
method: GET
path: "/geofences/v2/{geofenceId}"
tags: ["Geofences"]
---

# Gets a single geofence

`GET /geofences/v2/{geofenceId}`

Gets details of a single geofence identified by the `geofenceId`.

## Query parameters

- `fields` string[]

## Response `200`

Response body contains a single geofence object.
Response content type can be either JSON or protobuf depending on the 'Content-Type' request header.

- object — Response body contains a single geofence object
  - `geofence` union, required
    - object
      - `definition` object, required — An object that defines the area of a circular geofence
        - `center` object, required — The coordinates of the center point of the circle.
          - `lat` number, required — Latitude in WGS-84 format, decimal representation ranging from -90 to 90.
          - `lng` number, required — Longitude in WGS-84 format, decimal representation ranging from -180 to 180.
        - `floor` object — The building associated with the geofence
          - `id` string, required — The building ID
          - `level` number — The floor of the geofence in integer format
          - `name` string, required — The building name
        - `radius` number, required — The radius of the circle in meters.
      - `description` string — A description of the area that the geofence encloses and the purpose of the geofence.
      - `name` string — A human-readable name of the geofence.
      - `type` 'circle', required — The geofence type.
    - object
      - `definition` object, required — An object that defines the area of a polygonal geofence.
        - `floor` object — The building associated with the geofence
          - `id` string, required — The building ID
          - `level` number — The floor of the geofence in integer format
          - `name` string, required — The building name
        - `points` object[], required — An array of points that define the polygon. A minimum of three and a maximum of ten points is required.
          - `lat` number, required — Latitude in WGS-84 format, decimal representation ranging from -90 to 90.
          - `lng` number, required — Longitude in WGS-84 format, decimal representation ranging from -180 to 180.
      - `description` string — A description of the area that the geofence encloses and the purpose of the geofence.
      - `name` string — A human-readable name of the geofence.
      - `type` 'polygon', required — The geofence type.
    - object
      - `definition` object — An object that defines the area of a POI geofence.
        - `floor` object — The building associated with the geofence
          - `id` string, required — The building ID
          - `level` number — The floor of the geofence in integer format
          - `name` string, required — The building name
        - `location` object — Details of the geofence location
          - `address` string — Address
          - `country` string — Country
          - `position` object — Coordinates for visualization purposes
            - `lat` number, required — Latitude in WGS-84 format, decimal representation ranging from -90 to 90.
            - `lng` number, required — Longitude in WGS-84 format, decimal representation ranging from -180 to 180.
          - `room` string — The room ID
      - `description` string — A description of the area that the geofence encloses and the purpose of the geofence.
      - `name` string — A human-readable name of the geofence.
      - `trainingStatus` object, required
        - `metadata` object
          - `coordinate` object — Training data position
            - `lat` number, required — Latitude in WGS-84 format, decimal representation ranging from -90 to 90.
            - `lng` number, required — Longitude in WGS-84 format, decimal representation ranging from -180 to 180.
          - `timestamp` integer — Training data timestamp
          - `trackingId` string — This is a unique ID associated with the device data in HERE Tracking. For physical devices the `trackingId` gets assigned to a device when the device is claimed by a user, and for virtual devices it is an external device ID along with the device project `appId`.
          - `usedWlanApCount` number, required — The number of WLAN access point used in training
        - `trained` boolean, required — True if the POI geofence is trained
      - `type` 'poi', required — The geofence type.
  - `id` string, uuid, required — Geofence ID

## Other responses

- `400` — Bad request The request object is in an incorrect format or has values that are invalid or out of range. If available, further error details are provided in the response body.
- `401` — Unauthorized The request did not provide correct authentication details
- `403` — Forbidden The account does not have the correct privileges
- `404` — Geofence ID not found

---

[API](https://skmtc.net/here/apis/tracking.md) · [All operations](https://skmtc.net/here/apis/tracking/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/here/tracking/versions/efa162f7023c/schema)
