Geofence API

Create, manage, and query virtual geographic boundaries. Check if a point is inside a geofence for delivery zones, restricted areas, and location-based alerts.

Try in Playground →

Endpoint

POST/v4/geofence/create.json

Authentication

Include your token in the request header:

X-Authorization-Token: your_token

Parameters

NameTypeDescription
namestringName for the geofence
geometryobjectGeoJSON polygon coordinates

Code Examples

curl -X POST "https://apihub.latlong.ai/v4/geofence/create.json" \
  -H "X-Authorization-Token: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "coordinates": [
    [
      77.59,
      12.97
    ],
    [
      77.6,
      12.98
    ]
  ]
}'

Example Response

JSON
{
  "status": "success",
  "geofence_id": "gf_abc123",
  "message": "Geofence created successfully"
}

Related Endpoints

GET/v4/geofence/contains.json
GET/v4/geofence/list.json
GET/v4/geofence/details.json
POST/v4/geofence/update.json