---
title: "Create a new geofence"
method: POST
path: "/geofence/v1/geofences"
tags: ["geofence_Geofences"]
---

# Create a new geofence

`POST /geofence/v1/geofences`

Creates a new geofence with the specified geometry and actions

## Headers

- `X-Esper-Tenant-Id` string, uuid, required
- `X-Caller-Id` string, required

## Request body

- GeofenceGeofenceRequest — Request payload for creating a geofence. Specify either a Polygon or Circular geofence.
  - `name` string, required — Name of the geofence
  - `description` string — Optional description of the geofence
  - `actions` string[] — Actions to trigger when geofence conditions are met. Empty array means no actions.
  - `geometry` union, required
    - GeofencePolygonGeometry — Polygon geometry with coordinates as array of coordinate objects
      - `type` 'polygon', required
      - `coordinates` object[], required — Array of coordinate objects, each containing latitude and longitude
        - `latitude` number, required — Latitude coordinate
        - `longitude` number, required — Longitude coordinate
    - GeofenceCircleGeometry — Circle geometry with center coordinates and radius
      - `type` 'circle', required
      - `coordinates` object[], required — Array with single coordinate object containing latitude and longitude
        - `latitude` number, required — Latitude coordinate
        - `longitude` number, required — Longitude coordinate
      - `radius` number, required — Radius in meters

## Response `201`

Geofence created successfully

- object
  - `content` GeofenceGeofenceResponse
    - `id` string, uuid, required — Unique identifier for the geofence
    - `name` string, required — Name of the geofence
    - `description` string — Description of the geofence
    - `actions` string[], required — Actions configured for this geofence. Empty array means no actions.
    - `geometry` union, required
      - GeofencePolygonGeometry — Polygon geometry with coordinates as array of coordinate objects
        - `type` 'polygon', required
        - `coordinates` object[], required — Array of coordinate objects, each containing latitude and longitude
          - `latitude` number, required — Latitude coordinate
          - `longitude` number, required — Longitude coordinate
      - GeofenceCircleGeometry — Circle geometry with center coordinates and radius
        - `type` 'circle', required
        - `coordinates` object[], required — Array with single coordinate object containing latitude and longitude
          - `latitude` number, required — Latitude coordinate
          - `longitude` number, required — Longitude coordinate
        - `radius` number, required — Radius in meters
    - `created_at` string, date-time, required — When the geofence was created
    - `updated_at` string, date-time, required — When the geofence was last updated

## Other responses

- `400` — Invalid input
- `401` — Unauthorized
- `500` — Server error

---

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