Skip to main content
Skip to Content
Dispatch API

Batch import depots

POST
/depots:import

The playground uses your live account

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

Batch import depots. The request body must contain an array of depots to import.

Authorization

BasicAuth
headerAuthorizationBasic <token>

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

Request Body

An array of depots to import in batch. Supports a maximum of 100 depots per request.

application/json
  1. body

An array of depots to import in batch. Supports a maximum of 100 depots per request.

Items1 <= items <= 100
[index: integer]?

Response Body

Success

application/json
  1. response

Success

success*array<>

The ids of the successfully imported depots

failed*array<>

The failed depots

Example Request
curl -X POST 'https://api.spoke.com/public/v1/depots:import' \  -H 'Content-Type: application/json' \  -d '[  {    "name": "string",    "routeOverrides": {      "startAddress": {},      "startTime": {        "hour": 0,        "minute": 0      }    }  }]'
Example Response
{  "success": [    "string"  ],  "failed": [    {      "error": {        "message": "string"      },      "depot": {        "name": "string",        "routeOverrides": {          "startAddress": {            "addressName": "string",            "addressLineOne": "string",            "addressLineTwo": "string",            "city": "string",            "state": "string",            "zip": "string",            "country": "string",            "latitude": -90,            "longitude": -180          },          "startTime": {            "hour": 0,            "minute": 0          },          "endAddress": {            "addressName": "string",            "addressLineOne": "string",            "addressLineTwo": "string",            "city": "string",            "state": "string",            "zip": "string",            "country": "string",            "latitude": -90,            "longitude": -180          },          "endTime": {            "hour": 0,            "minute": 0          },          "defaultTimeAtStop": 0,          "maxStops": 0,          "vehicleType": "bike",          "roadSide": "any",          "roundTrip": true        }      }    }  ]}