Update an existing plan
The playground uses your live account
Update an existing plan. If the plan writable property is false, prefer using the Live Plans API.
BasicAuthAuthorizationBasic <token>Use the API key as the username and leave the password empty.
planId*stringThe plan id
^[a-zA-Z0-9---_]{1,50}$The request body for updating a plan. All the values present in the request will update the plan value, if you wish to update only certain fields, only set them and do not set the others. Any fields not set will not be updated.
Important: Notice that the drivers Array will be completely replaced. If a single driver is provided in the request, the plan will have all other previous drivers discarded.
application/json- body
The request body for updating a plan. All the values present in the request will update the plan value, if you wish to update only certain fields, only set them and do not set the others. Any fields not set will not be updated.
Important: Notice that the drivers Array will be completely replaced. If a single driver is provided in the request, the plan will have all other previous drivers discarded.
title?stringThe title of the plan.
1 <= length <= 255starts?The date the plan starts. Does not accept dates that are too far in the future or past.
drivers?array<>The drivers IDs of the plan, in the format drivers/<id>, duplicates will be ignored
items <= 50depot?|The depot id, in the format depots/<id>. If not provided, the team's Main Depot will be used.
routeOverrides?|Overrides for the plan route behavior.
The updated plan
application/json- response
The updated plan
id*stringThe unique identifier of the plan.
^plans\/[a-zA-Z0-9---_]{1,50}$title*stringThe title of the plan.
starts*A date.
depot*|The depot ID of the plan, in the format depots/<id>
distributed*booleanWhether the plan has been distributed.
writable*booleanWhether 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.
curl -X PATCH 'https://api.spoke.com/public/v1/plans/string' \ -H 'Content-Type: application/json' \ -d '{}'{ "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" } }}