Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Traccar Permissions API
description: Traccar GPS tracking server API documentation. To use the API you need to have a server instance. For testing purposes you can use one of free demo servers. For production use you can install your own server or get a subscription service.
contact:
name: Traccar Support
url: https://www.traccar.org/
email: support@traccar.org
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 6.17.0
servers:
- url: https://demo.traccar.org/api
description: Demo Server 1
- url: https://demo2.traccar.org/api
description: Demo Server 2
- url: https://demo3.traccar.org/api
description: Demo Server 3
- url: https://demo4.traccar.org/api
description: Demo Server 4
- url: https://server.traccar.org/api
description: Subscription Server
- url: http://{host}:{port}/api
description: Other Server
variables:
host:
default: localhost
port:
enum:
- '8082'
- '80'
default: '8082'
security:
- BasicAuth: []
- ApiKey: []
tags:
- name: Permissions
description: User permissions and other object linking
paths:
/permissions:
get:
operationId: getPermissions
summary: Fetch permission links between Objects
description: 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.
tags:
- Permissions
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Permission'
'400':
description: Bad request
content: {}
post:
operationId: postPermissions
summary: Link an Object to another Object
tags:
- Permissions
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
required: true
responses:
'204':
description: No Content
content: {}
'400':
description: No permission
content: {}
delete:
operationId: deletePermissions
summary: Unlink an Object from another Object
tags:
- Permissions
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
required: true
responses:
'204':
description: No Content
content: {}
'401':
description: Unauthorized
content: {}
/permissions/bulk:
post:
operationId: postPermissionsBulk
summary: Link multiple Objects in a single request
tags:
- Permissions
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Permission'
required: true
responses:
'204':
description: No Content
content: {}
'400':
description: Bad request
content: {}
delete:
operationId: deletePermissionsBulk
summary: Unlink multiple Objects in a single request
tags:
- Permissions
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Permission'
required: true
responses:
'204':
description: No Content
content: {}
'400':
description: Bad request
content: {}
components:
schemas:
Permission:
type: object
properties:
userId:
type: integer
format: int64
description: User id, can be only first parameter
deviceId:
type: integer
format: int64
description: Device id, can be first parameter or second only in combination with userId
groupId:
type: integer
format: int64
description: Group id, can be first parameter or second only in combination with userId
geofenceId:
type: integer
format: int64
description: Geofence id, can be second parameter only
notificationId:
type: integer
format: int64
description: Notification id, can be second parameter only
calendarId:
type: integer
format: int64
description: Calendar id, can be second parameter only and only in combination with userId
attributeId:
type: integer
format: int64
description: Computed attribute id, can be second parameter only
driverId:
type: integer
format: int64
description: Driver id, can be second parameter only
managedUserId:
type: integer
format: int64
description: User id, can be second parameter only and only in combination with userId
commandId:
type: integer
format: int64
description: Saved command id, can be second parameter only
description: '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 }'
securitySchemes:
BasicAuth:
type: http
scheme: basic
ApiKey:
type: http
scheme: bearer