Users and access

Permissions

User permissions and other object linking

Fetch permission links between Objects

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

Provide exactly two *Id query parameters matching the Permission body shape (e.g. reportId and deviceId). Use 0 on a side to mean "any", e.g. ?reportId=5&deviceId=0 lists all devices linked to report 5. At least one side must be non-zero.

Response

OK

Response fields application/json
Show child attributes

This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }

userIdinteger<int64>

User id, can be only first parameter

deviceIdinteger<int64>

Device id, can be first parameter or second only in combination with userId

groupIdinteger<int64>

Group id, can be first parameter or second only in combination with userId

geofenceIdinteger<int64>

Geofence id, can be second parameter only

notificationIdinteger<int64>

Notification id, can be second parameter only

calendarIdinteger<int64>

Calendar id, can be second parameter only and only in combination with userId

attributeIdinteger<int64>

Computed attribute id, can be second parameter only

driverIdinteger<int64>

Driver id, can be second parameter only

managedUserIdinteger<int64>

User id, can be second parameter only and only in combination with userId

commandIdinteger<int64>

Saved command id, can be second parameter only

400Bad Request

Bad request

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Link an Object to another Object

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

Body

application/json

This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }

userIdinteger<int64>

User id, can be only first parameter

deviceIdinteger<int64>

Device id, can be first parameter or second only in combination with userId

groupIdinteger<int64>

Group id, can be first parameter or second only in combination with userId

geofenceIdinteger<int64>

Geofence id, can be second parameter only

notificationIdinteger<int64>

Notification id, can be second parameter only

calendarIdinteger<int64>

Calendar id, can be second parameter only and only in combination with userId

attributeIdinteger<int64>

Computed attribute id, can be second parameter only

driverIdinteger<int64>

Driver id, can be second parameter only

managedUserIdinteger<int64>

User id, can be second parameter only and only in combination with userId

commandIdinteger<int64>

Saved command id, can be second parameter only

Response

204No Content

No Content

400Bad Request

No permission

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Unlink an Object from another Object

DELETE
https://demo.traccar.org/api/permissions

Body

application/json

This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }

userIdinteger<int64>

User id, can be only first parameter

deviceIdinteger<int64>

Device id, can be first parameter or second only in combination with userId

groupIdinteger<int64>

Group id, can be first parameter or second only in combination with userId

geofenceIdinteger<int64>

Geofence id, can be second parameter only

notificationIdinteger<int64>

Notification id, can be second parameter only

calendarIdinteger<int64>

Calendar id, can be second parameter only and only in combination with userId

attributeIdinteger<int64>

Computed attribute id, can be second parameter only

driverIdinteger<int64>

Driver id, can be second parameter only

managedUserIdinteger<int64>

User id, can be second parameter only and only in combination with userId

commandIdinteger<int64>

Saved command id, can be second parameter only

Response

204No Content

No Content

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Link multiple Objects in a single request

POST
https://demo.traccar.org/api/permissions/bulk

Body

application/json
Show child attributes

This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }

userIdinteger<int64>

User id, can be only first parameter

deviceIdinteger<int64>

Device id, can be first parameter or second only in combination with userId

groupIdinteger<int64>

Group id, can be first parameter or second only in combination with userId

geofenceIdinteger<int64>

Geofence id, can be second parameter only

notificationIdinteger<int64>

Notification id, can be second parameter only

calendarIdinteger<int64>

Calendar id, can be second parameter only and only in combination with userId

attributeIdinteger<int64>

Computed attribute id, can be second parameter only

driverIdinteger<int64>

Driver id, can be second parameter only

managedUserIdinteger<int64>

User id, can be second parameter only and only in combination with userId

commandIdinteger<int64>

Saved command id, can be second parameter only

Response

204No Content

No Content

400Bad Request

Bad request

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Unlink multiple Objects in a single request

DELETE
https://demo.traccar.org/api/permissions/bulk

Body

application/json
Show child attributes

This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }

userIdinteger<int64>

User id, can be only first parameter

deviceIdinteger<int64>

Device id, can be first parameter or second only in combination with userId

groupIdinteger<int64>

Group id, can be first parameter or second only in combination with userId

geofenceIdinteger<int64>

Geofence id, can be second parameter only

notificationIdinteger<int64>

Notification id, can be second parameter only

calendarIdinteger<int64>

Calendar id, can be second parameter only and only in combination with userId

attributeIdinteger<int64>

Computed attribute id, can be second parameter only

driverIdinteger<int64>

Driver id, can be second parameter only

managedUserIdinteger<int64>

User id, can be second parameter only and only in combination with userId

commandIdinteger<int64>

Saved command id, can be second parameter only

Response

204No Content

No Content

400Bad Request

Bad request

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)