Devices and tracking

Geofences

Geofence management

Fetch a list of Geofences

GET
https://demo.traccar.org/api/geofences

Without params, it returns a list of Geofences the user has access to

Parameters

allbooleanquery

Can only be used by admins or managers to fetch all entities

userIdintegerquery

Standard users can use this only with their own userId

deviceIdintegerquery

Standard users can use this only with _deviceId_s, they have access to

groupIdintegerquery

Standard users can use this only with _groupId_s, they have access to

refreshbooleanquery
limitintegerquery

Limit the number of returned results

offsetintegerquery

Offset for pagination

keywordstringquery

Search keyword filter

Response

OK

Response fields application/json
Show child attributes
idinteger<int64>

Unique identifier for the geofence

namestring

Human-readable name shown in lists and maps

descriptionstring

Details about the geofence for display in the UI

areastring

Geofence area definition encoded as a WKT string

calendarIdinteger<int64>

Calendar identifier limiting when the geofence is active

attributesobject

Custom key-value pairs for integrations or UI overrides

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Create a Geofence

POST
https://demo.traccar.org/api/geofences

Body

application/json
idinteger<int64>

Unique identifier for the geofence

namestring

Human-readable name shown in lists and maps

descriptionstring

Details about the geofence for display in the UI

areastring

Geofence area definition encoded as a WKT string

calendarIdinteger<int64>

Calendar identifier limiting when the geofence is active

attributesobject

Custom key-value pairs for integrations or UI overrides

Response

OK

Response fields application/json
idinteger<int64>

Unique identifier for the geofence

namestring

Human-readable name shown in lists and maps

descriptionstring

Details about the geofence for display in the UI

areastring

Geofence area definition encoded as a WKT string

calendarIdinteger<int64>

Calendar identifier limiting when the geofence is active

attributesobject

Custom key-value pairs for integrations or UI overrides

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Fetch a Geofence

GET
https://demo.traccar.org/api/geofences/{id}

Parameters

idintegerrequiredpath

Response

OK

Response fields application/json
idinteger<int64>

Unique identifier for the geofence

namestring

Human-readable name shown in lists and maps

descriptionstring

Details about the geofence for display in the UI

areastring

Geofence area definition encoded as a WKT string

calendarIdinteger<int64>

Calendar identifier limiting when the geofence is active

attributesobject

Custom key-value pairs for integrations or UI overrides

401Unauthorized

Unauthorized

404Not Found

Not found

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Update a Geofence

PUT
https://demo.traccar.org/api/geofences/{id}

Body

application/json
idinteger<int64>

Unique identifier for the geofence

namestring

Human-readable name shown in lists and maps

descriptionstring

Details about the geofence for display in the UI

areastring

Geofence area definition encoded as a WKT string

calendarIdinteger<int64>

Calendar identifier limiting when the geofence is active

attributesobject

Custom key-value pairs for integrations or UI overrides

Parameters

idintegerrequiredpath

Response

OK

Response fields application/json
idinteger<int64>

Unique identifier for the geofence

namestring

Human-readable name shown in lists and maps

descriptionstring

Details about the geofence for display in the UI

areastring

Geofence area definition encoded as a WKT string

calendarIdinteger<int64>

Calendar identifier limiting when the geofence is active

attributesobject

Custom key-value pairs for integrations or UI overrides

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Delete a Geofence

DELETE
https://demo.traccar.org/api/geofences/{id}

Parameters

idintegerrequiredpath

Response

204No Content

No Content

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)