Geofences

Read Geofences

Returns all geofences that belong to the authenticated organization.

Endpoint

GET /geofences

When to Use

Use this endpoint when loading geofence layers for map views or geofence selection lists.

Authentication

This endpoint requires an API key. Send either x-api-key: <api_key> or Authorization: Bearer <api_key>.
Requests are rate-limited per organization.

Example Request

curl --request GET \
  --url https://api.jitra.app/public/v1/geofences \
  --header 'x-api-key: <api_key>'

Example Response

Successful response (200 OK):

{
  "statusCode": 200,
  "result": [
    {
      "id": 12,
      "name": "Warehouse Zone",
      "description": "Main operational area",
      "color": "#00AAFF",
      "coordinates": [
        [106.8, -6.2],
        [106.81, -6.2],
        [106.81, -6.21],
        [106.8, -6.21]
      ],
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-10T00:00:00.000Z"
    }
  ]
}

Response Fields

All fields below are taken from each object inside result.

FieldTypeDescription
idnumberGeofence ID.
namestringGeofence name.
descriptionstringGeofence description.
colorstringDisplay color (hex or configured color value).
coordinatesarray of coordinate pairsPolygon points where each item is [longitude, latitude].
created_atstring (ISO 8601 datetime)Record creation timestamp.
updated_atstring (ISO 8601 datetime)Last update timestamp.

Error Responses

Main Error Responses

HTTP StatusExample errorCodeWhen It Happens
401ERR999API key is missing, invalid, or expired.
400PUBLIC.400_xxxThe request format or parameter values are invalid.

Other Error Responses

HTTP StatuserrorCodeWhen It Happens
429ERR999Too many requests for the current organization throttle window.

Notes

Coordinates are returned as stored geofence polygon points.