Docs
Vehicles
Associations Devices

Associations Devices

Create Vehicles Associations Devices

POST /v2/vehicles/associations/devices

Payload

{
  "body": {
    "data": [
      {
        "device_id": "abc123def456ghi",
        "vehicle_id": "jkl789mno012pqr",
        "is_main_device": true
      }
    ]
  }
}
FieldDescriptionRequired
dataArray containing objects representing device associations.true
device_idString named after the ID of the device, validated using a regex for alphanumeric characters with length 15.true
vehicle_idString named after the ID of the vehicle, validated using a regex for alphanumeric characters with length 15.true
is_main_deviceBoolean indicating whether the device is the main device for the vehicle.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Device(s) Already Associated With Another Vehicle', 'Vehicle Already Has Main Device' or 'Vehicle And Device Are in Different Enterprises'
404Not FoundOne of 'Vehicle Not Found' or 'Device Not Found'

This operation does not require authentication

Delete Vehicles Associations Devices

DELETE /v2/vehicles/associations/devices

Payload

{
  "body": {
    "data": [
      {
        "type": "device_association",
        "id": "abc123def456ghi"
      }
    ]
  }
}
FieldDescriptionRequired
dataArray containing objects representing device associations. Each object must have a type and an id.
typeString that specifies the type of association, which must be equal to 'device_association'.true
idString specifying the ID of the association, must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne Vehicle-Device Association Must Be Main
404Not FoundAssociation Not Found

This operation does not require authentication

List Vehicles Associations Devices

GET /v2/vehicles/{vehicle_id}/associations/devices

ParameterDescription
attributesSpecifies which attributes to retrieve. Can include values like 'serial', 'number', 'carrier', 'service_provider', and 'batch'. If null, retrieves all information.
includesSpecifies related entities to include in the query. Contains arrays for 'device' and 'enterprise', each with its own set of possible values, such as 'name', 'imei', 'code' for the 'device' array, and 'name', 'cnpj' for the 'enterprise' array.
filtersSpecifies filters for various fields such as 'chips.serial', 'chips.number', 'chips.carrier', 'chips.service_provider', 'chips.batch', 'device.name', 'device.imei', 'device.code', 'enterprise.name', 'enterprise.cnpj'. Each filter field supports conditions like 'eq', 'neq', 'ilk', 'ew', 'sw'.
searchSpecifies the search query with a maximum length of 100 characters.
limitSpecifies the maximum number of results to return. Must be a number between 1 and 100.
pageSpecifies the page number for paginated results. Must be a number greater than or equal to 0.
countIndicates whether to include the total count of results in the response.
sortSpecifies sorting criteria for 'number' and 'serial' fields. Values can be -1 (descending order) or 1 (ascending order).

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestBad Request

This operation does not require authentication

Update Vehicles Associations Devices

PATCH /v2/vehicles/{vehicle_id}/associations/devices/{association_id}

Parameters

{
  "params": {
    "vehicle_id": "abc123DEF456GHI",
    "association_id": "JKL789mno012PQR"
  }
}
FieldDescriptionRequired
vehicle_idString named after the ID of the vehicle, composed of 15 alphanumeric characters.true
association_idString named after the ID of the association, composed of 15 alphanumeric characters.true

Payload

{
  "body": {
    "data": {
      "attributes": {
        "is_main_device": true
      }
    }
  }
}
FieldDescriptionRequired
dataObject containing the attributes of the data.true
attributesObject containing specific attributes of the data.
- is_main_deviceBoolean indicating whether the device is the main one.false

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne Vehicle-Device Association Must Be Main
404Not FoundAssociation Not Found

This operation does not require authentication