Skip to main content
PATCH
/
vehicle
/
{vehicleId}
Update partially vehicle by ID
curl --request PATCH \
  --url https://apiweb.mile.app/api/v3/vehicle/{vehicleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Mini Van 35",
  "assignee": "leandro@mile.app",
  "speed": 30,
  "fixedCost": 15,
  "tags": [
    "Ganjil",
    "Depok",
    "B1124CC"
  ],
  "workingTime": {
    "startTime": "08:00",
    "endTime": "17:00",
    "multiday": 0
  },
  "breakTime": {
    "startTime": "11:00",
    "endTime": "11:30"
  },
  "capacity": {
    "width": {
      "min": 10,
      "max": 1000
    },
    "heigh": {
      "min": 10,
      "max": 1000
    }
  },
  "hubId": "621dd813eb3ebf16b94d6969"
}
'
{
  "status": true,
  "message": "Success",
  "data": {
    "name": "Mini Van 35",
    "assignee": "leandro@mile.app",
    "speed": 30,
    "fixedCost": 15,
    "tags": [
      "Ganjil",
      "Depok",
      "B1124CC"
    ],
    "workingTime": {
      "startTime": "08:00",
      "endTime": "17:00",
      "multiday": 0
    },
    "capacity": {
      "width": {
        "min": 10,
        "max": 1000
      },
      "height": {
        "min": 10,
        "max": 1000
      }
    },
    "organizationId": "621dd813eb3ebf16b94dbde3",
    "hubId": "621dd813eb3ebf16b94d6969",
    "updatedTime": "2022-07-13T03:16:40+00:00",
    "createdTime": "2022-07-13T03:16:40+00:00",
    "_id": "62ce3918d3f3e1681a3a54b2"
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Path Parameters

vehicleId
string
required

Unique identifier for the vehicle that generated by system. Example: 62ce3918d3f3e1681a3a54b2

Body

application/json
name
string

The name of vehicle. User can define vehicle name with vehicle's license plate, vehicle brand, or something else. Example: Mini Van 54

assignee
string

Worker's email that assigned to the vehicle. One vehicle can only be assigned by one worker. Example: leandro@mile.app

workingTime
object[]

Working hours on vehicles containing: startTime, endTime, and multiday. Example: { 'startTime':'08:00', 'endTime':'17:00', 'multiday':0 }

breakTime
object[]

Indicates that the data inside represents the break time for the vehicle. containing: startTime, and endTime.

speed
string

Assume the average speed (in km/h) of the vehicle.Speed cannot be less than 5 km/h. Example: 30 Default: 25

fixedCost
integer

The Cost Factor value range is set from 0 to 100, with the default value being 0. A lower number signifies a higher priority for routing optimization purposes. Example: 15 Default: 0

tags
object[]

The tag is used for route optimization purposes. Visits that have tags will be assigned to vehicles that have the same tags. Example: ['Ganjil','Depok','B1124CC']

hubId
string

Fundamental entity within an organization, serving as the central point for managing various operational components. Use GET /hubs endpoint to get the list of Hub IDs. Example: 634e98498ce07d29474a7e29

capacity
object[]

Capacity is used for route optimization purposes, it's dynamic based on user needs. It has minimum and maximum value as the limit for the shelter that can be accommodated by the vehicle. Example: { 'weight':{'min':10,'max':1000}, 'volume':{'min':10,'max':1000} }

Response

Success

status
string

Status of response.

message
string

Message of API response.

data
object

Detail of object vehicle.