Skip to content

Traccar (6.10.0)

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.

Download OpenAPI description
Overview
Languages
Servers
Mock server
https://docs2.mygpsapi.com/_mock/openapi
Doha Dynamics API (Production)
https://mygpsapi.com/api

Server

Server information

Operations

Session

User session management

Operations

Devices

Device management

Operations

Groups

Group management

Operations

Users

User management

Operations

Permissions

User permissions and other object linking

Operations

Positions

Retrieving raw location information

Operations

Events

Retrieving event information

Operations

Reports

Reports generation

Operations

Notifications

User notifications management

Operations

Geofences

Geofence management

Operations

Commands

Sending commands to devices and stored command management

Operations

Fetch a list of Saved Commands

Request

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

Security
BasicAuth or ApiKey
Query
allboolean

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

userIdinteger

Standard users can use this only with their own userId

deviceIdinteger

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

groupIdinteger

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

refreshboolean
curl -i -X GET \
  -u <username>:<password> \
  'https://docs2.mygpsapi.com/_mock/openapi/commands?all=true&userId=0&deviceId=0&groupId=0&refresh=true'

Responses

OK

Bodyapplication/jsonArray [
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
]
Response
application/json
[ { "id": 0, "deviceId": 0, "description": "string", "type": "string", "attributes": {} } ]

Create a Saved Command

Request

Security
BasicAuth or ApiKey
Bodyapplication/jsonrequired
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
curl -i -X POST \
  -u <username>:<password> \
  https://docs2.mygpsapi.com/_mock/openapi/commands \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "deviceId": 0,
    "description": "string",
    "type": "string",
    "attributes": {}
  }'

Responses

OK

Bodyapplication/json
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
Response
application/json
{ "id": 0, "deviceId": 0, "description": "string", "type": "string", "attributes": {} }

Update a Saved Command

Request

Security
BasicAuth or ApiKey
Path
idintegerrequired
Bodyapplication/jsonrequired
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
curl -i -X PUT \
  -u <username>:<password> \
  'https://docs2.mygpsapi.com/_mock/openapi/commands/{id}' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "deviceId": 0,
    "description": "string",
    "type": "string",
    "attributes": {}
  }'

Responses

OK

Bodyapplication/json
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
Response
application/json
{ "id": 0, "deviceId": 0, "description": "string", "type": "string", "attributes": {} }

Delete a Saved Command

Request

Security
BasicAuth or ApiKey
Path
idintegerrequired
curl -i -X DELETE \
  -u <username>:<password> \
  'https://docs2.mygpsapi.com/_mock/openapi/commands/{id}'

Responses

No Content

Body

Fetch a list of Saved Commands supported by Device at the moment

Request

Return a list of saved commands linked to Device and its groups, filtered by current Device protocol support

Security
BasicAuth or ApiKey
Query
deviceIdinteger

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

curl -i -X GET \
  -u <username>:<password> \
  'https://docs2.mygpsapi.com/_mock/openapi/commands/send?deviceId=0'

Responses

OK

Bodyapplication/jsonArray [
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
]
Response
application/json
[ { "id": 0, "deviceId": 0, "description": "string", "type": "string", "attributes": {} } ]

Dispatch commands to device

Request

Dispatch a new command or Saved Command if body.id set

Security
BasicAuth or ApiKey
Bodyapplication/jsonrequired
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
curl -i -X POST \
  -u <username>:<password> \
  https://docs2.mygpsapi.com/_mock/openapi/commands/send \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "deviceId": 0,
    "description": "string",
    "type": "string",
    "attributes": {}
  }'

Responses

Command sent

Bodyapplication/json
idinteger(int64)
deviceIdinteger(int64)
descriptionstring
typestring
attributesobject
Response
application/json
{ "id": 0, "deviceId": 0, "description": "string", "type": "string", "attributes": {} }

Fetch a list of available Commands for the Device or all possible Commands if Device ommited

Request

Security
BasicAuth or ApiKey
Query
deviceIdinteger

Internal device identifier. Only works if device has already reported some locations

protocolstring

Protocol name. Can be used instead of device id

textChannelboolean

When true return SMS commands. If not specified or false return data commands

curl -i -X GET \
  -u <username>:<password> \
  'https://docs2.mygpsapi.com/_mock/openapi/commands/types?deviceId=0&protocol=string&textChannel=true'

Responses

OK

Bodyapplication/jsonArray [
typestring
]
Response
application/json
[ { "type": "string" } ]

Attributes

Computed attributes management

Operations

Drivers

Drivers management

Operations

Maintenance

Maintenance management

Operations

Calendars

Calendar management

Operations

Statistics

Retrieving server statistics

Operations