Skip to content

Update geofence information
Legacy

Request

⚠️ Legacy endpoint. Android only. Geofence configuration is now managed through blueprints. Use the blueprints endpoints (/api/v2/blueprints/) to create and manage geofences going forward.

Performs a full replacement update on an existing legacy geofence record.All writable fields must be included in the request body; omitting a field will overwrite it with a null or default value. Returns the updated Geofence object on success.

About Update Geofence — Full (Legacy)

This PUT endpoint replaces the entire geofence definition for the specified geofence_id. It operates on the same legacy standalone geofence system as the other /geofence/ path endpoints. Because geofences are now configured within blueprints via /api/v2/blueprints/, edits here will not affect blueprint-managed geofence behavior. Use blueprints for all active geofence configuration changes.

Security
esper_cloud_api_apiKey
Path
geofence_idstring, (uuid)required

A UUID string identifying the geofence.

enterprise_idstring, (uuid)required

A UUID string identifying the enterprise.

Body*/*required
namestring(Geofence name)required

Name of the geofence

descriptionstring(Geofence description)

A description about the geofence

latitudestring, (decimal)(Geofence latitude)required

Latitude corresponding to the geofence

longitudestring, (decimal)(Geofence longitude)required

Longitude corresponding to the geofence

radiusinteger(Geofence radius)

The radius within which the geofence should be applied

radius_unitstring(Unit of radius)

The unit in which the radius is taken, eg - kilometers, meters etc

Enum:"KILOMETERS""METERS""MILES"
device_actionsArray of strings(Device Actions)

The actions to be performed on the device

Items Enum:"LOCK_DOWN""BEEP"
cURL
curl -i -X PUT \
  'https://api.esper.io/_mock/openapi/v0/enterprise/{enterprise_id}/geofence/{geofence_id}/' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: */*' \
  -d '{
    "name": "string",
    "description": "string",
    "latitude": "string",
    "longitude": "string",
    "radius": 0,
    "radius_unit": "KILOMETERS",
    "device_actions": [
      "LOCK_DOWN"
    ]
  }'

Responses

successful operation

Bodyapplication/json
idstring, (uuid)(Geofence id)read-only

id of the geofence

namestring(Geofence name)required

Name of the geofence

descriptionstring(Geofence description)

A description about the geofence

enterprisestring, (uuid)(Enterprise id)read-only

id of the enterprise resource

latitudestring, (decimal)(Geofence latitude)required

Latitude corresponding to the geofence

longitudestring, (decimal)(Geofence longitude)required

Longitude corresponding to the geofence

radiusinteger(Geofence radius)

The radius within which the geofence should be applied

radius_unitstring(Unit of radius)

The unit in which the radius is taken, eg - kilometers, meters etc

Enum:"KILOMETERS""METERS""MILES"
device_actionsArray of strings(Device Actions)

The actions to be performed on the device

Items Enum:"LOCK_DOWN""BEEP"
device_countinteger(Device count)read-only

Number of devices

created_bystring(Created by)read-only

The user who created the geofence

created_onstring, (date-time)(Creation date and time)read-only

Date and time of when the geofence was created

updated_onstring, (date-time)(Updation date and time)read-only

Date and time of when the geofence was updated

Response
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "enterprise": "796caaf9-a7de-4817-9ffa-39d04bf83de9", "latitude": "string", "longitude": "string", "radius": 0, "radius_unit": "KILOMETERS", "device_actions": [ "LOCK_DOWN" ], "device_count": 0, "created_by": "string", "created_on": "2019-08-24T14:15:22Z", "updated_on": "2019-08-24T14:15:22Z" }