Devices and tracking

Devices

Device management

Fetch a list of Devices

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

Without any params, returns a list of the user's devices

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

idintegerquery

To fetch one or more devices. Multiple params can be passed like id=31&id=42

uniqueIdstringquery

To fetch one or more devices. Multiple params can be passed like uniqueId=333331&uniqieId=44442

excludeAttributesbooleanquery

Exclude attributes field from device payload

limitintegerquery

Limit the number of returned results

offsetintegerquery

Offset for pagination

keywordstringquery

Search keyword filter (searches name, uniqueId, phone, model, contact)

Response

OK

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

Unique identifier assigned by Traccar

namestring

Human friendly device label

uniqueIdstring

Hardware or protocol specific unique identifier

statusstring

Current connection status such as online, offline, or unknown

disabledboolean

Whether the device is disabled by an administrator

lastUpdatestring<date-time> | null

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

positionIdinteger<int64> | null

Identifier of the last known position

groupIdinteger<int64> | null

Parent group identifier when the device is assigned to a group

phonestring | null

Contact phone number used for SMS commands

modelstring | null

Device model or hardware revision

contactstring | null

Responsible person's contact information

categorystring | null

Free form category used for grouping devices in the UI

attributesobject

Custom attributes for protocol or business specific data

400Bad Request

No permission

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Create a Device

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

Body

application/json
idinteger<int64>

Unique identifier assigned by Traccar

namestring

Human friendly device label

uniqueIdstring

Hardware or protocol specific unique identifier

statusstring

Current connection status such as online, offline, or unknown

disabledboolean

Whether the device is disabled by an administrator

lastUpdatestring<date-time> | null

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

positionIdinteger<int64> | null

Identifier of the last known position

groupIdinteger<int64> | null

Parent group identifier when the device is assigned to a group

phonestring | null

Contact phone number used for SMS commands

modelstring | null

Device model or hardware revision

contactstring | null

Responsible person's contact information

categorystring | null

Free form category used for grouping devices in the UI

attributesobject

Custom attributes for protocol or business specific data

Response

200OKDevice

OK

Response fields application/json
idinteger<int64>

Unique identifier assigned by Traccar

namestring

Human friendly device label

uniqueIdstring

Hardware or protocol specific unique identifier

statusstring

Current connection status such as online, offline, or unknown

disabledboolean

Whether the device is disabled by an administrator

lastUpdatestring<date-time> | null

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

positionIdinteger<int64> | null

Identifier of the last known position

groupIdinteger<int64> | null

Parent group identifier when the device is assigned to a group

phonestring | null

Contact phone number used for SMS commands

modelstring | null

Device model or hardware revision

contactstring | null

Responsible person's contact information

categorystring | null

Free form category used for grouping devices in the UI

attributesobject

Custom attributes for protocol or business specific data

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Fetch a Device

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

Parameters

idintegerrequiredpath

Response

200OKDevice

OK

Response fields application/json
idinteger<int64>

Unique identifier assigned by Traccar

namestring

Human friendly device label

uniqueIdstring

Hardware or protocol specific unique identifier

statusstring

Current connection status such as online, offline, or unknown

disabledboolean

Whether the device is disabled by an administrator

lastUpdatestring<date-time> | null

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

positionIdinteger<int64> | null

Identifier of the last known position

groupIdinteger<int64> | null

Parent group identifier when the device is assigned to a group

phonestring | null

Contact phone number used for SMS commands

modelstring | null

Device model or hardware revision

contactstring | null

Responsible person's contact information

categorystring | null

Free form category used for grouping devices in the UI

attributesobject

Custom attributes for protocol or business specific data

401Unauthorized

Unauthorized

404Not Found

Not found

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Update a Device

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

Body

application/json
idinteger<int64>

Unique identifier assigned by Traccar

namestring

Human friendly device label

uniqueIdstring

Hardware or protocol specific unique identifier

statusstring

Current connection status such as online, offline, or unknown

disabledboolean

Whether the device is disabled by an administrator

lastUpdatestring<date-time> | null

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

positionIdinteger<int64> | null

Identifier of the last known position

groupIdinteger<int64> | null

Parent group identifier when the device is assigned to a group

phonestring | null

Contact phone number used for SMS commands

modelstring | null

Device model or hardware revision

contactstring | null

Responsible person's contact information

categorystring | null

Free form category used for grouping devices in the UI

attributesobject

Custom attributes for protocol or business specific data

Parameters

idintegerrequiredpath

Response

200OKDevice

OK

Response fields application/json
idinteger<int64>

Unique identifier assigned by Traccar

namestring

Human friendly device label

uniqueIdstring

Hardware or protocol specific unique identifier

statusstring

Current connection status such as online, offline, or unknown

disabledboolean

Whether the device is disabled by an administrator

lastUpdatestring<date-time> | null

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

positionIdinteger<int64> | null

Identifier of the last known position

groupIdinteger<int64> | null

Parent group identifier when the device is assigned to a group

phonestring | null

Contact phone number used for SMS commands

modelstring | null

Device model or hardware revision

contactstring | null

Responsible person's contact information

categorystring | null

Free form category used for grouping devices in the UI

attributesobject

Custom attributes for protocol or business specific data

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Delete a Device

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

Parameters

idintegerrequiredpath

Response

204No Content

No Content

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Update total distance and hours of the Device

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

Body

application/json
deviceIdinteger<int64>

Device identifier for the accumulator entry

totalDistancenumber

in meters

hoursnumber

Total engine hours recorded by the device

Parameters

idintegerrequiredpath

Response

204No Content

No Content

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Upload/Update Device image

POST
https://demo.traccar.org/api/devices/{id}/image

Body

image/*
string<binary>

Parameters

idintegerrequiredpath

Response

200OKstring

OK

Response fields text/plain
string
400Bad Request

Invalid image type or size

404Not Found

Device not found

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)