# setVehicleStatus

Command (Messages and statuses).

Forces the current vehicle status by id

Sets the driver's current status from the client application, rather than waiting for the driver to
tap it. The status must be one of those pushed by [`updateVehicleStatuses`](https://docs.benomad.com/benav-rnc/commands/update-vehicle-statuses.md).

It behaves exactly as if the driver had chosen it (the button updates and
[`onVehicleStatusChanged`](https://docs.benomad.com/benav-rnc/notifications/on-vehicle-status-changed.md) fires) so both routes to a status change look the same to
everyone watching.

**Worth knowing**

- An id outside the current set returns `34 vehicle.status.id.not.found`.

**Example: keeping the device honest**

A courier marks a parcel delivered in the client application on their phone. Rather than leave the
vehicle showing *Delivering* on the in-cab screen, the application sends
`setVehicleStatus` to move it to *Available*, so what the driver sees matches what
dispatch sees.

## Command

```json
{
  "jsonrpc": "2.0",
  "method": "setVehicleStatus",
  "params": {
    "id": 2
  },
  "id": "1"
}
```

## Response

### Success

```json
{
  "jsonrpc": "2.0",
  "result": {},
  "id": "1"
}
```

### Error

Generic errors, plus `34 vehicle.status.id.not.found` when the id is not part of the current set (or no set has been pushed).
