Vehicles
List Vehicles
GET /v2/vehicles
Field | Description |
---|---|
attributes | Array 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. |
includes | Object specifying which related entities to include in the query. It contains arrays for 'devices', 'enterprises', 'users', and 'document'. |
filters | Object 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). |
search | String specifying the search query with a maximum length of 100 characters. |
limit | Specifies the maximum number of results to return. The value must be a number, capped between 1 and 100. |
page | Specifies the page number for paginated results. It should be a number greater than or equal to 0, indicating the desired page. |
count | Boolean indicating whether to include the total count of results in the response. |
sort | Object specifying sorting criteria, with options for 'batch', 'brand', 'label', 'trim', and 'vin' fields. Values can be -1 (descending order) or 1 (ascending order). |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad 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"
}
}
}
]
}
}
Field | Description | Required |
---|---|---|
data | Array of objects representing vehicle data. | |
attributes | Object containing vehicle attributes. At least one of the fields 'plate' or 'vin' must be present. | true |
- plate | String named after the vehicle's license plate, with maximum length of 16 characters. | |
- vin | String named after the Vehicle Identification Number (VIN), with maximum length of 20 characters. | |
- type | String named after the type of vehicle, with maximum length of 20 characters. Must be one of the predefined vehicle types. | true |
- code | String named after the vehicle code, with maximum length of 16 characters. | false |
- brand | String named after the vehicle brand, with maximum length of 20 characters. | false |
- model | String named after the vehicle model, with maximum length of 20 characters. | false |
- year | String named after the year of the vehicle, with maximum length of 10 characters. | false |
- description | String named after the description of the vehicle, with maximum length of 20 characters. | false |
- color | String named after the vehicle color. Must be one of the predefined color keys, with maximum length of 7 characters. | false |
- batch | String named after the batch information of the vehicle, with maximum length of 20 characters. | false |
- registration_number | String named after the registration number of the vehicle, with maximum length of 20 characters. | false |
relationships | Object containing relationship data. | false |
- enterprise | Object representing the relationship with an enterprise. | false |
-- type | String named after the type of relationship, must be 'enterprise'. | true |
-- id | String named after the ID of the enterprise, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Resource Already Exists', 'Vehicle`s Enterprise is Missing' or 'Vehicle`s Type is Missing' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Delete Vehicles
DELETE /v2/vehicles
Payload
{
"body": {
"data": [
{
"type": "vehicles",
"id": "abc123def456ghi"
}
]
}
}
Field | Description | Required |
---|---|---|
data | Array of objects representing vehicle data. | |
type | Type of data object. Must be 'vehicles'. | true |
id | ID of the vehicle. Must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
This operation does not require authentication
Show Vehicle
GET /v2/vehicles/{id}
Parameter | Description |
---|---|
attributes | An 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. |
includes | Specifies 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'. |
- device | Array of device attributes to include. It can contain values such as 'name', 'imei', 'code'. |
- enterprise | Array of enterprise attributes to include. It can contain values such as 'name', 'cnpj'. |
- users | Array of user attributes to include. It can contain values such as 'name', 'username', 'cpf', 'email', 'phone1'. |
- document | Array of document attributes to include. It can contain values such as 'file_size', 'created_at', 'folder', 'key_name', 'mime', 'name'. |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad Request |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not 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"
}
}
}
}
}
Field | Description | Required |
---|---|---|
data | Array of objects representing vehicle data. | |
attributes | Object containing vehicle attributes. At least one of the fields 'plate' or 'vin' must be present. | true |
- plate | String named after the vehicle's license plate, with maximum length of 16 characters. | |
- vin | String named after the Vehicle Identification Number (VIN), with maximum length of 20 characters. | |
- type | String named after the type of vehicle, with maximum length of 20 characters. Must be one of the predefined vehicle types. | true |
- code | String named after the vehicle code, with maximum length of 16 characters. | false |
- brand | String named after the vehicle brand, with maximum length of 20 characters. | false |
- model | String named after the vehicle model, with maximum length of 20 characters. | false |
- year | String named after the year of the vehicle, with maximum length of 10 characters. | false |
- description | String named after the description of the vehicle, with maximum length of 20 characters. | false |
- color | String named after the vehicle color. Must be one of the predefined color keys, with maximum length of 7 characters. | false |
- batch | String named after the batch information of the vehicle, with maximum length of 20 characters. | false |
- registration_number | String named after the registration number of the vehicle, with maximum length of 20 characters. | false |
relationships | Object containing relationship data. | false |
- enterprise | Object representing the relationship with an enterprise. | false |
-- type | String named after the type of relationship, must be 'enterprise'. | true |
-- id | String named after the ID of the enterprise, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One 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' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Udpate {situation} Vehicles
PATCH /v2/vehicles/{id}/status/{situation}
Parameters
{
"params": {
"id": "ABC1234567890DEF",
"situation": "activation"
}
}
Field | Description | Required |
---|---|---|
id | String containing the ID, must follow the alphanumeric pattern and have a length of 15 characters. | true |
situation | String indicating the situation, must be either 'activation' or 'deactivation'. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad Request |
This operation does not require authentication