Skip to main content
Version: v1.0

Driver Schema

Model​

Driver​

Driver = object

The driver data. All drivers in the API will have this format.

Example​

{
"id": "drivers/w8ZaNn3e5ZA8EQSABtca",
"name": "John Doe",
"email": "john.doe@spoke.com",
"phone": "+15555555555",
"displayName": "John D.",
"active": true,
"depots": [
"depots/zeOCJaJCzZhpKVCVAC9o"
],
"routeOverrides": {
"startTime": {
"hour": 8,
"minute": 0
},
"endTime": {
"hour": 8,
"minute": 0
},
"startAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"endAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"maxStops": 30,
"drivingSpeed": "average",
"deliverySpeed": "faster"
}
}

Properties​

PropertyTypeDescription

id

DriverId

‐

name

string | null

Full user name

Default

null

email

string | null

User email

Default

null

phone

string | null

Phone number in E.164 format

Default

null

displayName

string | null

User name for display purposes

active

boolean

If true, the driver membership is active and the driver can be assigned to plans/routes.
If false, the driver membership is paused and the driver will not be assignable to any plans/routes.

depots

DepotId[]

Depots associated with the Driver.

Default

[]

See

Depot

routeOverrides

DriverRouteOverrides

A set of settings per driver to override default route configurations.

Identifier​

DepotId​

DepotId = `depots/${string}`

A depot id is a string that is unique for a depot. It is used to identify the depot in the API.

Example​

"depot/0xBYy4MYt4piMCSQEsts"

DriverId​

DriverId = `drivers/${string}`

A driver id is a string that is unique for a driver. It is used to identify the driver in the API.

Example​

"drivers/0xBYy4MYt4piMCSQEsts"

Fields​

RelativeSpeed​

RelativeSpeed = "slower" | "average" | "faster"

An indication of relative speed compared to the average speed for some activity. Such activities can be, for example, driving and delivering.


DriverRouteOverrides​

DriverRouteOverrides = object

Settings per driver to override default route configurations. Editing this object achieve the same functionalities of the tab "Route overrides" when editing a driver in Spoke Dispatch. All settings are optional and default to route settings, for example start and end locations from Depot, but can be overriden on each driver via this object.

Example​

{
"startTime": {
"hour": 8,
"minute": 0
},
"endTime": {
"hour": 8,
"minute": 0
},
"startAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"endAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"maxStops": 30,
"drivingSpeed": "average",
"deliverySpeed": "faster"
"vehicleType": "truck"
}

Properties​

PropertyTypeDescription

startTime

TimeOfDay | null

The time of day that the Driver starts working. When null, the start time configured for the Depot will be taken into consideration when optmizing plans and distributing routes to drivers.

Default

null

endTime

TimeOfDay | null

The time of day that the Driver finishes working. When null, the end time configured for the Depot will be taken into consideration when optimizing plans and distributing routes to drivers.

Default

null

startAddress

DriverAddress | null

A complete address to the location where the driver must always begin at. Optional. If null the start location of routes will be the Depot associated with the route assigned to the driver.

Default

null

endAddress

DriverAddress | null

A complete address to the location where the driver must always end at. Optional. If null the end location of routes will be the end location of the Depot associated with the route assigned to the driver or the driver's start location if "return to start location" is set.

Default

null

maxStops

number | null

The maximum number of stops the driver must have per route. Optional. If null, the Depot's maximum number of stops per driver will be used instead.

Default

null

drivingSpeed

RelativeSpeed

How fast the driver drives from stop to stop, compared to the average speed all drivers usually drive. This value defaults to "average" and if specified as "slower" or "faster", it will be taken into considerattion when optimizing routes.

Default

"average"

deliverySpeed

RelativeSpeed

How fast the driver completes deliveries, compared to the average of all drivers. This value defaults to "average" and if specified as "slower" or "faster", it will be taken into considerattion when optimizing routes.

Default

"average"

vehicleType

VehicleType | null

The vehicle type the driver uses. It may affect optimization, as some paths are available to certain vehicles but not to others.

Default

null

DriverAddress​

DriverAddress = object

Data used to identify the stop location.

Example​

{
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},

Properties​

PropertyTypeDescription

address

string

Combined address string.

Default

''

Description

It will always be an empty string '' if imported from a spreadsheet using latitude and longitude.

addressLineOne

string

First line of the address.

Default

''

addressLineTwo

string

Second line of the address.

Default

''

latitude

number | null

Latitude coordinate of the stop location in decimal degrees.

Default

null

longitude

number | null

Longitude coordinate of the stop location in decimal degrees.

Default

null

placeId

string | null

The identifier of the Place corresponding to this stop on Google Places.

Default

null

placeTypes

string[]

Array of strings that is provided by the Google AutoCompleteAPI.

Default

[]

TimeOfDay​

TimeOfDay = object

The time of day in hours and minutes.

Description​

The time of day in hours and minutes.

Example​

{
"hour": 8,
"minute": 0
}

Properties​

PropertyTypeDescription

hour

number

The hour of the day in 24-hour format.

minute

number

The minute of the hour.