Docs
Vehicles
Vehicles

Vehicles

List Vehicles

GET /v2/vehicles

FieldDescription
attributesArray of attributes to retrieve. It can contain values such as 'batch', 'plate', 'code', 'vin', 'type', 'brand', 'model', 'year', 'description', 'registration_number', 'color', 'user_names', 'deactivated_at'. If null, all information is retrieved.
includesObject specifying which related entities to include in the query. It contains arrays for 'devices', 'enterprises', 'users', and 'document'.
filtersObject specifying filters for different fields like 'asset_vehicles.plate', 'asset_vehicles.vin', 'asset_vehicles.type', etc. Each filter field can have conditions like 'eq' (equal), 'neq' (not equal), 'ilk' (starts with), 'ew' (ends with), 'sw' (contains).
searchString specifying the search query with a maximum length of 100 characters.
limitSpecifies the maximum number of results to return. The value must be a number, capped between 1 and 100.
pageSpecifies the page number for paginated results. It should be a number greater than or equal to 0, indicating the desired page.
countBoolean indicating whether to include the total count of results in the response.
sortObject specifying sorting criteria, with options for 'batch', 'brand', 'label', 'trim', and 'vin' fields. Values can be -1 (descending order) or 1 (ascending order).

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestBad Request

This operation does not require authentication

Create Vehicles

POST /v2/vehicles

Payload

{
  "body": {
    "data": [
      {
        "attributes": {
          "plate": "ABC1234",
          "vin": "12345678901234567",
          "type": "sedan",
          "code": "12345",
          "brand": "Toyota",
          "model": "Corolla",
          "year": "2020",
          "description": "Vehicle description",
          "color": "red",
          "batch": "67890",
          "registration_number": "R1234567"
        },
        "relationships": {
          "enterprise": {
            "type": "enterprise",
            "id": "abc123def456ghi"
          }
        }
      }
    ]
  }
}
FieldDescriptionRequired
dataArray of objects representing vehicle data.
attributesObject containing vehicle attributes. At least one of the fields 'plate' or 'vin' must be present.true
- plateString named after the vehicle's license plate, with maximum length of 16 characters.
- vinString named after the Vehicle Identification Number (VIN), with maximum length of 20 characters.
- typeString named after the type of vehicle, with maximum length of 20 characters. Must be one of the predefined vehicle types.true
- codeString named after the vehicle code, with maximum length of 16 characters.false
- brandString named after the vehicle brand, with maximum length of 20 characters.false
- modelString named after the vehicle model, with maximum length of 20 characters.false
- yearString named after the year of the vehicle, with maximum length of 10 characters.false
- descriptionString named after the description of the vehicle, with maximum length of 20 characters.false
- colorString named after the vehicle color. Must be one of the predefined color keys, with maximum length of 7 characters.false
- batchString named after the batch information of the vehicle, with maximum length of 20 characters.false
- registration_numberString named after the registration number of the vehicle, with maximum length of 20 characters.false
relationshipsObject containing relationship data.false
- enterpriseObject representing the relationship with an enterprise.false
-- typeString named after the type of relationship, must be 'enterprise'.true
-- idString named after the ID of the enterprise, must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Bad Request', 'Resource Already Exists', 'Vehicle`s Enterprise is Missing' or 'Vehicle`s Type is Missing'
401UnauthorizedUnauthorized
404Not FoundNot Found

This operation does not require authentication

Delete Vehicles

DELETE /v2/vehicles

Payload

{
  "body": {
    "data": [
      {
        "type": "vehicles",
        "id": "abc123def456ghi"
      }
    ]
  }
}
FieldDescriptionRequired
dataArray of objects representing vehicle data.
typeType of data object. Must be 'vehicles'.true
idID of the vehicle. Must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response

This operation does not require authentication

Show Vehicle

GET /v2/vehicles/{id}

ParameterDescription
attributesAn array of attributes to retrieve. It can include values such as 'batch', 'plate', 'code', 'vin', 'type', 'brand', 'model', 'year', 'description', 'registration_number', 'color', 'user_names', 'deactivated_at'. If null, all information is retrieved.
includesSpecifies related entities to include in the query. It contains arrays for 'device', 'enterprise', 'users', and 'document'. Each array can include values like 'name', 'imei', 'code', 'cnpj', 'username', 'cpf', 'email', 'phone1', 'file_size', 'created_at', 'folder', 'key_name', 'mime', 'name'.
- deviceArray of device attributes to include. It can contain values such as 'name', 'imei', 'code'.
- enterpriseArray of enterprise attributes to include. It can contain values such as 'name', 'cnpj'.
- usersArray of user attributes to include. It can contain values such as 'name', 'username', 'cpf', 'email', 'phone1'.
- documentArray of document attributes to include. It can contain values such as 'file_size', 'created_at', 'folder', 'key_name', 'mime', 'name'.

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestBad Request
401UnauthorizedUnauthorized
404Not FoundNot Found

This operation does not require authentication

Update Vehicle

PATCH /v2/vehicles/{id}

Payload

{
  "body": {
    "data": {
      "attributes": {
        "plate": "ABC1234",
        "vin": "1HGCM82633A005352",
        "type": "sedan",
        "code": "ABC123",
        "brand": "Honda",
        "model": "Civic",
        "year": "2022",
        "description": "Red sedan",
        "color": "red",
        "batch": "202201",
        "registration_number": "DEF456"
      },
      "relationships": {
        "enterprise": {
          "type": "enterprise",
          "id": "GHI789012345678"
        }
      }
    }
  }
}
FieldDescriptionRequired
dataArray of objects representing vehicle data.
attributesObject containing vehicle attributes. At least one of the fields 'plate' or 'vin' must be present.true
- plateString named after the vehicle's license plate, with maximum length of 16 characters.
- vinString named after the Vehicle Identification Number (VIN), with maximum length of 20 characters.
- typeString named after the type of vehicle, with maximum length of 20 characters. Must be one of the predefined vehicle types.true
- codeString named after the vehicle code, with maximum length of 16 characters.false
- brandString named after the vehicle brand, with maximum length of 20 characters.false
- modelString named after the vehicle model, with maximum length of 20 characters.false
- yearString named after the year of the vehicle, with maximum length of 10 characters.false
- descriptionString named after the description of the vehicle, with maximum length of 20 characters.false
- colorString named after the vehicle color. Must be one of the predefined color keys, with maximum length of 7 characters.false
- batchString named after the batch information of the vehicle, with maximum length of 20 characters.false
- registration_numberString named after the registration number of the vehicle, with maximum length of 20 characters.false
relationshipsObject containing relationship data.false
- enterpriseObject representing the relationship with an enterprise.false
-- typeString named after the type of relationship, must be 'enterprise'.true
-- idString named after the ID of the enterprise, must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Bad Request', 'Not Found Enterprise Ownership', 'Vehicle`s Type is Missing', 'Vehicle and User are In Different Enterprises', 'Vehicle`s new Enterprise Does Not Belong to Same Owner' or 'Vehicle Cannot be Changed to Another Asset Type'
401UnauthorizedUnauthorized
404Not FoundNot Found

This operation does not require authentication

Udpate {situation} Vehicles

PATCH /v2/vehicles/{id}/status/{situation}

Parameters

{
  "params": {
    "id": "ABC1234567890DEF",
    "situation": "activation"
  }
}
FieldDescriptionRequired
idString containing the ID, must follow the alphanumeric pattern and have a length of 15 characters.true
situationString indicating the situation, must be either 'activation' or 'deactivation'.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestBad Request

This operation does not require authentication