Skip to main content
Skip to Content
Dispatch API

Retrieve a plan

GET
/plans/{planId}

The playground uses your live account

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

Retrieve a plan

Authorization

BasicAuth
headerAuthorizationBasic <token>

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

Path Parameters

planId*string

The plan id

Match^[a-zA-Z0-9---_]{1,50}$

Response Body

The requested plan

application/json
  1. response

The requested plan

id*string

The unique identifier of the plan.

Match^plans\/[a-zA-Z0-9---_]{1,50}$
title*string

The title of the plan.

starts*

A date.

depot*|

The depot ID of the plan, in the format depots/<id>

distributed*boolean

Whether the plan has been distributed.

writable*boolean

Whether the plan is writable using the normal Plan APIs. If this is false, you will need to use the Live Plan APIs to edit the plan. Any plan created before 2023-04-01 is not writable.

optimization*|

The optimization state of the plan.

drivers*array<>

The driver IDs of the plan, in the format drivers/<id>.

routes*array<>

The route IDs of the plan, in the format routes/<id>.

routeOverrides*|

Settings for this plan to override default route configurations.

Example Request
curl -X GET 'https://api.spoke.com/public/v1/plans/string'
Example Response
{  "id": "string",  "title": "string",  "starts": {    "day": 1,    "month": 1,    "year": 2000  },  "depot": "string",  "distributed": true,  "writable": true,  "optimization": "creating",  "drivers": [    "string"  ],  "routes": [    "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",    "optimizationSettings": {      "objective": "minimize_drivers",      "subObjective": "equalize_workload"    }  }}