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, EXPIRING_APPROVAL 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
- 400
- 401
- 403
- 404
- 409
- 422
- 429
- 500
- 503
The updated vehicle and what happened to each affected booking.
The request body is declared as JSON but cannot be parsed, or is not a JSON object or array. Nothing was processed.
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.
Too Many Requests - the endpoint's rate limit has been exceeded. Retry after the number of seconds in the Retry-After header.
Response Headers
Seconds to wait before retrying. The same value as X-RateLimit-Retry-After-Seconds when that wait is non-negative. If the computed wait is negative, Retry-After is floored at 0.
Unix timestamp of the next earliest successful request.
Seconds until the next earliest successful request.
Internal server error.
Service temporarily unavailable. The request did not complete and can be retried after the number of seconds in the Retry-After header, when one is sent.
Response Headers
Seconds to wait before retrying. Sent with db_busy and db_pool_timeout.