Spoke Dispatch

App · 28 actions

Plan delivery routes, add stops and drivers, and follow deliveries in Spoke Dispatch (formerly Circuit for Teams).

Actions

ActionWhat it does
Add a driverAdd a driver to the team.
Add a stop to a planAdd a stop to a plan that hasn't been optimized yet.
Add a team memberInvite a dispatcher, admin, depot manager or read-only member to the team.
Create a planCreate a plan for a day, with the drivers who will run it.
Create an unassigned stopCreate a stop that waits to be added to a plan.
Delete a planDelete a plan and its routes.
Delete a stopDelete a stop from a plan that hasn't been optimized yet.
Delete an unassigned stopDelete a stop waiting to be added to a plan.
Distribute a planSend an optimized plan's routes to its drivers.
Get a planGet a plan, with its drivers, routes and optimization state.
Get a routeGet a route, with its driver and whether it has been sent, started or completed.
Get a stopGet a stop on a plan, with its route, ETA and delivery details.
Get an optimizationGet a plan optimization: whether it is done, and its result.
List a plan's stopsList the stops on a plan.
List a route's stopsList the stops on a route in order, with their delivery details.
List custom stop propertiesList the custom properties the team has defined for stops.
List depotsList the team's depots.
List driversList the team's drivers.
List optimizationsList plan optimizations, finished or still running.
List plansList the team's plans, optionally only those starting between two dates.
List routesList routes, optionally only those starting between two dates.
List unassigned stopsList stops waiting to be added to a plan.
Optimize a planStart optimizing a plan's routes.
Remove a driverRemove a driver from the team.
Search stopsSearch all stops, planned and unassigned, by keywords and an optional filter.
Update a driverChange a driver's name or depots.
Update a planChange a plan's title, day, drivers or depot.
Update a stopChange a stop's recipient, notes, timing or packages.

Add a driver

Add a driver to the team. Spoke invites them by email or text.

Inputs

Namenametext
The driver's full name.
Emailemailtext
The driver's email address. Give an email, a phone number or both.
Phonephonetext
The driver's phone number.
Display namedisplay_nametext
The name shown for the driver in Spoke.
Depotsdepot_idslist
The depots the driver works from.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "active": true,
    "depots": [
      "example"
    ],
    "displayName": "example",
    "email": "example",
    "id": "example",
    "name": "example",
    "phone": "example"
  }
}

Add a stop to a plan

Add a stop to a plan that hasn't been optimized yet.

Inputs

Planplan_idtextRequired
The plan.
Addressaddress_line_onetext
The street address, such as 350 5th Ave. Spoke finds it on the map.
Address line 2address_line_twotext
The apartment, suite or unit.
Citycitytext
The city.
Statestatetext
The state or region.
Zipziptext
The ZIP or postal code.
Countrycountrytext
The country.
Place nameaddress_nametext
A name shown for the place, such as a business name. Spoke doesn't use it to find the address.
Latitudelatitudenumber
The latitude in decimal degrees. With a longitude, it places the stop exactly.From -90 to 90.
Longitudelongitudenumber
The longitude in decimal degrees.From -180 to 180.
Recipient namerecipient_nametext
The recipient's name.
Recipient emailrecipient_emailtext
The recipient's email address, for delivery updates.
Recipient phonerecipient_phonetext
The recipient's phone number, for delivery updates.
External IDexternal_idtext
Your own ID for the recipient or order, which list steps can filter by.
Notesnotestext
Notes for the driver.
Activityactivitytext
Whether the driver delivers or picks up here.One of: delivery, pickup.
Package countpackage_countnumber
How many packages.At least 0.
Position in routeoptimization_ordertext
Where the stop goes in the optimized route.One of: default, first, last.
Arrive afterearliest_timetime
The earliest time of day the driver should arrive.
Arrive beforelatest_timetime
The latest time of day the driver should arrive.
Minutes at stoptime_at_stop_minutesnumber
How many minutes the driver spends here, when not the team's usual.From 0 to 1440.
Productsproductslist
The products in this stop.
Seller order IDseller_order_idtext
The seller's order ID.
Barcodesbarcodeslist
Barcodes on the packages.
Custom propertiescustom_propertiesobject
Custom stop properties, by their IDs from List custom stop properties.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "activity": "delivery",
    "address": {
      "address": "example",
      "addressLineOne": "example",
      "addressLineTwo": "example",
      "latitude": 1,
      "longitude": 1,
      "placeId": "example"
    },
    "allowedDrivers": [
      "example"
    ],
    "barcodes": [
      "example"
    ],
    "clientId": "example",
    "customProperties": {},
    "deliveryInfo": {
      "attempted": true,
      "attemptedAt": 1,
      "driverProvidedRecipientNotes": "example",
      "photoUrls": [
        "example"
      ],
      "recipientProvidedNotes": "example",
      "signatureUrl": "example",
      "signeeName": "example",
      "state": "example",
      "succeeded": true
    },
    "id": "example",
    "notes": "example",
    "orderInfo": {
      "invoiceNumber": "example",
      "products": [
        "example"
      ],
      "sellerName": "example",
      "sellerOrderId": "example",
      "sellerWebsite": "example"
    },
    "packageCount": 1,
    "plan": "example",
    "recipient": {
      "email": "example",
      "externalId": "example",
      "name": "example",
      "phone": "example"
    },
    "route": {
      "driver": "example",
      "id": "example",
      "plan": "example",
      "state": {
        "completed": true,
        "completedAt": 1,
        "distributed": true,
        "distributedAt": 1,
        "notifiedRecipients": true,
        "started": true,
        "startedAt": 1
      },
      "stopCount": 1,
      "title": "example"
    },
    "stopPosition": 1,
    "timing": {
      "earliestAttemptTime": {
        "hour": 1,
        "minute": 1
      },
      "estimatedAttemptDuration": 1,
      "latestAttemptTime": {
        "hour": 1,
        "minute": 1
      }
    },
    "trackingLink": "example",
    "type": "stop",
    "webAppLink": "example"
  }
}

Add a team member

Invite a dispatcher, admin, depot manager or read-only member to the team.

Inputs

EmailemailtextRequired
The member's email address.
RoleroletextRequired
What the member can do in Spoke.One of: dispatcher, admin, depot-manager, read-only.
Namenametext
The member's full name.
Depotsdepot_idslist
The depots the member works with.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "active": true,
    "depots": [
      "example"
    ],
    "displayName": "example",
    "email": "example",
    "id": "example",
    "name": "example",
    "roles": [
      "example"
    ]
  }
}

Create a plan

Create a plan for a day, with the drivers who will run it.

Inputs

TitletitletextRequired
The plan's title.
DatestartsdateRequired
The day the plan runs.
Driversdriver_idslist
The drivers on the plan.
Depotdepot_idtext
The depot the routes start from. Left empty, the team's main depot.
Start timestart_timetime
When the drivers' day starts, for every route in the plan.
End timeend_timetime
When the drivers' day ends, for every route in the plan.
Vehicle typevehicle_typetext
The vehicle used on the plan's routes.One of: car, bike, scooter, small_truck (Small truck), truck, electric_cargo_bike (Electric cargo bike).

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "depot": "example",
    "distributed": true,
    "drivers": [
      "example"
    ],
    "id": "example",
    "optimization": "creating",
    "routes": [
      "example"
    ],
    "starts": {
      "day": 1,
      "month": 1,
      "year": 1
    },
    "title": "example",
    "writable": true
  }
}

Create an unassigned stop

Create a stop that waits to be added to a plan.

Inputs

Addressaddress_line_onetext
The street address, such as 350 5th Ave. Spoke finds it on the map.
Address line 2address_line_twotext
The apartment, suite or unit.
Citycitytext
The city.
Statestatetext
The state or region.
Zipziptext
The ZIP or postal code.
Countrycountrytext
The country.
Place nameaddress_nametext
A name shown for the place, such as a business name. Spoke doesn't use it to find the address.
Latitudelatitudenumber
The latitude in decimal degrees. With a longitude, it places the stop exactly.From -90 to 90.
Longitudelongitudenumber
The longitude in decimal degrees.From -180 to 180.
Depotdepot_idtext
The depot the stop leaves from. Left empty, the team's main depot.
Recipient namerecipient_nametext
The recipient's name.
Recipient emailrecipient_emailtext
The recipient's email address, for delivery updates.
Recipient phonerecipient_phonetext
The recipient's phone number, for delivery updates.
External IDexternal_idtext
Your own ID for the recipient or order, which list steps can filter by.
Notesnotestext
Notes for the driver.
Activityactivitytext
Whether the driver delivers or picks up here.One of: delivery, pickup.
Package countpackage_countnumber
How many packages.At least 0.
Position in routeoptimization_ordertext
Where the stop goes in the optimized route.One of: default, first, last.
Arrive afterearliest_timetime
The earliest time of day the driver should arrive.
Arrive beforelatest_timetime
The latest time of day the driver should arrive.
Minutes at stoptime_at_stop_minutesnumber
How many minutes the driver spends here, when not the team's usual.From 0 to 1440.
Productsproductslist
The products in this stop.
Seller order IDseller_order_idtext
The seller's order ID.
Barcodesbarcodeslist
Barcodes on the packages.
Custom propertiescustom_propertiesobject
Custom stop properties, by their IDs from List custom stop properties.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "activity": "delivery",
    "address": {
      "address": "example",
      "addressLineOne": "example",
      "addressLineTwo": "example",
      "latitude": 1,
      "longitude": 1,
      "placeId": "example"
    },
    "barcodes": [
      "example"
    ],
    "clientId": "example",
    "customProperties": {},
    "depot": "example",
    "id": "example",
    "notes": "example",
    "orderInfo": {
      "invoiceNumber": "example",
      "products": [
        "example"
      ],
      "sellerName": "example",
      "sellerOrderId": "example",
      "sellerWebsite": "example"
    },
    "packageCount": 1,
    "recipient": {
      "email": "example",
      "externalId": "example",
      "name": "example",
      "phone": "example"
    },
    "trackingLink": "example"
  }
}

Delete a plan

Delete a plan and its routes.

Inputs

Planplan_idtextRequired
The plan to delete.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {}
}

Delete a stop

Delete a stop from a plan that hasn't been optimized yet.

Inputs

Planplan_idtextRequired
The plan.
Stopstop_idtextRequired
The stop's ID, as Spoke gives it (plans/.../stops/...) or its last part.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {}
}

Delete an unassigned stop

Delete a stop waiting to be added to a plan.

Inputs

Unassigned stopunassigned_stop_idtextRequired
The unassigned stop's ID, as Spoke gives it (unassignedStops/...) or its last part.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {}
}

Distribute a plan

Send an optimized plan's routes to its drivers.

Inputs

Planplan_idtextRequired
The optimized plan to send to its drivers.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "depot": "example",
    "distributed": true,
    "drivers": [
      "example"
    ],
    "id": "example",
    "optimization": "creating",
    "routes": [
      "example"
    ],
    "starts": {
      "day": 1,
      "month": 1,
      "year": 1
    },
    "title": "example",
    "writable": true
  }
}

Get a plan

Get a plan, with its drivers, routes and optimization state.

Inputs

Planplan_idtextRequired
The plan.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "depot": "example",
    "distributed": true,
    "drivers": [
      "example"
    ],
    "id": "example",
    "optimization": "creating",
    "routes": [
      "example"
    ],
    "starts": {
      "day": 1,
      "month": 1,
      "year": 1
    },
    "title": "example",
    "writable": true
  }
}

Get a route

Get a route, with its driver and whether it has been sent, started or completed.

Inputs

Routeroute_idtextRequired
The route's ID, as Spoke gives it (routes/...) or its last part.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "driver": "example",
    "id": "example",
    "plan": "example",
    "state": {
      "completed": true,
      "completedAt": 1,
      "distributed": true,
      "distributedAt": 1,
      "notifiedRecipients": true,
      "started": true,
      "startedAt": 1
    },
    "stopCount": 1,
    "title": "example"
  }
}

Get a stop

Get a stop on a plan, with its route, ETA and delivery details.

Inputs

Planplan_idtextRequired
The plan.
Stopstop_idtextRequired
The stop's ID, as Spoke gives it (plans/.../stops/...) or its last part.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "activity": "delivery",
    "address": {
      "address": "example",
      "addressLineOne": "example",
      "addressLineTwo": "example",
      "latitude": 1,
      "longitude": 1,
      "placeId": "example"
    },
    "allowedDrivers": [
      "example"
    ],
    "barcodes": [
      "example"
    ],
    "clientId": "example",
    "customProperties": {},
    "deliveryInfo": {
      "attempted": true,
      "attemptedAt": 1,
      "driverProvidedRecipientNotes": "example",
      "photoUrls": [
        "example"
      ],
      "recipientProvidedNotes": "example",
      "signatureUrl": "example",
      "signeeName": "example",
      "state": "example",
      "succeeded": true
    },
    "id": "example",
    "notes": "example",
    "orderInfo": {
      "invoiceNumber": "example",
      "products": [
        "example"
      ],
      "sellerName": "example",
      "sellerOrderId": "example",
      "sellerWebsite": "example"
    },
    "packageCount": 1,
    "plan": "example",
    "recipient": {
      "email": "example",
      "externalId": "example",
      "name": "example",
      "phone": "example"
    },
    "route": {
      "driver": "example",
      "id": "example",
      "plan": "example",
      "state": {
        "completed": true,
        "completedAt": 1,
        "distributed": true,
        "distributedAt": 1,
        "notifiedRecipients": true,
        "started": true,
        "startedAt": 1
      },
      "stopCount": 1,
      "title": "example"
    },
    "stopPosition": 1,
    "timing": {
      "earliestAttemptTime": {
        "hour": 1,
        "minute": 1
      },
      "estimatedAttemptDuration": 1,
      "latestAttemptTime": {
        "hour": 1,
        "minute": 1
      }
    },
    "trackingLink": "example",
    "type": "stop",
    "webAppLink": "example"
  }
}

Get an optimization

Get a plan optimization: whether it is done, and its result.

Inputs

Operationoperation_idtextRequired
The operation's ID, as Optimize a plan returns it (operations/...) or its last part.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "done": true,
    "id": "example",
    "metadata": {
      "canceled": true,
      "finishedAt": 1,
      "startedAt": 1,
      "startedBy": "example",
      "targetPlanId": "example"
    },
    "result": {
      "code": "example",
      "message": "example",
      "numOptimizedStops": 1
    },
    "type": "plan_optimization"
  }
}

List a plan's stops

List the stops on a plan.

Inputs

Planplan_idtextRequired
The plan.
External IDexternal_idtext
Only stops with this external ID.
Page sizemax_page_sizenumber
How many to return, at most 10. Spoke returns 10 when left empty.From 1 to 10.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "stops": [
      {
        "activity": "delivery",
        "address": {
          "address": "example",
          "addressLineOne": "example",
          "addressLineTwo": "example",
          "latitude": 1,
          "longitude": 1,
          "placeId": "example"
        },
        "allowedDrivers": [
          "example"
        ],
        "barcodes": [
          "example"
        ],
        "clientId": "example",
        "customProperties": {},
        "deliveryInfo": {
          "attempted": true,
          "attemptedAt": 1,
          "driverProvidedRecipientNotes": "example",
          "photoUrls": [
            "example"
          ],
          "recipientProvidedNotes": "example",
          "signatureUrl": "example",
          "signeeName": "example",
          "state": "example",
          "succeeded": true
        },
        "id": "example",
        "notes": "example",
        "orderInfo": {
          "invoiceNumber": "example",
          "products": [
            "example"
          ],
          "sellerName": "example",
          "sellerOrderId": "example",
          "sellerWebsite": "example"
        },
        "packageCount": 1,
        "plan": "example",
        "recipient": {
          "email": "example",
          "externalId": "example",
          "name": "example",
          "phone": "example"
        },
        "route": {
          "driver": "example",
          "id": "example",
          "plan": "example",
          "state": {
            "completed": true,
            "completedAt": 1,
            "distributed": true,
            "distributedAt": 1,
            "notifiedRecipients": true,
            "started": true,
            "startedAt": 1
          },
          "stopCount": 1,
          "title": "example"
        },
        "stopPosition": 1,
        "timing": {
          "earliestAttemptTime": {
            "hour": 1,
            "minute": 1
          },
          "estimatedAttemptDuration": 1,
          "latestAttemptTime": {
            "hour": 1,
            "minute": 1
          }
        },
        "trackingLink": "example",
        "type": "stop",
        "webAppLink": "example"
      }
    ]
  }
}

List a route's stops

List the stops on a route in order, with their delivery details.

Inputs

Routeroute_idtextRequired
The route's ID, as Spoke gives it (routes/...) or its last part.
Page sizemax_page_sizenumber
How many to return, at most 10. Spoke returns 10 when left empty.From 1 to 10.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "stops": [
      {
        "activity": "delivery",
        "address": {
          "address": "example",
          "addressLineOne": "example",
          "addressLineTwo": "example",
          "latitude": 1,
          "longitude": 1,
          "placeId": "example"
        },
        "allowedDrivers": [
          "example"
        ],
        "barcodes": [
          "example"
        ],
        "clientId": "example",
        "customProperties": {},
        "deliveryInfo": {
          "attempted": true,
          "attemptedAt": 1,
          "driverProvidedRecipientNotes": "example",
          "photoUrls": [
            "example"
          ],
          "recipientProvidedNotes": "example",
          "signatureUrl": "example",
          "signeeName": "example",
          "state": "example",
          "succeeded": true
        },
        "id": "example",
        "notes": "example",
        "orderInfo": {
          "invoiceNumber": "example",
          "products": [
            "example"
          ],
          "sellerName": "example",
          "sellerOrderId": "example",
          "sellerWebsite": "example"
        },
        "packageCount": 1,
        "plan": "example",
        "recipient": {
          "email": "example",
          "externalId": "example",
          "name": "example",
          "phone": "example"
        },
        "route": {
          "driver": "example",
          "id": "example",
          "plan": "example",
          "state": {
            "completed": true,
            "completedAt": 1,
            "distributed": true,
            "distributedAt": 1,
            "notifiedRecipients": true,
            "started": true,
            "startedAt": 1
          },
          "stopCount": 1,
          "title": "example"
        },
        "stopPosition": 1,
        "timing": {
          "earliestAttemptTime": {
            "hour": 1,
            "minute": 1
          },
          "estimatedAttemptDuration": 1,
          "latestAttemptTime": {
            "hour": 1,
            "minute": 1
          }
        },
        "trackingLink": "example",
        "type": "stop",
        "webAppLink": "example"
      }
    ]
  }
}

List custom stop properties

List the custom properties the team has defined for stops.

Inputs

None.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "customStopProperties": [
      {
        "id": "example",
        "name": "example",
        "visibleToDrivers": true,
        "visibleToRecipients": true
      }
    ]
  }
}

List depots

List the team's depots.

Inputs

Page sizemax_page_sizenumber
How many to return, at most 50. Spoke returns 10 when left empty.From 1 to 50.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "depots": [
      {
        "id": "example",
        "name": "example"
      }
    ],
    "nextPageToken": "example"
  }
}

List drivers

List the team's drivers.

Inputs

Activeactivetrue/false
On for only active drivers, off for only paused ones. Left empty, all drivers.
Page sizemax_page_sizenumber
How many to return, at most 50. Spoke returns 10 when left empty.From 1 to 50.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "drivers": [
      {
        "active": true,
        "depots": [
          "example"
        ],
        "displayName": "example",
        "email": "example",
        "id": "example",
        "name": "example",
        "phone": "example"
      }
    ],
    "nextPageToken": "example"
  }
}

List optimizations

List plan optimizations, finished or still running.

Inputs

Finisheddonetrue/false
On for only finished optimizations, off for only running ones. Left empty, all.
Page sizemax_page_sizenumber
How many to return, at most 10. Spoke returns 10 when left empty.From 1 to 10.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "operations": [
      {
        "done": true,
        "id": "example",
        "metadata": {
          "canceled": true,
          "finishedAt": 1,
          "startedAt": 1,
          "startedBy": "example",
          "targetPlanId": "example"
        },
        "result": {
          "code": "example",
          "message": "example",
          "numOptimizedStops": 1
        },
        "type": "plan_optimization"
      }
    ]
  }
}

List plans

List the team's plans, optionally only those starting between two dates.

Inputs

Titletitletext
Only the plan with exactly this title.
Starting fromstarts_fromdate
Only plans starting on or after this date.
Starting untilstarts_todate
Only plans starting on or before this date.
Page sizemax_page_sizenumber
How many to return, at most 20. Spoke returns 10 when left empty.From 1 to 20.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "plans": [
      {
        "depot": "example",
        "distributed": true,
        "drivers": [
          "example"
        ],
        "id": "example",
        "optimization": "creating",
        "routes": [
          "example"
        ],
        "starts": {
          "day": 1,
          "month": 1,
          "year": 1
        },
        "title": "example",
        "writable": true
      }
    ]
  }
}

List routes

List routes, optionally only those starting between two dates.

Inputs

Starting fromstarts_fromdate
Only routes starting on or after this date.
Starting untilstarts_todate
Only routes starting on or before this date.
Page sizemax_page_sizenumber
How many to return, at most 10. Spoke returns 10 when left empty.From 1 to 10.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "routes": [
      {
        "driver": "example",
        "id": "example",
        "plan": "example",
        "state": {
          "completed": true,
          "completedAt": 1,
          "distributed": true,
          "distributedAt": 1,
          "notifiedRecipients": true,
          "started": true,
          "startedAt": 1
        },
        "stopCount": 1,
        "title": "example"
      }
    ]
  }
}

List unassigned stops

List stops waiting to be added to a plan.

Inputs

External IDexternal_idtext
Only stops with this external ID.
Page sizemax_page_sizenumber
How many to return, at most 100. Spoke returns 10 when left empty.From 1 to 100.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "unassignedStops": [
      {
        "activity": "delivery",
        "address": {
          "address": "example",
          "addressLineOne": "example",
          "addressLineTwo": "example",
          "latitude": 1,
          "longitude": 1,
          "placeId": "example"
        },
        "barcodes": [
          "example"
        ],
        "clientId": "example",
        "customProperties": {},
        "depot": "example",
        "id": "example",
        "notes": "example",
        "orderInfo": {
          "invoiceNumber": "example",
          "products": [
            "example"
          ],
          "sellerName": "example",
          "sellerOrderId": "example",
          "sellerWebsite": "example"
        },
        "packageCount": 1,
        "recipient": {
          "email": "example",
          "externalId": "example",
          "name": "example",
          "phone": "example"
        },
        "trackingLink": "example"
      }
    ]
  }
}

Optimize a plan

Start optimizing a plan's routes. It returns an operation to follow with Get an optimization.

Inputs

Planplan_idtextRequired
The plan to optimize.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "done": true,
    "id": "example",
    "metadata": {
      "canceled": true,
      "finishedAt": 1,
      "startedAt": 1,
      "startedBy": "example",
      "targetPlanId": "example"
    },
    "result": {
      "code": "example",
      "message": "example",
      "numOptimizedStops": 1
    },
    "type": "plan_optimization"
  }
}

Remove a driver

Remove a driver from the team.

Inputs

Driverdriver_idtextRequired
The driver to remove.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {}
}

Search stops

Search all stops, planned and unassigned, by keywords and an optional filter.

Inputs

Keywordskeywordtext
Words to look for in the stops' addresses, recipients and notes.
Filterfiltertext
A filter in Spoke's search language, such as deliveryInfo.succeeded = true and address ~= "London".
Page sizemax_page_sizenumber
How many to return, at most 100. Spoke returns 10 when left empty.From 1 to 100.
Page tokenpage_tokentext
The next page token from an earlier answer, to read the page after it.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "nextPageToken": "example",
    "stops": [
      {
        "stop": {
          "activity": "delivery",
          "address": {
            "address": "example",
            "addressLineOne": "example",
            "addressLineTwo": "example",
            "latitude": 1,
            "longitude": 1,
            "placeId": "example"
          },
          "allowedDrivers": [
            "example"
          ],
          "barcodes": [
            "example"
          ],
          "clientId": "example",
          "customProperties": {},
          "deliveryInfo": {
            "attempted": true,
            "attemptedAt": 1,
            "driverProvidedRecipientNotes": "example",
            "photoUrls": [
              "example"
            ],
            "recipientProvidedNotes": "example",
            "signatureUrl": "example",
            "signeeName": "example",
            "state": "example",
            "succeeded": true
          },
          "id": "example",
          "notes": "example",
          "orderInfo": {
            "invoiceNumber": "example",
            "products": [
              "example"
            ],
            "sellerName": "example",
            "sellerOrderId": "example",
            "sellerWebsite": "example"
          },
          "packageCount": 1,
          "plan": "example",
          "recipient": {
            "email": "example",
            "externalId": "example",
            "name": "example",
            "phone": "example"
          },
          "route": {
            "driver": "example",
            "id": "example",
            "plan": "example",
            "state": {
              "completed": true,
              "completedAt": 1,
              "distributed": true,
              "distributedAt": 1,
              "notifiedRecipients": true,
              "started": true,
              "startedAt": 1
            },
            "stopCount": 1,
            "title": "example"
          },
          "stopPosition": 1,
          "timing": {
            "earliestAttemptTime": {
              "hour": 1,
              "minute": 1
            },
            "estimatedAttemptDuration": 1,
            "latestAttemptTime": {
              "hour": 1,
              "minute": 1
            }
          },
          "trackingLink": "example",
          "type": "stop",
          "webAppLink": "example"
        },
        "type": "example",
        "unassignedStop": {
          "activity": "delivery",
          "address": {
            "address": "example",
            "addressLineOne": "example",
            "addressLineTwo": "example",
            "latitude": 1,
            "longitude": 1,
            "placeId": "example"
          },
          "barcodes": [
            "example"
          ],
          "clientId": "example",
          "customProperties": {},
          "depot": "example",
          "id": "example",
          "notes": "example",
          "orderInfo": {
            "invoiceNumber": "example",
            "products": [
              "example"
            ],
            "sellerName": "example",
            "sellerOrderId": "example",
            "sellerWebsite": "example"
          },
          "packageCount": 1,
          "recipient": {
            "email": "example",
            "externalId": "example",
            "name": "example",
            "phone": "example"
          },
          "trackingLink": "example"
        }
      }
    ]
  }
}

Update a driver

Change a driver's name or depots. Fields left empty stay as they are.

Inputs

Driverdriver_idtextRequired
The driver.
Namenametext
The driver's full name.
Display namedisplay_nametext
The name shown for the driver in Spoke.
Depotsdepot_idslist
The driver's depots, replacing the ones they have.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "active": true,
    "depots": [
      "example"
    ],
    "displayName": "example",
    "email": "example",
    "id": "example",
    "name": "example",
    "phone": "example"
  }
}

Update a plan

Change a plan's title, day, drivers or depot. Fields left empty stay as they are.

Inputs

Planplan_idtextRequired
The plan.
Titletitletext
The plan's new title.
Datestartsdate
The new day the plan runs.
Driversdriver_idslist
The plan's drivers, replacing the ones it has.
Depotdepot_idtext
The depot the routes start from.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "depot": "example",
    "distributed": true,
    "drivers": [
      "example"
    ],
    "id": "example",
    "optimization": "creating",
    "routes": [
      "example"
    ],
    "starts": {
      "day": 1,
      "month": 1,
      "year": 1
    },
    "title": "example",
    "writable": true
  }
}

Update a stop

Change a stop's recipient, notes, timing or packages. Spoke can't move a stop to a new address.

Inputs

Planplan_idtextRequired
The plan.
Stopstop_idtextRequired
The stop's ID, as Spoke gives it (plans/.../stops/...) or its last part.
Recipient namerecipient_nametext
The recipient's name.
Recipient emailrecipient_emailtext
The recipient's email address, for delivery updates.
Recipient phonerecipient_phonetext
The recipient's phone number, for delivery updates.
External IDexternal_idtext
Your own ID for the recipient or order, which list steps can filter by.
Notesnotestext
Notes for the driver.
Activityactivitytext
Whether the driver delivers or picks up here.One of: delivery, pickup.
Package countpackage_countnumber
How many packages.At least 0.
Position in routeoptimization_ordertext
Where the stop goes in the optimized route.One of: default, first, last.
Arrive afterearliest_timetime
The earliest time of day the driver should arrive.
Arrive beforelatest_timetime
The latest time of day the driver should arrive.
Minutes at stoptime_at_stop_minutesnumber
How many minutes the driver spends here, when not the team's usual.From 0 to 1440.
Productsproductslist
The products in this stop.
Seller order IDseller_order_idtext
The seller's order ID.
Barcodesbarcodeslist
Barcodes on the packages.
Custom propertiescustom_propertiesobject
Custom stop properties, by their IDs from List custom stop properties.

Outputs

dataobject
The response from Spoke Dispatch.
Example output
{
  "data": {
    "activity": "delivery",
    "address": {
      "address": "example",
      "addressLineOne": "example",
      "addressLineTwo": "example",
      "latitude": 1,
      "longitude": 1,
      "placeId": "example"
    },
    "allowedDrivers": [
      "example"
    ],
    "barcodes": [
      "example"
    ],
    "clientId": "example",
    "customProperties": {},
    "deliveryInfo": {
      "attempted": true,
      "attemptedAt": 1,
      "driverProvidedRecipientNotes": "example",
      "photoUrls": [
        "example"
      ],
      "recipientProvidedNotes": "example",
      "signatureUrl": "example",
      "signeeName": "example",
      "state": "example",
      "succeeded": true
    },
    "id": "example",
    "notes": "example",
    "orderInfo": {
      "invoiceNumber": "example",
      "products": [
        "example"
      ],
      "sellerName": "example",
      "sellerOrderId": "example",
      "sellerWebsite": "example"
    },
    "packageCount": 1,
    "plan": "example",
    "recipient": {
      "email": "example",
      "externalId": "example",
      "name": "example",
      "phone": "example"
    },
    "route": {
      "driver": "example",
      "id": "example",
      "plan": "example",
      "state": {
        "completed": true,
        "completedAt": 1,
        "distributed": true,
        "distributedAt": 1,
        "notifiedRecipients": true,
        "started": true,
        "startedAt": 1
      },
      "stopCount": 1,
      "title": "example"
    },
    "stopPosition": 1,
    "timing": {
      "earliestAttemptTime": {
        "hour": 1,
        "minute": 1
      },
      "estimatedAttemptDuration": 1,
      "latestAttemptTime": {
        "hour": 1,
        "minute": 1
      }
    },
    "trackingLink": "example",
    "type": "stop",
    "webAppLink": "example"
  }
}

On this page