Change driver equipment

POST/app/v1/drivers/change-equipment/

Set the vehicle or trailer one or more drivers are assigned to, by username and unit number. If a driver has a co-driver, the change is synced to the co-driver too.

Each update is checked on its own. The response is 200 when all of them succeed, 207 when only some do (successes in results, failures in errors), and 400 when none do. The unit must be active.

Authorization

X-API-KEYstring · headerrequired

Your company's API key.

Request body

application/json · required

updatesarray of objectrequired

One entry per change. At least one.

Show fields
usernamestringrequired

The driver's username in DPB.

unit_nostringrequired

Unit number of an active vehicle or trailer.

typeenumrequired

Whether the unit is the driver's vehicle or trailer.

One of: Vehicle Trailer

Response

200The record
resultsarray of object

Updates that succeeded.

Show fields
usernamestring
unit_nostring
typeenum

One of: Vehicle Trailer

statusenum

One of: success error

messagestring

What happened for this update.

errorsarray of object

Updates that failed, with the reason. Only when some or all failed.

Show fields
usernamestring
unit_nostring
typeenum

One of: Vehicle Trailer

statusenum

One of: success error

messagestring

What happened for this update.

Other responses

207Some updates succeeded and some failed.
{
  "results": [
    {
      "username": "driver1",
      "unit_no": "1001",
      "type": "Vehicle",
      "status": "success",
      "message": "Successfully updated default vehicle for driver1 to 1001"
    }
  ],
  "errors": [
    {
      "username": "driver2",
      "unit_no": "9999",
      "type": "Vehicle",
      "status": "error",
      "message": "Active equipment with unit_no '9999' and type 'Vehicle' not found."
    }
  ]
}
400None of the updates succeeded. Usual causes: the username doesn't exist in your company, or the unit number isn't an active vehicle or trailer of that type.
{
  "results": [],
  "errors": [
    {
      "username": "nonexistent_driver",
      "unit_no": "1001",
      "type": "Vehicle",
      "status": "error",
      "message": "Driver with username 'nonexistent_driver' not found."
    }
  ]
}