---
title: "Retrieve geofences by category or group."
url: "https://developers.vzconnect.com/apis/geofence-api-1/versions/97ac0c29-6cea-4076-8841-35f03eedbd6c/operations/getGeofences"
---

> Full API specification: https://developers.vzconnect.com/apis/geofence-api-1/versions/97ac0c29-6cea-4076-8841-35f03eedbd6c.md

# Retrieve geofences by category or group.

`GET` `/geo/v1/geofences`

Operation ID: `getGeofences`

Retrieve Geofence data by Category Name or Group ID. Provide exactly one of categoryName and groupId. Categories and Group management reside within REVEAL and are provided as additional query parameters. Category names must be presented exactly as they are saved within REVEAL.

## Query parameters

- `categoryName` (string, optional) - The name of the Category to retrieve Geofences for. Must match exactly as saved within REVEAL.
- `groupId` (string, optional) - The Group ID to retrieve assigned Geofences for.

## Responses

- `200` - Successfully retrieved the list of geofences.
- `204` - No geofences found matching the criteria.
- `400` - Bad request.
- `401` - Unauthorized. Authentication credentials are missing or invalid.
- `404` - Category or group not found, or neither categoryName nor groupId was supplied.
- `500` - Internal server error.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Geofence API
  version: "1.0"
servers:
  - url: https://api.us.vzconnect.com
paths:
  /geo/v1/geofences:
    get:
      summary: Retrieve geofences by category or group.
      description: Retrieve Geofence data by Category Name or Group ID. Provide
        exactly one of categoryName and groupId. Categories and Group management
        reside within REVEAL and are provided as additional query parameters.
        Category names must be presented exactly as they are saved within
        REVEAL.
      operationId: getGeofences
      tags:
        - Geofence API
      x-kong-route-defaults:
        strip_path: false
        paths:
          - ~/geo/v1/geofences/?$
      parameters:
        - name: categoryName
          in: query
          required: false
          description: The name of the Category to retrieve Geofences for. Must match
            exactly as saved within REVEAL.
          schema:
            type: string
            example: REST Test
        - name: groupId
          in: query
          required: false
          description: The Group ID to retrieve assigned Geofences for.
          schema:
            type: string
            example: "22325"
      responses:
        "200":
          description: Successfully retrieved the list of geofences.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeofenceCollection"
              example:
                Count: 1
                _embedded:
                  places:
                    - place:
                        GeoShapeType: GeoRectangle
                        PlaceId: JC123
                        GeoFenceName: Jennifer
                        CategoryName: REST Test
                        Address:
                          AddressLine1: 2510 E Ridgewood Dr
                          AddressLine2: ""
                          Locality: Seven Hills
                          AdministrativeArea: OH
                          PostalCode: "44131"
                          Country: USA
                        IsShownOnMap: true
                        IsShownOnReport: true
                        Note: JC Rest Stop
                        PhoneNumber: 216-522-2855
                        Latitude: 41.391756
                        Longitude: -81.670929
        "204":
          description: No geofences found matching the criteria.
          content:
            application/json: {}
        "400":
          description: Bad request.
          content:
            application/json: {}
        "401":
          description: Unauthorized. Authentication credentials are missing or invalid.
        "404":
          description: Category or group not found, or neither categoryName nor groupId
            was supplied.
          content:
            application/json: {}
        "500":
          description: Internal server error.
          content:
            application/json: {}
components:
  schemas:
    GeofenceCollection:
      type: object
      description: A list of Geofences assigned to the provided Category Name and/or
        Group ID.
      properties:
        Count:
          type: integer
          description: The total number of Geofence locations assigned to the provided
            Category Name and/or Group ID.
          example: 1
        _links:
          type: object
          properties:
            self:
              $ref: "#/components/schemas/Link"
        _embedded:
          type: object
          properties:
            places:
              type: array
              items:
                $ref: "#/components/schemas/PlaceEntry"
    Link:
      type: object
      properties:
        href:
          type: string
    PlaceEntry:
      type: object
      properties:
        place:
          $ref: "#/components/schemas/Place"
        _links:
          type: object
          properties:
            self:
              $ref: "#/components/schemas/Link"
            spatialdata:
              $ref: "#/components/schemas/Link"
    Place:
      type: object
      description: A Geofence assigned to the queried Category or Group, displayed as
        a Place object with specific details.
      properties:
        GeoShapeType:
          type: string
          description: The shape type the Geofence is saved as.
          enum:
            - GeoRectangle
            - GeoCircle
            - GeoPolygon
          example: GeoRectangle
        PlaceId:
          type: string
          nullable: true
          description: A unique value within a REVEAL account used to identify a Geofence.
            The Place ID is a mandatory field to use the Geospatial API, but can
            be NULL for a returned Geofence.
          example: JC123
        GeoFenceName:
          type: string
          description: The name of the Geofence.
          example: Jennifer
        CategoryName:
          type: string
          description: The name of the Category.
          example: REST Test
        Address:
          $ref: "#/components/schemas/Address"
        IsShownOnMap:
          type: boolean
          description: Denotes if the Geofence can be displayed on the Map.
          default: true
          example: true
        IsShownOnReport:
          type: boolean
          description: Denotes if the Geofence can be displayed on Reports.
          default: true
          example: true
        EmailAddress:
          type: string
          description: An email address that can be associated with the saved Geofence.
          example: depot@example.com
        Note:
          type: string
          nullable: true
          description: A free form text space for users to provide additional details
            about the Geofence location.
          example: JC Rest Stop
        PhoneNumber:
          type: string
          nullable: true
          description: A Phone Number that can be associated with the saved Geofence.
          example: 216-522-2855
        Latitude:
          type: number
          format: double
          example: 41.391756
        Longitude:
          type: number
          format: double
          example: -81.670929
    Address:
      type: object
      description: Address contains the global standards for address components.
      properties:
        AddressLine1:
          type: string
          description: Location specific identification such as a house number.
          example: 2510 E Ridgewood Dr
        AddressLine2:
          type: string
          description: Additional information to identify location such as an apartment
            number.
          example: ""
        Locality:
          type: string
          description: City, town, etc.
          example: Seven Hills
        AdministrativeArea:
          type: string
          description: State, province, etc.
          example: OH
        PostalCode:
          type: string
          description: Postal code.
          example: "44131"
        Country:
          type: string
          description: Country.
          example: USA
```
