Skip to main content

Update vehicle by ID (alternative POST)

POST 

/truckers/vehicles/edit/:id

Alternative version of the PUT /{id} endpoint for updating vehicles using POST. Functionally equivalent to PUT /{id} but using the POST method.

Parameters:

  • id (required): Unique ID of the vehicle to update (MongoDB ObjectId)

Use cases:

  • Compatibility with clients that do not support PUT
  • Updates from HTML forms that only allow GET/POST

Modifiable fields:

  • type: Vehicle type
  • brand: Brand
  • model: Model
  • year: Year
  • images: Images (completely replaced)

Request example:

{
type: RIGID,
brand: Volvo,
model: FH16,
year: 2022
}

Request

Responses

Vehicle successfully updated