---
title: "Patch a geofence"
method: PATCH
path: "/v1/locate/geofences/{geofenceId}"
tags: ["Device Locator"]
---

# Patch a geofence

`PATCH /v1/locate/geofences/{geofenceId}`

## Request

- Base URL: `https://api.1nce.com/management-api`
- URL: `https://api.1nce.com/management-api/v1/locate/geofences/{geofenceId}`
- Auth: HTTP bearer

Update an existing geofence

## Path parameters

- `geofenceId` string, required

## Request body

- Patchschema1: Request to update a geofence.
  - `name` string: The name of the geofence
  - `eventTypes` string[]: The event types to register to. Defaults to [ENTER, EXIT]
  - `eventSources` string[]: The sources of coordinates to evaluate towards geofence. Defaults to [GPS, CellTower]

## Response `200`

OK

- union: Patch request geofence response.
  - PatchGeofenceResponseschemaOneOf
    - `id` string, required: Identifier of the geofence
    - `name` string, required: The name of the geofence
    - `eventTypes` string[], required: The event types to register to. Defaults to [ENTER, EXIT]
    - `eventSources` string[], required: The sources of coordinates to evaluate towards geofence. Defaults to [GPS, CellTower]
    - `type` string: The type of geofence
    - `coordinates` array[], required: The polygon geofence coordinates
      - array[]
        - number[]: Coordinates (long, lat)
    - `deviceId` unknown, required
    - `created` string, date-time, required: When the Geofence was created
    - `updated` string, date-time, required: When the Geofence was last updated
  - PatchGeofenceResponseschemaOneOf1
    - `id` string, required: Identifier of the geofence
    - `name` string, required: The name of the geofence
    - `eventTypes` string[], required: The event types to register to. Defaults to [ENTER, EXIT]
    - `eventSources` string[], required: The sources of coordinates to evaluate towards geofence. Defaults to [GPS, CellTower]
    - `type` string: The type of geofence
    - `radius` number, required: Circle geofence radius in meters
    - `center` number[], required: The coordinates of the center of the geofence (long, lat)
    - `deviceId` unknown, required
    - `created` string, date-time, required: When the Geofence was created
    - `updated` string, date-time, required: When the Geofence was last updated

## Other responses

- `400`: Bad Request
- `404`: Not Found Error
- `500`: Internal Server Error

---

[API](https://skmtc.dev/1nce/apis/1nce-os.md) - [All operations](https://skmtc.dev/1nce/apis/1nce-os/llms.txt) - [OpenAPI document](https://skmtc.dev/1nce/apis/1nce-os/revisions/f1aabbc6aeea?raw)
