device connections editing

Hichem20 days ago

Hello there,
I am trying to integrate traccar with my tracking system, I managed to create devices, geofences, and notifications through the API provided by traccar.
I there a way to make the connection between a device, geofences and notifications remotly , in the same way as provided in the traccar server UI under /settings/device/1/connections?
Screenshot 2025-09-30 124028.png
thank you!

Anton Tananaev19 days ago

Yes, the web app is using the same API.

Hichem19 days ago

thank you Anton for your reply,
actually I could find the right rest API to manage the connections, I have tried the GET {{baseUrl}}/settings/device/1/connections , but didn't work for me.
Screenshot 2025-09-30 233640.png

So I searched again and found a way , through this endpoint ----> GET {{baseUrl}}/api/geofences?deviceId=1 <----- to extract the geofences assigned to a device as in the screenshot. (same for notifications assigned to a deviceId : GET {{baseUrl}}/api/notifications?deviceId=1)

Screenshot 2025-09-30 232957.png

My question now is, through which POST endpoint I can assign a Geofence to a Device.

Anton Tananaev19 days ago

Just checked what the web app does.

bluelaser18 days ago
Hichem17 days ago

thank you all !
here's how it works: call the endpoint with at most 2 objects Id as follow (not all objects in one call)

---> POST {{baseUrl}}/permissions 
body: {
         "deviceId": 1,
         "geofenceId": 1
         }

for assigning a notification to a device:

---> POST {{baseUrl}}/permissions 
body: {
         "deviceId": 1,
         "notificationId": 1
         }