v1

latestOpenAPI 3.0.1Apache 2.02026-08-063494581.6 MB
geofence_Geofences

Create a new geofence

Creates a new geofence with the specified geometry and actions

post/geofence/v1/geofences

Headers

X-Esper-Tenant-Idstring uuid required

Esper tenant ID associated with the request

X-Caller-Idstring required

Unique identifier for the caller

Request body

namestring required

Name of the geofence

descriptionstring

Optional description of the geofence

actionsstring[]

Actions to trigger when geofence conditions are met. Empty array means no actions.

Example request

{
  "name": "Geofence 1",
  "description": "A geofence that is either polygonal or circular.",
  "actions": [
    "lockdown",
    "beep"
  ],
  "geometry": {
    "type": "polygon",
    "coordinates": [
      {
        "latitude": 41.8902,
        "longitude": 12.4924
      },
      {
        "latitude": 41.8903,
        "longitude": 12.4925
      },
      {
        "latitude": 41.8904,
        "longitude": 12.4926
      }
    ]
  }
}

Response

Geofence created successfully

Example response

{
  "content": {
    "id": "11111111-1111-1111-1111-111111111111",
    "name": "Warehouse Perimeter",
    "description": "A polygon-shaped geofence",
    "actions": [
      "lockdown",
      "beep"
    ],
    "geometry": {
      "type": "polygon",
      "coordinates": [
        {
          "latitude": 41.8902,
          "longitude": 12.4924
        },
        {
          "latitude": 41.8903,
          "longitude": 12.4925
        },
        {
          "latitude": 41.8904,
          "longitude": 12.4926
        }
      ]
    },
    "created_at": "2024-06-24T14:00:00Z",
    "updated_at": "2024-06-24T15:00:00Z"
  }
}