Skip to main content
Skip to Content
Dispatch API
This is the documentation for Dispatch API v0.2b, which is no longer actively maintained. For up-to-date documentation, see the latest version (v1.0).

Create a new driver

POST
/drivers

The playground uses your live account

Requests are sent with your real API key, so creating, updating or deleting here changes your production data.

Create a driver with the given data in your team. Prefer using the batch import endpoint for creating multiple drivers at once as it is more efficient, faster.

Authorization

BasicAuth
headerAuthorizationBasic <token>

Use the API key as the username and leave the password empty.

Request Body

The request body for creating a driver. Even though email and phone are optional, you must provide exactly one of them

application/json
  1. body

The request body for creating a driver. Even though email and phone are optional, you must provide exactly one of them

name?|

The driver's full name

displayName?|

The name displayed for the driver in the UI

email?|

Driver's email

phone?|

Driver's phone number

depots?array<>|

The depot IDs associated with the driver in the format depots/<id>, duplicates will be ignored. If set to null or not provided, the team's Main depot will be set as driver depot.

routeOverrides?|

Overrides for the driver route behavior.

Response Body

The created driver

application/json
  1. response

The created driver

id*string

The driver id, in the format drivers/<id>

Match^drivers\/[a-zA-Z0-9---_]{1,50}$
name*|

The name of the driver.

email*|

The email of the driver.

phone*|

The phone number of the driver.

displayName*|

The display name of the driver.

active*boolean

Whether the driver membership is active or paused. Paused drivers will not be assigned to any routes.

depots*array<>

Depots associated with the driver.

routeOverrides*

Settings to override default route settings.

Example Request
curl -X POST 'https://api.spoke.com/public/v0.2b/drivers' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "name": null,  "email": null,  "phone": null,  "displayName": null,  "active": true,  "depots": [    "string"  ],  "routeOverrides": {    "startTime": {      "hour": 0,      "minute": 0    },    "endTime": {      "hour": 0,      "minute": 0    },    "startAddress": {      "address": "string",      "addressLineOne": "string",      "addressLineTwo": "string",      "latitude": -90,      "longitude": -180,      "placeId": "string",      "placeTypes": [        "string"      ]    },    "endAddress": {      "address": "string",      "addressLineOne": "string",      "addressLineTwo": "string",      "latitude": -90,      "longitude": -180,      "placeId": "string",      "placeTypes": [        "string"      ]    },    "maxStops": -9007199254740991,    "drivingSpeed": "slower",    "deliverySpeed": "slower",    "vehicleType": "bike"  }}