Update a Carpool Vehicle
PATCH/carpool/vehicles/:vehicle_id
Updates the Carpool attributes of an enrolled vehicle. Send at least one
field. A field left out keeps its stored value, and null clears the
fields that accept it.
Requests that affect bookings. The request is guarded when the vehicle
has affected bookings and it changes location_id, sets common_pool from
true to false, or sets is_maintenance to true. An affected booking
is a requested or approved booking over the next two years. Without
force: true the answer is 409 and nothing is written.
With force: true the change is saved and each affected booking is
handled in the same request:
- For a location or common pool change, the booking moves to another assignable vehicle, or is cancelled when none exists.
- For
is_maintenance, the bookings are cancelled and not moved, as FleetWeb does for a vehicle sent to maintenance.
A driver whose booking is cancelled is notified, under the account's
notification rules. A booking that moves to another vehicle sends no
notification, as in FleetWeb. force only accepts true and false.
special_license_ids replaces the list of special licenses the vehicle
requires. The list is shown by GET /carpool/vehicles, but it is not yet
enforced when a booking is created, because that check reads a different
stored value. This is how FleetWeb behaves today.
Maintenance. is_maintenance: true also switches Carpool enrolment
off, cancels the vehicle's open maintenance records (pending, in
maintenance and under inspection) and opens an immediate one with no end
date. Completed records are kept as they are. The vehicle then no longer
appears in GET /carpool/vehicles and is returned with setup_status
NON_CARPOOL. is_maintenance: false cancels the open maintenance
records and does not enrol the vehicle again, enrol it with
POST /carpool/vehicles. It is the only change accepted for a vehicle
that is not enrolled.
This operation is available to the main account only.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 500
The updated vehicle and what happened to each affected booking.
Unauthorized access. Authentication is required.
The operation requires main account credentials. Valid subusers receive this response.
The requested resource was not found.
The request affects bookings and force=true was not sent. Nothing was written. Review the bookings, then repeat the request with force=true.
Request field validation or Carpool business validation failed.
Internal server error.