{
  "openapi": "3.1.0",
  "info": {
    "title": "Spoke API",
    "description": "This is the documentation of the Spoke Public API HTTP endpoints. The Spoke\nPublic API is a way for you to interact with Spoke products programmatically.\n\n# Introduction\n\nThe API has a set of HTTP methods to operate on Spoke resources for a specific\nteam.\n\nCurrently, Spoke offers no programming SDKs for interacting with the Public\nAPI, but you can implement your own interface by calling the methods documented\non this page.\n\n# Using the API\n\nThis section describes how the Spoke API should be used, if you wish to see\nexample implementations take a look at the [API Usage\nExamples](/docs/api-examples) page.\n\n## Address\n\nThe base API address for this version of the API to be used before every\nendpoint listed here is: `https://api.getcircuit.com/public/v0.2b`\n\nNotice the `https://` prefix, Spoke API will **not** accept plain HTTP\nrequests.\n\n## Authentication\n\nTo use Spoke Public API endpoints you will first need to generate an API key\nfor authenticating with our servers.\n\nTo do this you need to go to your Spoke Dispatch settings page > Integrations\n\\> API, and generate a new key there.\n\nOnce you have the API key you can use it in the `Authorization` header\neither using the Basic scheme, or as a Bearer token.\n\n### Basic Auth\n\n[Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) is the primary authentication scheme used\nby Spoke's API.\n\nBasic authentication typically uses a base64 encoded `username:password`\npair, but since we only require an API key we instead structure the payload as `[yourApiKey]:[empty]`. This\nvalue is then base64 encoded as usual.\n\nExample with `curl`:\n\n```bash\ncurl \"https://api.getcircuit.com/public/v0.2b/plans\" -u yourApiKey:\n```\n\nIf you did everything correctly you should see a list of your team's plans in response\nto this request.\n\nThe `-u` flag adds a header to the request in the following format:\n\n```http\nAuthorization: Basic eW91ckFwaUtleToK\n```\n\nNote that curl automatically base64 encoded the data. Other clients will do the same e.g. if using Postman you would\nconfigure the request's Authorization option instead of adding a header directly.\n\n### Bearer Token\n\nAlternatively you can pass the API key as a Bearer token without any special encoding.\ni.e. `Authorization: Bearer [yourApiKey]`.\n\nExample with `curl`:\n\n```bash\ncurl \"https://api.getcircuit.com/public/v0.2b/plans\" -H \"Authorization: Bearer yourApiKey\"\n```\n\n## On resource types\n\nEvery response from the Spoke Public API will be as JSON Objects, and every\nrequest that has a body also needs to be in that type, and the header\n`Content-type: application/json` needs to present, so the server knows that the\nbody you are sending is valid JSON. Spoke will reject requests without that\nheader, so be sure to use it.\n\n## On resource IDs\n\nEvery resource in the Spoke Public API has a unique ID. This ID is generated\nby Spoke and is unique for every resource per collection.\n\nEvery resource representation returned by the API will show the ID in the\nfollowing format:\n\n```json\n{\n  \"id\": \"collectionName/resourceId\"\n}\n```\n\nAnd if the resource is on a sub-collection, it will be in the following format:\n\n```json\n{\n  \"id\": \"collectionName/resourceId/subcollectionName/subResourceId\"\n}\n```\n\nFor example, a stop with ID `stop1` under a plan with ID `plan1` will have the\nfollowing representation on its serialized ID field:\n\n```json\n{\n  \"id\": \"plans/plan1/stops/stop1\"\n}\n```\n\nThis means that if you wish to directly retrieve this stop by using a GET\nendpoint you can simply use this ID as follows:\n\n```bash\ncurl \"https://api.getcircuit.com/public/v0.2b/`serializedId`\" -u yourApiKey:\n```\n\nFor the example above this would be:\n\n```bash\ncurl \"https://api.getcircuit.com/public/v0.2b/plans/plan1/stops/stop1\" -u yourApiKey:\n```\n\n## On List endpoints\n\nWhen using list endpoints, you have the ability to combine various query options\nto locate the desired results. Some endpoints even offer specific filter options\nto aid in this search.\n\nAll the list endpoints employ pagination. This means that a single request might\nonly return a part of the entire set of resources you're aiming to retrieve. To\nmove through the subsequent pages, the Spoke API provides a `nextPageToken`\nfield in the response of every list endpoint query.\n\nIt's crucial to understand that when a `nextPageToken` is returned, it indicates\nthat more data is available. For every subsequent request, this token should be\nadded as the `pageToken` query parameter. And, importantly, **all the original\nquery parameters** used in the first request must also be included.\n\nHere's a step-by-step example to elucidate this:\n\n1. Suppose you initiate a request to list your plans:\n\n```bash\ncurl \"https://api.getcircuit.com/public/v0.2b/plans?filter.startsGte=2023-05-01\" -u yourApiKey:\n```\n\n2. The Spoke API might return a response like:\n\n```json\n{\n  // other attributes\n  \"nextPageToken\": \"I53Jr5Eu2qK9omh0iA8q\"\n}\n```\n\n3. To retrieve the next page of data, use the returned `nextPageToken` as the\n   `pageToken` query parameter, and ensure all initial query parameters remain\n   the same:\n\n```bash\ncurl \"https://api.getcircuit.com/public/v0.2b/plans?filter.startsGte=2023-05-01&pageToken=I53Jr5Eu2qK9omh0iA8q\" -u yourApiKey:\n```\n\n4. Repeat step 3 for all subsequent pages, updating the `pageToken` parameter\n   with the latest `nextPageToken` value returned until `nextPageToken` is\n   `null` in the response.\n\nSpoke also accepts limiting the maximum number of results per page by using\nthe `maxPageSize` query parameter, but notice that each individual endpoint has\na maximum value you can set this to.\n\n## On Update endpoints (HTTP PATCH verb)\n\nUpdate methods differ from the other methods in the API in the sense that\nmissing values in the JSON representation will **not** act upon the\nrepresentation of the resource.\n\nExplaining this by example: Suppose you have a Plan with the ID `plan1` in your\nplans' collection, and you wanted to merely update its title to `My API Plan`\nwithout changing other information, such as assigned drivers or the start date.\nTo do this you would issue the following request:\n\n```bash\ncurl -X PATCH http://localhost:5005/public/v0.2b/plans/plan1 -H 'Content-type: application/json' -d '{\"title\": \"My API Plan\"}' -u yourApiKey:\n```\n\nNotice how we don't pass any other information in the JSON, only the title. This\nensures that the `PATCH` request will only operate on the provided parameters\nand keep the other parameters as-is.\n\nIt is important to also notice that when updating an array the whole array will\nbe replaced, Spoke API does not support partial updates on arrays.\n\n## On Rate-Limiting\n\nAll the endpoints in the Spoke Public API are rate-limited, which means we\nwill reject requests that come in too fast.\n\nTo know if your request was rate-limited, check if the response has the HTTP\nstatus code 429.\n\nEach endpoint has a different rate limit, and Spoke can change this rate\nlimit at any moment.\n\nThe rate limits are as follows:\n\n- **Rate Limits for Write Endpoints**: All write endpoints have a limit of 5\n  requests per second, which includes Creation (POST), Update (PATCH), and\n  Deletion (DELETE) operations for all models.\n  - An exception to this rule is the Driver Creation endpoint, which is limited to\n    1 request per second. Thus, we recommend using the Batch Import Drivers\n    when adding multiple drivers.\n- **Rate Limits for Read Endpoints**: All read endpoints, including list\n  endpoints, are limited to 10 requests per second.\n- **Rate Limits for Batch Import**:\n  - The _Batch Import_ endpoints for Stops and Unassigned Stops models are\n    limited to 10 requests per _minute_. However, these endpoints can handle the\n    import of up to 1,000 stops per minute. The Creation, Update, and Deletion\n    endpoints for these models still maintain a rate limit of 5 requests per\n    second.\n  - The _Batch Import_ endpoint for Drivers is limited to 2 requests per\n    _minute_. This allows for the import of up to 100 drivers per minute.\n- **Rate Limits for Optimization Endpoints**: The Plan _optimization_ and\n  _re-optimization_ endpoints are limited to 3 requests per _minute_, due to\n  the long running nature of these operations.\n\nSpoke API will occasionally support bursts of requests, but they cannot be\nsustained and will be rejected if they last too long.\n\nIf Spoke rejects your request because it exceeds the rate limit, you must\nwait before retrying it. We suggest you use an [exponential\nbackoff](https://en.wikipedia.org/wiki/Exponential_backoff) approach for this.\n\nWe also recommend, besides the exponential backoff algorithm, that you add a\nrandom delay to each attempt to prevent a [thundering herd\nproblem](https://en.wikipedia.org/wiki/Thundering_herd_problem).\n\nIf the client keeps retrying rate-limited requests while being rejected with a\n429 at a high rate, Spoke will keep rejecting the requests until you turn\ndown the request rate.\n\nSpoke will also limit requests if it keeps receiving them at a high frequency\nat or close to the requests limit for an extended period, so while we support\nan occasional burst of requests, if this is sustained for a long period, we\nwill rate-limit the client making them.\n\nWhile we feel these rate-limits will work for the vast majority of use cases we\nunderstand every team is different. So please reach out to us and describe your\nuse case if these limits are not enough for you, and we will evaluate\nincreasing them for your team.\n\n## On the models\n\nAfter this section you will find all the Spoke Public API endpoints available.\n\nEvery representation of resources that these endpoints create and return are\ndocumented in the [Models](/docs/category/models) page of the docs.\n",
    "version": "v0.2b"
  },
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Use the API key as the username and leave the password empty."
      }
    },
    "schemas": {
      "customStopPropertySchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "visibleToDrivers": {
            "type": "boolean"
          },
          "visibleToRecipients": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "visibleToDrivers",
          "visibleToRecipients"
        ],
        "additionalProperties": false
      },
      "dateSchema": {
        "type": "object",
        "properties": {
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "year": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "day",
          "month",
          "year"
        ],
        "additionalProperties": false
      },
      "depotIdSchema": {
        "type": "string",
        "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "depotSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/depotIdSchema"
              }
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "driverIdSchema": {
        "type": "string",
        "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "driverSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/driverIdSchema"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "displayName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "depots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/depotIdSchema"
            }
          },
          "routeOverrides": {
            "type": "object",
            "properties": {
              "startTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/timeOfDaySchema"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "endTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/timeOfDaySchema"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "startAddress": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "addressLineOne": {
                        "type": "string"
                      },
                      "addressLineTwo": {
                        "type": "string"
                      },
                      "latitude": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": -90,
                            "maximum": 90
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "longitude": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": -180,
                            "maximum": 180
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "placeId": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "placeTypes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "address",
                      "addressLineOne",
                      "addressLineTwo",
                      "latitude",
                      "longitude",
                      "placeId",
                      "placeTypes"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "endAddress": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "addressLineOne": {
                        "type": "string"
                      },
                      "addressLineTwo": {
                        "type": "string"
                      },
                      "latitude": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": -90,
                            "maximum": 90
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "longitude": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": -180,
                            "maximum": 180
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "placeId": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "placeTypes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "address",
                      "addressLineOne",
                      "addressLineTwo",
                      "latitude",
                      "longitude",
                      "placeId",
                      "placeTypes"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxStops": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "drivingSpeed": {
                "type": "string",
                "enum": [
                  "slower",
                  "average",
                  "faster"
                ]
              },
              "deliverySpeed": {
                "type": "string",
                "enum": [
                  "slower",
                  "average",
                  "faster"
                ]
              },
              "vehicleType": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "bike",
                      "scooter",
                      "car",
                      "small_truck",
                      "truck",
                      "electric_cargo_bike"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "startTime",
              "endTime",
              "startAddress",
              "endAddress",
              "maxStops",
              "drivingSpeed",
              "deliverySpeed",
              "vehicleType"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "displayName",
          "active",
          "depots",
          "routeOverrides"
        ],
        "additionalProperties": false
      },
      "operationIdSchema": {
        "type": "string",
        "pattern": "^operations\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "operationSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/operationIdSchema"
              }
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "plan_optimization"
            ]
          },
          "done": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "canceled": {
                "type": "boolean"
              },
              "startedAt": {
                "type": "number"
              },
              "finishedAt": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "startedBy": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "dispatcher"
                    ]
                  },
                  {
                    "type": "string",
                    "enum": [
                      "api"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "targetPlanId": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/planIdSchema"
                  }
                ]
              }
            },
            "required": [
              "canceled",
              "startedAt",
              "finishedAt",
              "startedBy",
              "targetPlanId"
            ]
          },
          "result": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "numOptimizedStops": {
                        "type": "number"
                      },
                      "skippedStops": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "allOf": [
                                {
                                  "$ref": "#/components/schemas/stopIdSchema"
                                }
                              ]
                            },
                            "reason": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "impossible_time_window"
                                  ]
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "impossible_navigation"
                                  ]
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "impossible_number_of_stops"
                                  ]
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "impossible_order_of_stops"
                                  ]
                                },
                                {
                                  "type": "string"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "reason"
                          ]
                        }
                      }
                    },
                    "required": [
                      "numOptimizedStops",
                      "skippedStops"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "type",
          "done",
          "metadata",
          "result"
        ]
      },
      "planIdSchema": {
        "type": "string",
        "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "planSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/planIdSchema"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "starts": {
            "$ref": "#/components/schemas/dateSchema"
          },
          "depot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/depotIdSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "distributed": {
            "type": "boolean"
          },
          "writable": {
            "type": "boolean"
          },
          "optimization": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "creating",
                  "editing",
                  "preview",
                  "optimized",
                  "optimizing"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "drivers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/driverSchema"
            }
          },
          "routes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/routeIdSchema"
            }
          }
        },
        "required": [
          "id",
          "title",
          "starts",
          "depot",
          "distributed",
          "writable",
          "optimization",
          "drivers",
          "routes"
        ],
        "additionalProperties": false
      },
      "routeIdSchema": {
        "type": "string",
        "pattern": "^routes\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "routeSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/routeIdSchema"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "stopCount": {
            "type": "number"
          },
          "driver": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/driverIdSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "completed": {
                    "type": "boolean"
                  },
                  "completedAt": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "distributed": {
                    "type": "boolean"
                  },
                  "distributedAt": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notifiedRecipients": {
                    "type": "boolean"
                  },
                  "notifiedRecipientsAt": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "started": {
                    "type": "boolean"
                  },
                  "startedAt": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "completed",
                  "completedAt",
                  "distributed",
                  "distributedAt",
                  "notifiedRecipients",
                  "notifiedRecipientsAt",
                  "started",
                  "startedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/planIdSchema"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "title",
          "stopCount",
          "driver",
          "state",
          "plan"
        ],
        "additionalProperties": false
      },
      "stopIdSchema": {
        "type": "string",
        "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "stopSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/stopIdSchema"
              }
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "address": {
                "type": "string"
              },
              "addressLineOne": {
                "type": "string"
              },
              "addressLineTwo": {
                "type": "string"
              },
              "latitude": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "longitude": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "placeId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "placeTypes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "address",
              "addressLineOne",
              "addressLineTwo",
              "latitude",
              "longitude",
              "placeId",
              "placeTypes"
            ],
            "additionalProperties": false
          },
          "barcodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "driverIdentifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "allowedDriversIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "estimatedTravelDuration": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "estimatedTravelDistance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "packageCount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "weight": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "kilogram",
                      "pound",
                      "metric-ton"
                    ]
                  }
                },
                "required": [
                  "amount",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "end"
            ]
          },
          "packageLabel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "stopPosition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "trackingLink": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "webAppLink": {
            "type": "string"
          },
          "orderInfo": {
            "type": "object",
            "properties": {
              "products": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sellerName": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sellerOrderId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sellerWebsite": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "products",
              "sellerName",
              "sellerOrderId",
              "sellerWebsite"
            ],
            "additionalProperties": false
          },
          "placeInVehicle": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "x": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "left",
                          "right"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "y": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "front",
                          "back",
                          "middle"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "z": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "floor",
                          "shelf"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "x",
                  "y",
                  "z"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "phone": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "externalId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "email",
              "phone",
              "externalId"
            ],
            "additionalProperties": false
          },
          "activity": {
            "default": "delivery",
            "type": "string",
            "enum": [
              "delivery",
              "pickup"
            ]
          },
          "deliveryInfo": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "attempted": {
                    "type": "boolean"
                  },
                  "attemptedAt": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "attemptedLocation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "latitude": {
                            "type": "number"
                          },
                          "longitude": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "latitude",
                          "longitude"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "driverProvidedInternalNotes": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "driverProvidedRecipientNotes": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "photoUrls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "recipientProvidedNotes": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "signatureUrl": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "signeeName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "succeeded": {
                    "type": "boolean"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "delivered_to_recipient",
                      "delivered_to_third_party",
                      "delivered_to_mailbox",
                      "delivered_to_safe_place",
                      "delivered_to_pickup_point",
                      "delivered_other",
                      "picked_up_from_customer",
                      "picked_up_unmanned",
                      "picked_up_from_locker",
                      "picked_up_other",
                      "failed_not_home",
                      "failed_cant_find_address",
                      "failed_no_parking",
                      "failed_no_time",
                      "failed_package_not_available",
                      "failed_other",
                      "failed_missing_required_proof",
                      "failed_payment_not_received",
                      "unattempted"
                    ]
                  }
                },
                "required": [
                  "attempted",
                  "attemptedAt",
                  "attemptedLocation",
                  "driverProvidedInternalNotes",
                  "driverProvidedRecipientNotes",
                  "photoUrls",
                  "recipientProvidedNotes",
                  "signatureUrl",
                  "signeeName",
                  "succeeded",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "paymentOnDelivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "proofOfAttemptRequirements": {
            "type": "object",
            "properties": {
              "enabled": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "enabled"
            ],
            "additionalProperties": false
          },
          "plan": {
            "allOf": [
              {
                "$ref": "#/components/schemas/planIdSchema"
              }
            ]
          },
          "route": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/routeSchema"
              },
              {
                "type": "null"
              }
            ]
          },
          "eta": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "estimatedArrivalAt": {
                    "type": "number"
                  },
                  "estimatedLatestArrivalAt": {
                    "type": "number"
                  },
                  "estimatedEarliestArrivalAt": {
                    "type": "number"
                  }
                },
                "required": [
                  "estimatedArrivalAt",
                  "estimatedLatestArrivalAt",
                  "estimatedEarliestArrivalAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "etaNullReason": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "not_optimized",
                      "subscription_not_supported"
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "reason",
                  "message",
                  "url"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "timing": {
            "type": "object",
            "properties": {
              "estimatedAttemptDuration": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "earliestAttemptTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/timeOfDaySchema"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "latestAttemptTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/timeOfDaySchema"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "estimatedAttemptDuration",
              "earliestAttemptTime",
              "latestAttemptTime"
            ],
            "additionalProperties": false
          },
          "optimizationOrder": {
            "default": "default",
            "type": "string",
            "enum": [
              "first",
              "last",
              "default"
            ]
          },
          "customProperties": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "circuitClientId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "address",
          "barcodes",
          "driverIdentifier",
          "allowedDriversIdentifiers",
          "estimatedTravelDuration",
          "estimatedTravelDistance",
          "notes",
          "packageCount",
          "weight",
          "type",
          "packageLabel",
          "stopPosition",
          "trackingLink",
          "webAppLink",
          "orderInfo",
          "placeInVehicle",
          "recipient",
          "deliveryInfo",
          "paymentOnDelivery",
          "proofOfAttemptRequirements",
          "plan",
          "route",
          "eta",
          "etaNullReason",
          "timing",
          "customProperties",
          "circuitClientId"
        ],
        "additionalProperties": false
      },
      "timeOfDaySchema": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "minute": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "hour",
          "minute"
        ],
        "additionalProperties": false
      },
      "unassignedStopIdSchema": {
        "type": "string",
        "pattern": "^unassignedStops\\/[a-zA-Z0-9---_]{1,50}$"
      },
      "unassignedStopSchema": {
        "type": "object",
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/unassignedStopIdSchema"
              }
            ]
          },
          "depot": {
            "type": "string",
            "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
          },
          "address": {
            "type": "object",
            "properties": {
              "address": {
                "type": "string"
              },
              "addressLineOne": {
                "type": "string"
              },
              "addressLineTwo": {
                "type": "string"
              },
              "latitude": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "longitude": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "placeId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "placeTypes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "address",
              "addressLineOne",
              "addressLineTwo",
              "latitude",
              "longitude",
              "placeId",
              "placeTypes"
            ],
            "additionalProperties": false
          },
          "barcodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowedDriversIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "packageCount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "weight": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "kilogram",
                      "pound",
                      "metric-ton"
                    ]
                  }
                },
                "required": [
                  "amount",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "orderInfo": {
            "type": "object",
            "properties": {
              "products": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sellerName": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sellerOrderId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sellerWebsite": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "products",
              "sellerName",
              "sellerOrderId",
              "sellerWebsite"
            ],
            "additionalProperties": false
          },
          "recipient": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "phone": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "externalId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "email",
              "phone",
              "externalId"
            ],
            "additionalProperties": false
          },
          "activity": {
            "default": "delivery",
            "type": "string",
            "enum": [
              "delivery",
              "pickup"
            ]
          },
          "timing": {
            "type": "object",
            "properties": {
              "estimatedAttemptDuration": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "earliestAttemptTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/timeOfDaySchema"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "latestAttemptTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/timeOfDaySchema"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "estimatedAttemptDuration",
              "earliestAttemptTime",
              "latestAttemptTime"
            ],
            "additionalProperties": false
          },
          "optimizationOrder": {
            "default": "default",
            "type": "string",
            "enum": [
              "first",
              "last",
              "default"
            ]
          },
          "paymentOnDelivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "proofOfAttemptRequirements": {
            "type": "object",
            "properties": {
              "enabled": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "enabled"
            ],
            "additionalProperties": false
          },
          "customProperties": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "circuitClientId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "depot",
          "address",
          "barcodes",
          "allowedDriversIdentifiers",
          "notes",
          "packageCount",
          "weight",
          "orderInfo",
          "recipient",
          "timing",
          "paymentOnDelivery",
          "proofOfAttemptRequirements",
          "customProperties",
          "circuitClientId"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/plans": {
      "post": {
        "operationId": "createPlan",
        "summary": "Create a new plan",
        "tags": [
          "Plans"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The request body for creating a plan.",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "starts": {
                    "description": "The date the plan starts. Does not accept dates that are too far in the future or past.",
                    "type": "object",
                    "properties": {
                      "day": {
                        "description": "The day of the date.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      },
                      "month": {
                        "description": "The month of the date.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      },
                      "year": {
                        "description": "The year of the date.",
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "day",
                      "month",
                      "year"
                    ],
                    "additionalProperties": false
                  },
                  "drivers": {
                    "default": [],
                    "description": "The drivers IDs of the plan, in the format `drivers/<id>`, duplicates will be ignored",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "description": "The driver id, in the format `drivers/<id>`",
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "depot": {
                    "description": "The depot id, in the format `depots/<id>`. If not provided, the team's Main Depot will be used.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                  }
                },
                "required": [
                  "title",
                  "starts"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true,
          "description": "The request body for creating a plan."
        },
        "responses": {
          "200": {
            "description": "The created plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/planSchema",
                  "description": "The created plan"
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The depot or driver could not be found.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Depot not found"
                          ]
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "title": "Depot not found"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "Driver not found"
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "title": "Driver not found"
                    }
                  ],
                  "description": "The depot or driver could not be found."
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Depot not found"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "depot_not_found"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Depot not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listPlans",
        "summary": "List plans",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "pageToken",
            "required": false,
            "description": "The page token, if any."
          },
          {
            "schema": {
              "default": 10,
              "type": "number",
              "minimum": 1,
              "maximum": 20
            },
            "in": "query",
            "name": "maxPageSize",
            "required": false,
            "description": "The max page size."
          },
          {
            "schema": {
              "type": "object",
              "properties": {
                "title": {
                  "description": "Filter by title, exact match",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "startsGte": {
                  "description": "Search for plans that start after this date, inclusive. The date must be in the format YYYY-MM-DD.",
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                },
                "startsLte": {
                  "description": "Search for plans that start before this date,inclusive. The date must be in the format YYYY-MM-DD.",
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                }
              },
              "additionalProperties": false
            },
            "in": "query",
            "name": "filter",
            "required": false,
            "description": "The filter to apply to the list of plans. The filter params are passed like this: `?filter[title]=foo` or like this: `?filter.title=foo`"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "plans": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/planSchema"
                      }
                    },
                    "nextPageToken": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "plans",
                    "nextPageToken"
                  ],
                  "definitions": {
                    "planSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "starts": {
                          "type": "object",
                          "properties": {
                            "day": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 31
                            },
                            "month": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 12
                            },
                            "year": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "day",
                            "month",
                            "year"
                          ],
                          "additionalProperties": false
                        },
                        "depot": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "distributed": {
                          "type": "boolean"
                        },
                        "writable": {
                          "type": "boolean"
                        },
                        "optimization": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "creating",
                                "editing",
                                "preview",
                                "optimized",
                                "optimizing"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "drivers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                              },
                              "name": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "email": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "phone": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "displayName": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "depots": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                                }
                              },
                              "routeOverrides": {
                                "type": "object",
                                "properties": {
                                  "startTime": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "hour": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          "minute": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "hour",
                                          "minute"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "endTime": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "hour": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          "minute": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "hour",
                                          "minute"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "startAddress": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "address": {
                                            "type": "string"
                                          },
                                          "addressLineOne": {
                                            "type": "string"
                                          },
                                          "addressLineTwo": {
                                            "type": "string"
                                          },
                                          "latitude": {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "minimum": -90,
                                                "maximum": 90
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "longitude": {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "minimum": -180,
                                                "maximum": 180
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "placeId": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "placeTypes": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        },
                                        "required": [
                                          "address",
                                          "addressLineOne",
                                          "addressLineTwo",
                                          "latitude",
                                          "longitude",
                                          "placeId",
                                          "placeTypes"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "endAddress": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "address": {
                                            "type": "string"
                                          },
                                          "addressLineOne": {
                                            "type": "string"
                                          },
                                          "addressLineTwo": {
                                            "type": "string"
                                          },
                                          "latitude": {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "minimum": -90,
                                                "maximum": 90
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "longitude": {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "minimum": -180,
                                                "maximum": 180
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "placeId": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "placeTypes": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        },
                                        "required": [
                                          "address",
                                          "addressLineOne",
                                          "addressLineTwo",
                                          "latitude",
                                          "longitude",
                                          "placeId",
                                          "placeTypes"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "maxStops": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "drivingSpeed": {
                                    "type": "string",
                                    "enum": [
                                      "slower",
                                      "average",
                                      "faster"
                                    ]
                                  },
                                  "deliverySpeed": {
                                    "type": "string",
                                    "enum": [
                                      "slower",
                                      "average",
                                      "faster"
                                    ]
                                  },
                                  "vehicleType": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "enum": [
                                          "bike",
                                          "scooter",
                                          "car",
                                          "small_truck",
                                          "truck",
                                          "electric_cargo_bike"
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "startTime",
                                  "endTime",
                                  "startAddress",
                                  "endAddress",
                                  "maxStops",
                                  "drivingSpeed",
                                  "deliverySpeed",
                                  "vehicleType"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "email",
                              "phone",
                              "displayName",
                              "active",
                              "depots",
                              "routeOverrides"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "routes": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^routes\\/[a-zA-Z0-9---_]{1,50}$"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "starts",
                        "depot",
                        "distributed",
                        "writable",
                        "optimization",
                        "drivers",
                        "routes"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}": {
      "patch": {
        "operationId": "updatePlan",
        "summary": "Update an existing plan",
        "tags": [
          "Plans"
        ],
        "description": "Update an existing plan. If the plan `writable` property is false, prefer using the [Live Plans API](#tag/Live-Plans).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "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.\n\n**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.",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "starts": {
                    "description": "The date the plan starts. Does not accept dates that are too far in the future or past.",
                    "type": "object",
                    "properties": {
                      "day": {
                        "description": "The day of the date.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      },
                      "month": {
                        "description": "The month of the date.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      },
                      "year": {
                        "description": "The year of the date.",
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "day",
                      "month",
                      "year"
                    ],
                    "additionalProperties": false
                  },
                  "drivers": {
                    "description": "The drivers IDs of the plan, in the format `drivers/<id>`, duplicates will be ignored",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "description": "The driver id, in the format `drivers/<id>`",
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "depot": {
                    "description": "The depot id, in the format `depots/<id>`. If not provided, the team's Main Depot will be used.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "description": "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.\n\n**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."
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The updated plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/planSchema",
                  "description": "The updated plan"
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The plan, depot, or driver could not be found.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan not found"
                          ]
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "title": "Plan not found"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Depot not found"
                          ]
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "title": "Depot not found"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "Driver not found"
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "title": "Driver not found"
                    }
                  ],
                  "description": "The plan, depot, or driver could not be found."
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is not writable"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_not_writable"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan is not writable"
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getPlan",
        "summary": "Retrieve a plan",
        "tags": [
          "Plans"
        ],
        "description": "Retrieve a plan",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/planSchema",
                  "description": "The requested plan"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePlan",
        "summary": "Delete a plan",
        "tags": [
          "Plans"
        ],
        "description": "Delete a plan and related routes. This action cannot be undone and will delete all the releated routes as well, even if the plan is not in a writable state. As this action is not atomic, it is possible that only partial deletion occurs if the endpoint errors out with a 500. In that case it is recommended to retry the request.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "204": {
            "description": "Plan deleted successfully"
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}:optimize": {
      "post": {
        "operationId": "optimizePlan",
        "summary": "Optimize a plan",
        "tags": [
          "Plans"
        ],
        "description": "Optimize a plan. Returns the created operation, which can be polled for the result. Use the returned `id` with the [operations](#tag/Operations) endpoints to poll for the result.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The created plan_optimization operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationSchema",
                  "description": "The created plan_optimization operation."
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not writable, an optimization is already in progress, there are no drivers, or there is a problem with the depot.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan already optimized"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_already_optimized"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan already optimized"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan optimization in progress"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_optimization_in_progress"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan optimization in progress"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan has no drivers. Either the plan's depot has no drivers, if the optimization is for minimizing drivers, or the plan has no assigned drivers."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "no_drivers_available"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan has no drivers"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Please set an end time or max stops per driver for the plan's depot when optimizing to minimize drivers."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "no_end_time_and_max_stops_per_driver"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan's depot has no end time and max stops per driver"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Depot not found"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "depot_not_found"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Depot not found"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Please set a start location for the plan's depot."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "depot_missing_start_address"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan's depot missing start address"
                    }
                  ],
                  "description": "The plan is not writable, an optimization is already in progress, there are no drivers, or there is a problem with the depot."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}:distribute": {
      "post": {
        "operationId": "distributePlan",
        "summary": "Distribute a plan",
        "tags": [
          "Plans"
        ],
        "description": "Distribute a plan to its drivers. This will send then their routes.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The distributed plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/planSchema",
                  "description": "The distributed plan"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not yet optimized, is optimizing, was already distributed or was modified whilst processing request.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan already distributed"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_already_distributed"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan already distributed"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan not optimized"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_not_optimized"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan not optimized"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan optimization in progress"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_optimization_in_progress"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan optimization in progress"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan was modified by a concurrent request. Please retry your request."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_concurrent_modification"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan modified whilst processing request"
                    }
                  ],
                  "description": "The plan is not yet optimized, is optimizing, was already distributed or was modified whilst processing request."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}:reoptimize": {
      "post": {
        "operationId": "reoptimizePlan",
        "summary": "Re-optimize a plan",
        "tags": [
          "Live Plans"
        ],
        "description": "Re-optimize a plan. This endpoint should be used only after updating a live plan. Returns the created operation, which can be polled for the result. Use the returned `id` with the [operations](#tag/Operations) endpoints to poll for the result.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The request body for reoptimize a plan.",
                "type": "object",
                "properties": {
                  "optimizationType": {
                    "description": "The type of optimization to use",
                    "default": "reorder_changed_stops",
                    "type": "string",
                    "enum": [
                      "reorder_changed_stops",
                      "reorder_all_stops",
                      "redistribute_stops_between_drivers"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "description": "The request body for reoptimize a plan."
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The created plan_optimization operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationSchema",
                  "description": "The created plan_optimization operation."
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not being edited, an optimization is already in progress, there are no drivers, or there is a problem with the depot.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan already optimized"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_already_optimized"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan already optimized"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Only `reorder_changed_stops` optimization type is supported when the plan is already distributed."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_optimization_not_supported"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan optimization type is not supported"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan optimization in progress"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_optimization_in_progress"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan optimization in progress"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan has no drivers. Either the plan's depot has no drivers, if the optimization is for minimizing drivers, or the plan has no assigned drivers."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "no_drivers_available"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan has no drivers"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Please set an end time or max stops per driver for the plan's depot when optimizing to minimize drivers."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "no_end_time_and_max_stops_per_driver"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan's depot has no end time and max stops per driver"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Depot not found"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "depot_not_found"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Depot not found"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Please set a start location for the plan's depot."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "depot_missing_start_address"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan's depot missing start address"
                    }
                  ],
                  "description": "The plan is not being edited, an optimization is already in progress, there are no drivers, or there is a problem with the depot."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}:redistribute": {
      "post": {
        "operationId": "redistributePlan",
        "summary": "Re-distribute a plan",
        "tags": [
          "Live Plans"
        ],
        "description": "Re-distribute a plan to its drivers. This endpoint should be used only after updating a live plan. This will apply the re-optimization changes and send the drivers their routes.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The distributed plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/planSchema",
                  "description": "The distributed plan"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not yet optimized, is optimizing, was already distributed or was modified whilst processing request.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan already distributed"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_already_distributed"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan already distributed"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan not optimized"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_not_optimized"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan not optimized"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan optimization in progress"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_optimization_in_progress"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan optimization in progress"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan was modified by a concurrent request. Please retry your request."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_concurrent_modification"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan modified whilst processing request"
                    }
                  ],
                  "description": "The plan is not yet optimized, is optimizing, was already distributed or was modified whilst processing request."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}:save": {
      "post": {
        "operationId": "savePlan",
        "summary": "Save the plan changes",
        "tags": [
          "Live Plans"
        ],
        "description": "Save the plan changes after re-optimization without distributing it. This endpoint is optional since re-distribute already saves the changes.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "204": {
            "description": "Plan saved successfully"
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not yet optimized, an optimization is in progress or it was modified whilst processing request.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan not optimized"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_not_optimized"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan not optimized"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan optimization in progress"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_optimization_in_progress"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan optimization in progress"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan was modified by a concurrent request. Please retry your request."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_concurrent_modification"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ],
                      "title": "Plan modified whilst processing request"
                    }
                  ],
                  "description": "The plan is not yet optimized, an optimization is in progress or it was modified whilst processing request."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops": {
      "post": {
        "operationId": "createStop",
        "summary": "Create a new stop",
        "tags": [
          "Stops"
        ],
        "description": "Create a new stop with the given data. Prefer using the [batch import endpoint](#tag/Stops/operation/importStops) if you want to create multiple stops at once as it is more efficient and will produce better geocoding results. If the plan is not writable, this will fail, prefer using the [Live Create Stop API](#tag/Live-Stops/operation/createLiveStop) instead.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "object",
                    "properties": {
                      "addressName": {
                        "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "addressLineOne": {
                        "description": "The first line of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "addressLineTwo": {
                        "description": "The second line of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "city": {
                        "description": "The city of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "state": {
                        "description": "The state of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "zip": {
                        "description": "The zip code of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "country": {
                        "description": "The country of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "latitude": {
                        "description": "The latitude of the address in decimal degrees.",
                        "nullable": true,
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "longitude": {
                        "description": "The longitude of the address in decimal degrees.",
                        "nullable": true,
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "additionalProperties": false
                  },
                  "timing": {
                    "nullable": true,
                    "description": "Timing information for this stop",
                    "type": "object",
                    "properties": {
                      "earliestAttemptTime": {
                        "description": "Time of day of the earliest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "latestAttemptTime": {
                        "description": "Time of day of the latest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "estimatedAttemptDuration": {
                        "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  },
                  "recipient": {
                    "nullable": true,
                    "description": "Recipient information for this stop",
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "description": "External ID of the recipient, as defined by the API user",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "email": {
                        "description": "Email of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "phone": {
                        "description": "Phone number of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "name": {
                        "description": "Name of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "orderInfo": {
                    "nullable": true,
                    "description": "Order information for this stop",
                    "type": "object",
                    "properties": {
                      "products": {
                        "description": "Products in this stop",
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "sellerOrderId": {
                        "description": "Seller order ID",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerName": {
                        "description": "Seller name",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerWebsite": {
                        "description": "Seller website",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "paymentOnDelivery": {
                    "nullable": true,
                    "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                        "nullable": true,
                        "type": "integer",
                        "exclusiveMinimum": true,
                        "maximum": 9007199254740991
                      },
                      "currency": {
                        "description": "Currency of the payment. Defaults to the team's currency.",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "AED",
                          "ARS",
                          "AUD",
                          "BRL",
                          "CAD",
                          "CHF",
                          "CLP",
                          "CNY",
                          "COP",
                          "DKK",
                          "EGP",
                          "EUR",
                          "GBP",
                          "HKD",
                          "HUF",
                          "ILS",
                          "INR",
                          "JPY",
                          "KRW",
                          "MYR",
                          "MXN",
                          "NOK",
                          "NZD",
                          "PEN",
                          "RON",
                          "RUB",
                          "SAR",
                          "SEK",
                          "SGD",
                          "TRY",
                          "USD",
                          "UYU",
                          "ZAR"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "proofOfAttemptRequirements": {
                    "nullable": true,
                    "description": "Proof of attempt requirement settings for this stop",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Whether proof of attempt is required for this stop",
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "driver": {
                    "description": "Deprecated. Prefer using the `allowedDrivers` field instead.\nDriver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `allowedDrivers` field.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                  },
                  "allowedDrivers": {
                    "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `driver` field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.",
                    "nullable": true,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "activity": {
                    "description": "Activity type",
                    "default": "delivery",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "delivery",
                      "pickup"
                    ]
                  },
                  "optimizationOrder": {
                    "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "first",
                      "last",
                      "default"
                    ]
                  },
                  "packageCount": {
                    "description": "Number of packages in the stop",
                    "nullable": true,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "weight": {
                    "description": "Weight information for this stop.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "The weight amount for this stop.",
                        "type": "number",
                        "minimum": 0,
                        "maximum": 999999,
                        "multipleOf": 0.01
                      },
                      "unit": {
                        "description": "The weight unit in which the amount is specified.",
                        "type": "string",
                        "enum": [
                          "kilogram",
                          "pound",
                          "metric-ton"
                        ]
                      }
                    },
                    "required": [
                      "amount",
                      "unit"
                    ]
                  },
                  "notes": {
                    "description": "Notes for the stop",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "circuitClientId": {
                    "description": "Client ID of the retailer in Spoke Connect",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "barcodes": {
                    "description": "List of barcode IDs associated with this stop",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "customProperties": {
                    "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                    "nullable": true,
                    "type": "object",
                    "additionalProperties": {
                      "description": "The value of the custom stop property, up to 255 characters.",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  }
                },
                "required": [
                  "address"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "The created stop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stopSchema",
                  "description": "The created stop"
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_inaccessible"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "The plan or driver was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The plan or driver was not found"
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is not writable"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_not_writable"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan is not writable"
                }
              }
            }
          },
          "410": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Failed to create stop. Some related resources were deleted while the request was being processed."
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occurred when creating the stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listStops",
        "summary": "List stops",
        "tags": [
          "Stops"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "pageToken",
            "required": false,
            "description": "The page token, if any."
          },
          {
            "schema": {
              "default": 10,
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "in": "query",
            "name": "maxPageSize",
            "required": false,
            "description": "The max page size."
          },
          {
            "schema": {
              "type": "object",
              "properties": {
                "externalId": {
                  "description": "Filter by the `recipient.externalId` field, exact match",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              },
              "additionalProperties": false
            },
            "in": "query",
            "name": "filter",
            "required": false,
            "description": "The filter to apply to the list of stops. The filter params are passed like this: `?filter[externalId]=foo` or like this: `?filter.externalId=foo`"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stops": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/stopSchema"
                      }
                    },
                    "nextPageToken": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "stops",
                    "nextPageToken"
                  ],
                  "definitions": {
                    "stopSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "address": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "addressLineOne": {
                              "type": "string"
                            },
                            "addressLineTwo": {
                              "type": "string"
                            },
                            "latitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -90,
                                  "maximum": 90
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "longitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -180,
                                  "maximum": 180
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeTypes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "address",
                            "addressLineOne",
                            "addressLineTwo",
                            "latitude",
                            "longitude",
                            "placeId",
                            "placeTypes"
                          ],
                          "additionalProperties": false
                        },
                        "barcodes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "driverIdentifier": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDriversIdentifiers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedTravelDuration": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "estimatedTravelDistance": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "notes": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "packageCount": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "weight": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number",
                                  "minimum": 0
                                },
                                "unit": {
                                  "type": "string",
                                  "enum": [
                                    "kilogram",
                                    "pound",
                                    "metric-ton"
                                  ]
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "start",
                            "stop",
                            "end"
                          ]
                        },
                        "packageLabel": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "stopPosition": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "trackingLink": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "webAppLink": {
                          "type": "string"
                        },
                        "orderInfo": {
                          "type": "object",
                          "properties": {
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "sellerName": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerOrderId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerWebsite": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "products",
                            "sellerName",
                            "sellerOrderId",
                            "sellerWebsite"
                          ],
                          "additionalProperties": false
                        },
                        "placeInVehicle": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "x": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "left",
                                        "right"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "y": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "front",
                                        "back",
                                        "middle"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "z": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "floor",
                                        "shelf"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "x",
                                "y",
                                "z"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "phone": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "externalId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "email",
                            "phone",
                            "externalId"
                          ],
                          "additionalProperties": false
                        },
                        "activity": {
                          "default": "delivery",
                          "type": "string",
                          "enum": [
                            "delivery",
                            "pickup"
                          ]
                        },
                        "deliveryInfo": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "attempted": {
                                  "type": "boolean"
                                },
                                "attemptedAt": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "attemptedLocation": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "latitude": {
                                          "type": "number"
                                        },
                                        "longitude": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "latitude",
                                        "longitude"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "driverProvidedInternalNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "driverProvidedRecipientNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "photoUrls": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "recipientProvidedNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "signatureUrl": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "signeeName": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "succeeded": {
                                  "type": "boolean"
                                },
                                "state": {
                                  "type": "string",
                                  "enum": [
                                    "delivered_to_recipient",
                                    "delivered_to_third_party",
                                    "delivered_to_mailbox",
                                    "delivered_to_safe_place",
                                    "delivered_to_pickup_point",
                                    "delivered_other",
                                    "picked_up_from_customer",
                                    "picked_up_unmanned",
                                    "picked_up_from_locker",
                                    "picked_up_other",
                                    "failed_not_home",
                                    "failed_cant_find_address",
                                    "failed_no_parking",
                                    "failed_no_time",
                                    "failed_package_not_available",
                                    "failed_other",
                                    "failed_missing_required_proof",
                                    "failed_payment_not_received",
                                    "unattempted"
                                  ]
                                }
                              },
                              "required": [
                                "attempted",
                                "attemptedAt",
                                "attemptedLocation",
                                "driverProvidedInternalNotes",
                                "driverProvidedRecipientNotes",
                                "photoUrls",
                                "recipientProvidedNotes",
                                "signatureUrl",
                                "signeeName",
                                "succeeded",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "paymentOnDelivery": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "proofOfAttemptRequirements": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "enabled"
                          ],
                          "additionalProperties": false
                        },
                        "plan": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "route": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^routes\\/[a-zA-Z0-9---_]{1,50}$"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "stopCount": {
                                  "type": "number"
                                },
                                "driver": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "state": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "completed": {
                                          "type": "boolean"
                                        },
                                        "completedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "distributed": {
                                          "type": "boolean"
                                        },
                                        "distributedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "notifiedRecipients": {
                                          "type": "boolean"
                                        },
                                        "notifiedRecipientsAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "started": {
                                          "type": "boolean"
                                        },
                                        "startedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "completed",
                                        "completedAt",
                                        "distributed",
                                        "distributedAt",
                                        "notifiedRecipients",
                                        "notifiedRecipientsAt",
                                        "started",
                                        "startedAt"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "plan": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "title",
                                "stopCount",
                                "driver",
                                "state",
                                "plan"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "eta": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "estimatedArrivalAt": {
                                  "type": "number"
                                },
                                "estimatedLatestArrivalAt": {
                                  "type": "number"
                                },
                                "estimatedEarliestArrivalAt": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "estimatedArrivalAt",
                                "estimatedLatestArrivalAt",
                                "estimatedEarliestArrivalAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "etaNullReason": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string",
                                  "enum": [
                                    "not_optimized",
                                    "subscription_not_supported"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "url": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "reason",
                                "message",
                                "url"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "timing": {
                          "type": "object",
                          "properties": {
                            "estimatedAttemptDuration": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "earliestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "latestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "estimatedAttemptDuration",
                            "earliestAttemptTime",
                            "latestAttemptTime"
                          ],
                          "additionalProperties": false
                        },
                        "optimizationOrder": {
                          "default": "default",
                          "type": "string",
                          "enum": [
                            "first",
                            "last",
                            "default"
                          ]
                        },
                        "customProperties": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "circuitClientId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "address",
                        "barcodes",
                        "driverIdentifier",
                        "allowedDriversIdentifiers",
                        "estimatedTravelDuration",
                        "estimatedTravelDistance",
                        "notes",
                        "packageCount",
                        "weight",
                        "type",
                        "packageLabel",
                        "stopPosition",
                        "trackingLink",
                        "webAppLink",
                        "orderInfo",
                        "placeInVehicle",
                        "recipient",
                        "deliveryInfo",
                        "paymentOnDelivery",
                        "proofOfAttemptRequirements",
                        "plan",
                        "route",
                        "eta",
                        "etaNullReason",
                        "timing",
                        "customProperties",
                        "circuitClientId"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Plan not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops:import": {
      "post": {
        "operationId": "importStops",
        "summary": "Batch import stops",
        "tags": [
          "Stops"
        ],
        "description": "Batch import stops. The request body must contain an array of stops to import. If the plan is not writable, the request will fail, prefer using the [Import Live Stops API](#tag/Live-Stops/operation/importLiveStops) instead.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "An array of stops to import in batch. Supports a maximum of 100 stops per request.",
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "object",
                      "properties": {
                        "addressName": {
                          "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "addressLineOne": {
                          "description": "The first line of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "addressLineTwo": {
                          "description": "The second line of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "city": {
                          "description": "The city of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "state": {
                          "description": "The state of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "zip": {
                          "description": "The zip code of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "country": {
                          "description": "The country of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "latitude": {
                          "description": "The latitude of the address in decimal degrees.",
                          "nullable": true,
                          "type": "number",
                          "minimum": -90,
                          "maximum": 90
                        },
                        "longitude": {
                          "description": "The longitude of the address in decimal degrees.",
                          "nullable": true,
                          "type": "number",
                          "minimum": -180,
                          "maximum": 180
                        }
                      },
                      "additionalProperties": false
                    },
                    "timing": {
                      "nullable": true,
                      "description": "Timing information for this stop",
                      "type": "object",
                      "properties": {
                        "earliestAttemptTime": {
                          "description": "Time of day of the earliest time this stop should happen",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "hour": {
                              "description": "Hour of the day",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "minute": {
                              "description": "Minute of the hour",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "hour",
                            "minute"
                          ],
                          "additionalProperties": false
                        },
                        "latestAttemptTime": {
                          "description": "Time of day of the latest time this stop should happen",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "hour": {
                              "description": "Hour of the day",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "minute": {
                              "description": "Minute of the hour",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "hour",
                            "minute"
                          ],
                          "additionalProperties": false
                        },
                        "estimatedAttemptDuration": {
                          "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                          "nullable": true,
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    "recipient": {
                      "nullable": true,
                      "description": "Recipient information for this stop",
                      "type": "object",
                      "properties": {
                        "externalId": {
                          "description": "External ID of the recipient, as defined by the API user",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "email": {
                          "description": "Email of the recipient",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "phone": {
                          "description": "Phone number of the recipient",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "name": {
                          "description": "Name of the recipient",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    },
                    "orderInfo": {
                      "nullable": true,
                      "description": "Order information for this stop",
                      "type": "object",
                      "properties": {
                        "products": {
                          "description": "Products in this stop",
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          }
                        },
                        "sellerOrderId": {
                          "description": "Seller order ID",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "sellerName": {
                          "description": "Seller name",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "sellerWebsite": {
                          "description": "Seller website",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    },
                    "paymentOnDelivery": {
                      "nullable": true,
                      "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                      "type": "object",
                      "properties": {
                        "amount": {
                          "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                          "nullable": true,
                          "type": "integer",
                          "exclusiveMinimum": true,
                          "maximum": 9007199254740991
                        },
                        "currency": {
                          "description": "Currency of the payment. Defaults to the team's currency.",
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "AED",
                            "ARS",
                            "AUD",
                            "BRL",
                            "CAD",
                            "CHF",
                            "CLP",
                            "CNY",
                            "COP",
                            "DKK",
                            "EGP",
                            "EUR",
                            "GBP",
                            "HKD",
                            "HUF",
                            "ILS",
                            "INR",
                            "JPY",
                            "KRW",
                            "MYR",
                            "MXN",
                            "NOK",
                            "NZD",
                            "PEN",
                            "RON",
                            "RUB",
                            "SAR",
                            "SEK",
                            "SGD",
                            "TRY",
                            "USD",
                            "UYU",
                            "ZAR"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "proofOfAttemptRequirements": {
                      "nullable": true,
                      "description": "Proof of attempt requirement settings for this stop",
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "description": "Whether proof of attempt is required for this stop",
                          "nullable": true,
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "driver": {
                      "description": "Deprecated. Prefer using the `allowedDrivers` field instead.\nDriver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `allowedDrivers` field.",
                      "nullable": true,
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    },
                    "allowedDrivers": {
                      "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `driver` field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.",
                      "nullable": true,
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "activity": {
                      "description": "Activity type",
                      "default": "delivery",
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "delivery",
                        "pickup"
                      ]
                    },
                    "optimizationOrder": {
                      "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "first",
                        "last",
                        "default"
                      ]
                    },
                    "packageCount": {
                      "description": "Number of packages in the stop",
                      "nullable": true,
                      "type": "number",
                      "minimum": 1,
                      "maximum": 10000
                    },
                    "weight": {
                      "description": "Weight information for this stop.",
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "amount": {
                          "description": "The weight amount for this stop.",
                          "type": "number",
                          "minimum": 0,
                          "maximum": 999999,
                          "multipleOf": 0.01
                        },
                        "unit": {
                          "description": "The weight unit in which the amount is specified.",
                          "type": "string",
                          "enum": [
                            "kilogram",
                            "pound",
                            "metric-ton"
                          ]
                        }
                      },
                      "required": [
                        "amount",
                        "unit"
                      ]
                    },
                    "notes": {
                      "description": "Notes for the stop",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000
                    },
                    "circuitClientId": {
                      "description": "Client ID of the retailer in Spoke Connect",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "barcodes": {
                      "description": "List of barcode IDs associated with this stop",
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "customProperties": {
                      "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": {
                        "description": "The value of the custom stop property, up to 255 characters.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    }
                  },
                  "required": [
                    "address"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "description": "An array of stops to import in batch. Supports a maximum of 100 stops per request."
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "error": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "message"
                            ]
                          },
                          "stop": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "object",
                                "properties": {
                                  "addressName": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLineOne": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLineTwo": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "state": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "zip": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "country": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "latitude": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "minimum": -90,
                                        "maximum": 90
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "longitude": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "minimum": -180,
                                        "maximum": 180
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "addressName",
                                  "addressLineOne",
                                  "addressLineTwo",
                                  "city",
                                  "state",
                                  "zip",
                                  "country",
                                  "latitude",
                                  "longitude"
                                ],
                                "additionalProperties": false
                              },
                              "recipient": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "externalId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "email": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "phone": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "name": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "externalId",
                                      "email",
                                      "phone",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "address",
                              "recipient"
                            ]
                          }
                        },
                        "required": [
                          "error",
                          "stop"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "failed"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The plan is no longer accessible or one or more stops contain fields that require upgrading your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_inaccessible"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The plan is no longer accessible or one or more stops contain fields that require upgrading your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "A plan or a driver was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "A plan or a driver was not found"
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is not writable"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_not_writable"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan is not writable"
                }
              }
            }
          },
          "410": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Failed to create stop. Some related resources were deleted while the request was being processed."
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occurred when creating the stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops/{stopId}": {
      "patch": {
        "operationId": "updateStop",
        "summary": "Update an existing stop",
        "tags": [
          "Stops"
        ],
        "description": "Does not support updating a stop's location, nor the `circuitClientId`. To do so, delete the stop and create a new one. If the plan is not writable, the request will fail, prefer using the [Update Live Stops API](#tag/Live-Stops/operation/updateLiveStop) instead.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipient": {
                    "nullable": true,
                    "description": "Recipient information for this stop",
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "description": "External ID of the recipient, as defined by the API user",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "email": {
                        "description": "Email of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "phone": {
                        "description": "Phone number of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "name": {
                        "description": "Name of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "orderInfo": {
                    "nullable": true,
                    "description": "Order information for this stop",
                    "type": "object",
                    "properties": {
                      "products": {
                        "description": "Products in this stop",
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "sellerOrderId": {
                        "description": "Seller order ID",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerName": {
                        "description": "Seller name",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerWebsite": {
                        "description": "Seller website",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "paymentOnDelivery": {
                    "nullable": true,
                    "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                        "nullable": true,
                        "type": "integer",
                        "exclusiveMinimum": true,
                        "maximum": 9007199254740991
                      },
                      "currency": {
                        "description": "Currency of the payment. Defaults to the team's currency.",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "AED",
                          "ARS",
                          "AUD",
                          "BRL",
                          "CAD",
                          "CHF",
                          "CLP",
                          "CNY",
                          "COP",
                          "DKK",
                          "EGP",
                          "EUR",
                          "GBP",
                          "HKD",
                          "HUF",
                          "ILS",
                          "INR",
                          "JPY",
                          "KRW",
                          "MYR",
                          "MXN",
                          "NOK",
                          "NZD",
                          "PEN",
                          "RON",
                          "RUB",
                          "SAR",
                          "SEK",
                          "SGD",
                          "TRY",
                          "USD",
                          "UYU",
                          "ZAR"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "proofOfAttemptRequirements": {
                    "nullable": true,
                    "description": "Proof of attempt requirement settings for this stop",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Whether proof of attempt is required for this stop",
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "driver": {
                    "description": "Deprecated. Prefer using the `allowedDrivers` field instead.\nDriver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `allowedDrivers` field.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                  },
                  "allowedDrivers": {
                    "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `driver` field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.",
                    "nullable": true,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "activity": {
                    "description": "Activity type",
                    "default": "delivery",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "delivery",
                      "pickup"
                    ]
                  },
                  "optimizationOrder": {
                    "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "first",
                      "last",
                      "default"
                    ]
                  },
                  "packageCount": {
                    "description": "Number of packages in the stop",
                    "nullable": true,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "weight": {
                    "description": "Weight information for this stop.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "The weight amount for this stop.",
                        "type": "number",
                        "minimum": 0,
                        "maximum": 999999,
                        "multipleOf": 0.01
                      },
                      "unit": {
                        "description": "The weight unit in which the amount is specified.",
                        "type": "string",
                        "enum": [
                          "kilogram",
                          "pound",
                          "metric-ton"
                        ]
                      }
                    },
                    "required": [
                      "amount",
                      "unit"
                    ]
                  },
                  "notes": {
                    "description": "Notes for the stop",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "barcodes": {
                    "description": "List of barcode IDs associated with this stop",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "customProperties": {
                    "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                    "nullable": true,
                    "type": "object",
                    "additionalProperties": {
                      "description": "The value of the custom stop property, up to 255 characters.",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "timing": {
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "earliestAttemptTime": {
                        "description": "Time of day of the earliest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "latestAttemptTime": {
                        "description": "Time of day of the latest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "estimatedAttemptDuration": {
                        "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "stopId",
            "required": true,
            "description": "The stop id"
          }
        ],
        "responses": {
          "200": {
            "description": "The updated stop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stopSchema",
                  "description": "The updated stop"
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_inaccessible"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is not writable"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_not_writable"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan is not writable"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getStop",
        "summary": "Retrieve a stop",
        "tags": [
          "Stops"
        ],
        "description": "Retrieve a stop",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "stopId",
            "required": true,
            "description": "The stop id"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested stop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stopSchema",
                  "description": "The requested stop"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteStop",
        "summary": "Delete a stop",
        "tags": [
          "Stops"
        ],
        "description": "Delete a stop. This action cannot be undone and will delete all the data associated with the stop. If the plan is not writable, this will fail, prefer using the [Live Delete Stop API](#tag/Live-Stops/operation/deleteLiveStop) instead.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "stopId",
            "required": true,
            "description": "The stop id"
          }
        ],
        "responses": {
          "204": {
            "description": "Stop deleted successfully"
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is not writable"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_not_writable"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan is not writable"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops:liveCreate": {
      "post": {
        "operationId": "createLiveStop",
        "summary": "Create a new stop",
        "tags": [
          "Live Stops"
        ],
        "description": "Create a new stop with the given data on live plans. When the plan is not writable, this endpoint starts an editing session and the action can be applied through a new optimization, or be discarded. Prefer using the [batch import endpoint](#tag/Stops/operation/importLiveStops) if you want to create multiple stops at once as it is more efficient and will produce better geocoding results.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "object",
                    "properties": {
                      "addressName": {
                        "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "addressLineOne": {
                        "description": "The first line of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "addressLineTwo": {
                        "description": "The second line of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "city": {
                        "description": "The city of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "state": {
                        "description": "The state of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "zip": {
                        "description": "The zip code of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "country": {
                        "description": "The country of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "latitude": {
                        "description": "The latitude of the address in decimal degrees.",
                        "nullable": true,
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "longitude": {
                        "description": "The longitude of the address in decimal degrees.",
                        "nullable": true,
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "additionalProperties": false
                  },
                  "timing": {
                    "nullable": true,
                    "description": "Timing information for this stop",
                    "type": "object",
                    "properties": {
                      "earliestAttemptTime": {
                        "description": "Time of day of the earliest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "latestAttemptTime": {
                        "description": "Time of day of the latest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "estimatedAttemptDuration": {
                        "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  },
                  "recipient": {
                    "nullable": true,
                    "description": "Recipient information for this stop",
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "description": "External ID of the recipient, as defined by the API user",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "email": {
                        "description": "Email of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "phone": {
                        "description": "Phone number of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "name": {
                        "description": "Name of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "orderInfo": {
                    "nullable": true,
                    "description": "Order information for this stop",
                    "type": "object",
                    "properties": {
                      "products": {
                        "description": "Products in this stop",
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "sellerOrderId": {
                        "description": "Seller order ID",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerName": {
                        "description": "Seller name",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerWebsite": {
                        "description": "Seller website",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "paymentOnDelivery": {
                    "nullable": true,
                    "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                        "nullable": true,
                        "type": "integer",
                        "exclusiveMinimum": true,
                        "maximum": 9007199254740991
                      },
                      "currency": {
                        "description": "Currency of the payment. Defaults to the team's currency.",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "AED",
                          "ARS",
                          "AUD",
                          "BRL",
                          "CAD",
                          "CHF",
                          "CLP",
                          "CNY",
                          "COP",
                          "DKK",
                          "EGP",
                          "EUR",
                          "GBP",
                          "HKD",
                          "HUF",
                          "ILS",
                          "INR",
                          "JPY",
                          "KRW",
                          "MYR",
                          "MXN",
                          "NOK",
                          "NZD",
                          "PEN",
                          "RON",
                          "RUB",
                          "SAR",
                          "SEK",
                          "SGD",
                          "TRY",
                          "USD",
                          "UYU",
                          "ZAR"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "proofOfAttemptRequirements": {
                    "nullable": true,
                    "description": "Proof of attempt requirement settings for this stop",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Whether proof of attempt is required for this stop",
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "driver": {
                    "description": "Deprecated. Prefer using the `allowedDrivers` field instead.\nDriver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `allowedDrivers` field.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                  },
                  "allowedDrivers": {
                    "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `driver` field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.",
                    "nullable": true,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "activity": {
                    "description": "Activity type",
                    "default": "delivery",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "delivery",
                      "pickup"
                    ]
                  },
                  "optimizationOrder": {
                    "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "first",
                      "last",
                      "default"
                    ]
                  },
                  "packageCount": {
                    "description": "Number of packages in the stop",
                    "nullable": true,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "weight": {
                    "description": "Weight information for this stop.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "The weight amount for this stop.",
                        "type": "number",
                        "minimum": 0,
                        "maximum": 999999,
                        "multipleOf": 0.01
                      },
                      "unit": {
                        "description": "The weight unit in which the amount is specified.",
                        "type": "string",
                        "enum": [
                          "kilogram",
                          "pound",
                          "metric-ton"
                        ]
                      }
                    },
                    "required": [
                      "amount",
                      "unit"
                    ]
                  },
                  "notes": {
                    "description": "Notes for the stop",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "circuitClientId": {
                    "description": "Client ID of the retailer in Spoke Connect",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "barcodes": {
                    "description": "List of barcode IDs associated with this stop",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "customProperties": {
                    "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                    "nullable": true,
                    "type": "object",
                    "additionalProperties": {
                      "description": "The value of the custom stop property, up to 255 characters.",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  }
                },
                "required": [
                  "address"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pending": {
                      "type": "boolean"
                    },
                    "stop": {
                      "$ref": "#/components/schemas/stopSchema"
                    }
                  },
                  "required": [
                    "pending",
                    "stop"
                  ],
                  "definitions": {
                    "stopSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "address": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "addressLineOne": {
                              "type": "string"
                            },
                            "addressLineTwo": {
                              "type": "string"
                            },
                            "latitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -90,
                                  "maximum": 90
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "longitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -180,
                                  "maximum": 180
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeTypes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "address",
                            "addressLineOne",
                            "addressLineTwo",
                            "latitude",
                            "longitude",
                            "placeId",
                            "placeTypes"
                          ],
                          "additionalProperties": false
                        },
                        "barcodes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "driverIdentifier": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDriversIdentifiers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedTravelDuration": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "estimatedTravelDistance": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "notes": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "packageCount": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "weight": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number",
                                  "minimum": 0
                                },
                                "unit": {
                                  "type": "string",
                                  "enum": [
                                    "kilogram",
                                    "pound",
                                    "metric-ton"
                                  ]
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "start",
                            "stop",
                            "end"
                          ]
                        },
                        "packageLabel": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "stopPosition": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "trackingLink": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "webAppLink": {
                          "type": "string"
                        },
                        "orderInfo": {
                          "type": "object",
                          "properties": {
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "sellerName": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerOrderId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerWebsite": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "products",
                            "sellerName",
                            "sellerOrderId",
                            "sellerWebsite"
                          ],
                          "additionalProperties": false
                        },
                        "placeInVehicle": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "x": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "left",
                                        "right"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "y": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "front",
                                        "back",
                                        "middle"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "z": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "floor",
                                        "shelf"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "x",
                                "y",
                                "z"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "phone": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "externalId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "email",
                            "phone",
                            "externalId"
                          ],
                          "additionalProperties": false
                        },
                        "activity": {
                          "default": "delivery",
                          "type": "string",
                          "enum": [
                            "delivery",
                            "pickup"
                          ]
                        },
                        "deliveryInfo": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "attempted": {
                                  "type": "boolean"
                                },
                                "attemptedAt": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "attemptedLocation": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "latitude": {
                                          "type": "number"
                                        },
                                        "longitude": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "latitude",
                                        "longitude"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "driverProvidedInternalNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "driverProvidedRecipientNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "photoUrls": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "recipientProvidedNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "signatureUrl": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "signeeName": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "succeeded": {
                                  "type": "boolean"
                                },
                                "state": {
                                  "type": "string",
                                  "enum": [
                                    "delivered_to_recipient",
                                    "delivered_to_third_party",
                                    "delivered_to_mailbox",
                                    "delivered_to_safe_place",
                                    "delivered_to_pickup_point",
                                    "delivered_other",
                                    "picked_up_from_customer",
                                    "picked_up_unmanned",
                                    "picked_up_from_locker",
                                    "picked_up_other",
                                    "failed_not_home",
                                    "failed_cant_find_address",
                                    "failed_no_parking",
                                    "failed_no_time",
                                    "failed_package_not_available",
                                    "failed_other",
                                    "failed_missing_required_proof",
                                    "failed_payment_not_received",
                                    "unattempted"
                                  ]
                                }
                              },
                              "required": [
                                "attempted",
                                "attemptedAt",
                                "attemptedLocation",
                                "driverProvidedInternalNotes",
                                "driverProvidedRecipientNotes",
                                "photoUrls",
                                "recipientProvidedNotes",
                                "signatureUrl",
                                "signeeName",
                                "succeeded",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "paymentOnDelivery": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "proofOfAttemptRequirements": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "enabled"
                          ],
                          "additionalProperties": false
                        },
                        "plan": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "route": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^routes\\/[a-zA-Z0-9---_]{1,50}$"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "stopCount": {
                                  "type": "number"
                                },
                                "driver": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "state": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "completed": {
                                          "type": "boolean"
                                        },
                                        "completedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "distributed": {
                                          "type": "boolean"
                                        },
                                        "distributedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "notifiedRecipients": {
                                          "type": "boolean"
                                        },
                                        "notifiedRecipientsAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "started": {
                                          "type": "boolean"
                                        },
                                        "startedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "completed",
                                        "completedAt",
                                        "distributed",
                                        "distributedAt",
                                        "notifiedRecipients",
                                        "notifiedRecipientsAt",
                                        "started",
                                        "startedAt"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "plan": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "title",
                                "stopCount",
                                "driver",
                                "state",
                                "plan"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "eta": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "estimatedArrivalAt": {
                                  "type": "number"
                                },
                                "estimatedLatestArrivalAt": {
                                  "type": "number"
                                },
                                "estimatedEarliestArrivalAt": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "estimatedArrivalAt",
                                "estimatedLatestArrivalAt",
                                "estimatedEarliestArrivalAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "etaNullReason": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string",
                                  "enum": [
                                    "not_optimized",
                                    "subscription_not_supported"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "url": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "reason",
                                "message",
                                "url"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "timing": {
                          "type": "object",
                          "properties": {
                            "estimatedAttemptDuration": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "earliestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "latestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "estimatedAttemptDuration",
                            "earliestAttemptTime",
                            "latestAttemptTime"
                          ],
                          "additionalProperties": false
                        },
                        "optimizationOrder": {
                          "default": "default",
                          "type": "string",
                          "enum": [
                            "first",
                            "last",
                            "default"
                          ]
                        },
                        "customProperties": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "circuitClientId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "address",
                        "barcodes",
                        "driverIdentifier",
                        "allowedDriversIdentifiers",
                        "estimatedTravelDuration",
                        "estimatedTravelDistance",
                        "notes",
                        "packageCount",
                        "weight",
                        "type",
                        "packageLabel",
                        "stopPosition",
                        "trackingLink",
                        "webAppLink",
                        "orderInfo",
                        "placeInVehicle",
                        "recipient",
                        "deliveryInfo",
                        "paymentOnDelivery",
                        "proofOfAttemptRequirements",
                        "plan",
                        "route",
                        "eta",
                        "etaNullReason",
                        "timing",
                        "customProperties",
                        "circuitClientId"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_inaccessible"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "The plan or driver was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The plan or driver was not found"
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan optimization in progress"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_optimization_in_progress"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan optimization in progress"
                }
              }
            }
          },
          "410": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Failed to create stop. Some related resources were deleted while the request was being processed."
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occurred when creating the stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops/{stopId}:liveUpdate": {
      "post": {
        "operationId": "updateLiveStop",
        "summary": "Update an existing stop",
        "tags": [
          "Live Stops"
        ],
        "description": "Update a stop on live plans. When the plan is not writable, this endpoint starts an editing session and the action can be applied through a new optimization, or be discarded. It does not support updating a stop's location. To do so, delete the stop and create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipient": {
                    "nullable": true,
                    "description": "Recipient information for this stop",
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "description": "External ID of the recipient, as defined by the API user",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "email": {
                        "description": "Email of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "phone": {
                        "description": "Phone number of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "name": {
                        "description": "Name of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "orderInfo": {
                    "nullable": true,
                    "description": "Order information for this stop",
                    "type": "object",
                    "properties": {
                      "products": {
                        "description": "Products in this stop",
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "sellerOrderId": {
                        "description": "Seller order ID",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerName": {
                        "description": "Seller name",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerWebsite": {
                        "description": "Seller website",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "paymentOnDelivery": {
                    "nullable": true,
                    "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                        "nullable": true,
                        "type": "integer",
                        "exclusiveMinimum": true,
                        "maximum": 9007199254740991
                      },
                      "currency": {
                        "description": "Currency of the payment. Defaults to the team's currency.",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "AED",
                          "ARS",
                          "AUD",
                          "BRL",
                          "CAD",
                          "CHF",
                          "CLP",
                          "CNY",
                          "COP",
                          "DKK",
                          "EGP",
                          "EUR",
                          "GBP",
                          "HKD",
                          "HUF",
                          "ILS",
                          "INR",
                          "JPY",
                          "KRW",
                          "MYR",
                          "MXN",
                          "NOK",
                          "NZD",
                          "PEN",
                          "RON",
                          "RUB",
                          "SAR",
                          "SEK",
                          "SGD",
                          "TRY",
                          "USD",
                          "UYU",
                          "ZAR"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "proofOfAttemptRequirements": {
                    "nullable": true,
                    "description": "Proof of attempt requirement settings for this stop",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Whether proof of attempt is required for this stop",
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "driver": {
                    "description": "Deprecated. Prefer using the `allowedDrivers` field instead.\nDriver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `allowedDrivers` field.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                  },
                  "allowedDrivers": {
                    "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `driver` field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.",
                    "nullable": true,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "activity": {
                    "description": "Activity type",
                    "default": "delivery",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "delivery",
                      "pickup"
                    ]
                  },
                  "optimizationOrder": {
                    "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "first",
                      "last",
                      "default"
                    ]
                  },
                  "packageCount": {
                    "description": "Number of packages in the stop",
                    "nullable": true,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "weight": {
                    "description": "Weight information for this stop.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "The weight amount for this stop.",
                        "type": "number",
                        "minimum": 0,
                        "maximum": 999999,
                        "multipleOf": 0.01
                      },
                      "unit": {
                        "description": "The weight unit in which the amount is specified.",
                        "type": "string",
                        "enum": [
                          "kilogram",
                          "pound",
                          "metric-ton"
                        ]
                      }
                    },
                    "required": [
                      "amount",
                      "unit"
                    ]
                  },
                  "notes": {
                    "description": "Notes for the stop",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "barcodes": {
                    "description": "List of barcode IDs associated with this stop",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "customProperties": {
                    "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                    "nullable": true,
                    "type": "object",
                    "additionalProperties": {
                      "description": "The value of the custom stop property, up to 255 characters.",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "timing": {
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "earliestAttemptTime": {
                        "description": "Time of day of the earliest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "latestAttemptTime": {
                        "description": "Time of day of the latest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "estimatedAttemptDuration": {
                        "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "stopId",
            "required": true,
            "description": "The stop id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pending": {
                      "type": "boolean"
                    },
                    "stop": {
                      "$ref": "#/components/schemas/stopSchema"
                    }
                  },
                  "required": [
                    "pending",
                    "stop"
                  ],
                  "definitions": {
                    "stopSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "address": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "addressLineOne": {
                              "type": "string"
                            },
                            "addressLineTwo": {
                              "type": "string"
                            },
                            "latitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -90,
                                  "maximum": 90
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "longitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -180,
                                  "maximum": 180
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeTypes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "address",
                            "addressLineOne",
                            "addressLineTwo",
                            "latitude",
                            "longitude",
                            "placeId",
                            "placeTypes"
                          ],
                          "additionalProperties": false
                        },
                        "barcodes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "driverIdentifier": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDriversIdentifiers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedTravelDuration": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "estimatedTravelDistance": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "notes": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "packageCount": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "weight": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number",
                                  "minimum": 0
                                },
                                "unit": {
                                  "type": "string",
                                  "enum": [
                                    "kilogram",
                                    "pound",
                                    "metric-ton"
                                  ]
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "start",
                            "stop",
                            "end"
                          ]
                        },
                        "packageLabel": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "stopPosition": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "trackingLink": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "webAppLink": {
                          "type": "string"
                        },
                        "orderInfo": {
                          "type": "object",
                          "properties": {
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "sellerName": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerOrderId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerWebsite": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "products",
                            "sellerName",
                            "sellerOrderId",
                            "sellerWebsite"
                          ],
                          "additionalProperties": false
                        },
                        "placeInVehicle": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "x": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "left",
                                        "right"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "y": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "front",
                                        "back",
                                        "middle"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "z": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "floor",
                                        "shelf"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "x",
                                "y",
                                "z"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "phone": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "externalId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "email",
                            "phone",
                            "externalId"
                          ],
                          "additionalProperties": false
                        },
                        "activity": {
                          "default": "delivery",
                          "type": "string",
                          "enum": [
                            "delivery",
                            "pickup"
                          ]
                        },
                        "deliveryInfo": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "attempted": {
                                  "type": "boolean"
                                },
                                "attemptedAt": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "attemptedLocation": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "latitude": {
                                          "type": "number"
                                        },
                                        "longitude": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "latitude",
                                        "longitude"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "driverProvidedInternalNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "driverProvidedRecipientNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "photoUrls": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "recipientProvidedNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "signatureUrl": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "signeeName": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "succeeded": {
                                  "type": "boolean"
                                },
                                "state": {
                                  "type": "string",
                                  "enum": [
                                    "delivered_to_recipient",
                                    "delivered_to_third_party",
                                    "delivered_to_mailbox",
                                    "delivered_to_safe_place",
                                    "delivered_to_pickup_point",
                                    "delivered_other",
                                    "picked_up_from_customer",
                                    "picked_up_unmanned",
                                    "picked_up_from_locker",
                                    "picked_up_other",
                                    "failed_not_home",
                                    "failed_cant_find_address",
                                    "failed_no_parking",
                                    "failed_no_time",
                                    "failed_package_not_available",
                                    "failed_other",
                                    "failed_missing_required_proof",
                                    "failed_payment_not_received",
                                    "unattempted"
                                  ]
                                }
                              },
                              "required": [
                                "attempted",
                                "attemptedAt",
                                "attemptedLocation",
                                "driverProvidedInternalNotes",
                                "driverProvidedRecipientNotes",
                                "photoUrls",
                                "recipientProvidedNotes",
                                "signatureUrl",
                                "signeeName",
                                "succeeded",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "paymentOnDelivery": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "proofOfAttemptRequirements": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "enabled"
                          ],
                          "additionalProperties": false
                        },
                        "plan": {
                          "type": "string",
                          "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "route": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^routes\\/[a-zA-Z0-9---_]{1,50}$"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "stopCount": {
                                  "type": "number"
                                },
                                "driver": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "state": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "completed": {
                                          "type": "boolean"
                                        },
                                        "completedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "distributed": {
                                          "type": "boolean"
                                        },
                                        "distributedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "notifiedRecipients": {
                                          "type": "boolean"
                                        },
                                        "notifiedRecipientsAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "started": {
                                          "type": "boolean"
                                        },
                                        "startedAt": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "completed",
                                        "completedAt",
                                        "distributed",
                                        "distributedAt",
                                        "notifiedRecipients",
                                        "notifiedRecipientsAt",
                                        "started",
                                        "startedAt"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "plan": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "title",
                                "stopCount",
                                "driver",
                                "state",
                                "plan"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "eta": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "estimatedArrivalAt": {
                                  "type": "number"
                                },
                                "estimatedLatestArrivalAt": {
                                  "type": "number"
                                },
                                "estimatedEarliestArrivalAt": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "estimatedArrivalAt",
                                "estimatedLatestArrivalAt",
                                "estimatedEarliestArrivalAt"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "etaNullReason": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string",
                                  "enum": [
                                    "not_optimized",
                                    "subscription_not_supported"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "url": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "reason",
                                "message",
                                "url"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "timing": {
                          "type": "object",
                          "properties": {
                            "estimatedAttemptDuration": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "earliestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "latestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "estimatedAttemptDuration",
                            "earliestAttemptTime",
                            "latestAttemptTime"
                          ],
                          "additionalProperties": false
                        },
                        "optimizationOrder": {
                          "default": "default",
                          "type": "string",
                          "enum": [
                            "first",
                            "last",
                            "default"
                          ]
                        },
                        "customProperties": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "circuitClientId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "address",
                        "barcodes",
                        "driverIdentifier",
                        "allowedDriversIdentifiers",
                        "estimatedTravelDuration",
                        "estimatedTravelDistance",
                        "notes",
                        "packageCount",
                        "weight",
                        "type",
                        "packageLabel",
                        "stopPosition",
                        "trackingLink",
                        "webAppLink",
                        "orderInfo",
                        "placeInVehicle",
                        "recipient",
                        "deliveryInfo",
                        "paymentOnDelivery",
                        "proofOfAttemptRequirements",
                        "plan",
                        "route",
                        "eta",
                        "etaNullReason",
                        "timing",
                        "customProperties",
                        "circuitClientId"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_inaccessible"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The plan is no longer accessible or the stop contains fields that require upgrading your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan optimization in progress"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_optimization_in_progress"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan optimization in progress"
                }
              }
            }
          },
          "422": {
            "description": "The stop is unprocessable.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "Stop cannot be edited"
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "stop_not_editable"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "An error occurred when creating the stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      },
                      "required": [
                        "message"
                      ]
                    }
                  ],
                  "description": "The stop is unprocessable."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops:liveImport": {
      "post": {
        "operationId": "importLiveStops",
        "summary": "Batch import stops",
        "tags": [
          "Live Stops"
        ],
        "description": "Import stops to live plans. When the plan is not writable, this endpoint starts an editing session and the action can be applied through a new optimization, or be discarded.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "An array of stops to import in batch. Supports a maximum of 100 stops per request.",
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "object",
                      "properties": {
                        "addressName": {
                          "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "addressLineOne": {
                          "description": "The first line of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "addressLineTwo": {
                          "description": "The second line of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "city": {
                          "description": "The city of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "state": {
                          "description": "The state of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "zip": {
                          "description": "The zip code of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "country": {
                          "description": "The country of the address.",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "latitude": {
                          "description": "The latitude of the address in decimal degrees.",
                          "nullable": true,
                          "type": "number",
                          "minimum": -90,
                          "maximum": 90
                        },
                        "longitude": {
                          "description": "The longitude of the address in decimal degrees.",
                          "nullable": true,
                          "type": "number",
                          "minimum": -180,
                          "maximum": 180
                        }
                      },
                      "additionalProperties": false
                    },
                    "timing": {
                      "nullable": true,
                      "description": "Timing information for this stop",
                      "type": "object",
                      "properties": {
                        "earliestAttemptTime": {
                          "description": "Time of day of the earliest time this stop should happen",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "hour": {
                              "description": "Hour of the day",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "minute": {
                              "description": "Minute of the hour",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "hour",
                            "minute"
                          ],
                          "additionalProperties": false
                        },
                        "latestAttemptTime": {
                          "description": "Time of day of the latest time this stop should happen",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "hour": {
                              "description": "Hour of the day",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "minute": {
                              "description": "Minute of the hour",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "hour",
                            "minute"
                          ],
                          "additionalProperties": false
                        },
                        "estimatedAttemptDuration": {
                          "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                          "nullable": true,
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    "recipient": {
                      "nullable": true,
                      "description": "Recipient information for this stop",
                      "type": "object",
                      "properties": {
                        "externalId": {
                          "description": "External ID of the recipient, as defined by the API user",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "email": {
                          "description": "Email of the recipient",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "phone": {
                          "description": "Phone number of the recipient",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "name": {
                          "description": "Name of the recipient",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    },
                    "orderInfo": {
                      "nullable": true,
                      "description": "Order information for this stop",
                      "type": "object",
                      "properties": {
                        "products": {
                          "description": "Products in this stop",
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          }
                        },
                        "sellerOrderId": {
                          "description": "Seller order ID",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "sellerName": {
                          "description": "Seller name",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "sellerWebsite": {
                          "description": "Seller website",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    },
                    "paymentOnDelivery": {
                      "nullable": true,
                      "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                      "type": "object",
                      "properties": {
                        "amount": {
                          "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                          "nullable": true,
                          "type": "integer",
                          "exclusiveMinimum": true,
                          "maximum": 9007199254740991
                        },
                        "currency": {
                          "description": "Currency of the payment. Defaults to the team's currency.",
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "AED",
                            "ARS",
                            "AUD",
                            "BRL",
                            "CAD",
                            "CHF",
                            "CLP",
                            "CNY",
                            "COP",
                            "DKK",
                            "EGP",
                            "EUR",
                            "GBP",
                            "HKD",
                            "HUF",
                            "ILS",
                            "INR",
                            "JPY",
                            "KRW",
                            "MYR",
                            "MXN",
                            "NOK",
                            "NZD",
                            "PEN",
                            "RON",
                            "RUB",
                            "SAR",
                            "SEK",
                            "SGD",
                            "TRY",
                            "USD",
                            "UYU",
                            "ZAR"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "proofOfAttemptRequirements": {
                      "nullable": true,
                      "description": "Proof of attempt requirement settings for this stop",
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "description": "Whether proof of attempt is required for this stop",
                          "nullable": true,
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "driver": {
                      "description": "Deprecated. Prefer using the `allowedDrivers` field instead.\nDriver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `allowedDrivers` field.",
                      "nullable": true,
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    },
                    "allowedDrivers": {
                      "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the `driver` field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.",
                      "nullable": true,
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "activity": {
                      "description": "Activity type",
                      "default": "delivery",
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "delivery",
                        "pickup"
                      ]
                    },
                    "optimizationOrder": {
                      "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "first",
                        "last",
                        "default"
                      ]
                    },
                    "packageCount": {
                      "description": "Number of packages in the stop",
                      "nullable": true,
                      "type": "number",
                      "minimum": 1,
                      "maximum": 10000
                    },
                    "weight": {
                      "description": "Weight information for this stop.",
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "amount": {
                          "description": "The weight amount for this stop.",
                          "type": "number",
                          "minimum": 0,
                          "maximum": 999999,
                          "multipleOf": 0.01
                        },
                        "unit": {
                          "description": "The weight unit in which the amount is specified.",
                          "type": "string",
                          "enum": [
                            "kilogram",
                            "pound",
                            "metric-ton"
                          ]
                        }
                      },
                      "required": [
                        "amount",
                        "unit"
                      ]
                    },
                    "notes": {
                      "description": "Notes for the stop",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000
                    },
                    "circuitClientId": {
                      "description": "Client ID of the retailer in Spoke Connect",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "barcodes": {
                      "description": "List of barcode IDs associated with this stop",
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "customProperties": {
                      "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": {
                        "description": "The value of the custom stop property, up to 255 characters.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    }
                  },
                  "required": [
                    "address"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "description": "An array of stops to import in batch. Supports a maximum of 100 stops per request."
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "error": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "message"
                            ]
                          },
                          "stop": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "object",
                                "properties": {
                                  "addressName": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLineOne": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLineTwo": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "state": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "zip": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "country": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "latitude": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "minimum": -90,
                                        "maximum": 90
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "longitude": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "minimum": -180,
                                        "maximum": 180
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "addressName",
                                  "addressLineOne",
                                  "addressLineTwo",
                                  "city",
                                  "state",
                                  "zip",
                                  "country",
                                  "latitude",
                                  "longitude"
                                ],
                                "additionalProperties": false
                              },
                              "recipient": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "externalId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "email": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "phone": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "name": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "externalId",
                                      "email",
                                      "phone",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "address",
                              "recipient"
                            ]
                          }
                        },
                        "required": [
                          "error",
                          "stop"
                        ]
                      }
                    },
                    "pending": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "failed",
                    "pending"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The plan is no longer accessible or one or more stops contain fields that require upgrading your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "enum": [
                            "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                          ]
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "plan_inaccessible"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The plan is no longer accessible or one or more stops contain fields that require upgrading your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "A plan or a driver was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "A plan or a driver was not found"
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan optimization in progress"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_optimization_in_progress"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan optimization in progress"
                }
              }
            }
          },
          "410": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Failed to create stop. Some related resources were deleted while the request was being processed."
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occurred when creating the stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/stops/{stopId}:liveDelete": {
      "post": {
        "operationId": "deleteLiveStop",
        "summary": "Delete a stop",
        "tags": [
          "Live Stops"
        ],
        "description": "Delete a stop on live plans. When the plan is not writable, this endpoint starts an editing session and the action can be applied through a new optimization, or be discarded.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "planId",
            "required": true,
            "description": "The plan id"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "stopId",
            "required": true,
            "description": "The stop id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pending": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "pending"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan is no longer accessible due to data access restrictions. Upgrade to a plan that supports a longer delivery history period to access it."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_inaccessible"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Plan optimization in progress"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "plan_optimization_in_progress"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "title": "Plan optimization in progress"
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "Stop cannot be removed because it is already complete"
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/drivers": {
      "get": {
        "operationId": "listDrivers",
        "summary": "List Drivers",
        "tags": [
          "Drivers"
        ],
        "parameters": [
          {
            "schema": {
              "default": 50,
              "type": "number",
              "minimum": 1,
              "maximum": 50
            },
            "in": "query",
            "name": "maxPageSize",
            "required": false,
            "description": "The maximum number of drivers to return."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "pageToken",
            "required": false,
            "description": "The page token to continue from."
          },
          {
            "schema": {
              "type": "object",
              "properties": {
                "active": {
                  "description": "Filter by the active status of the driver. Inactive drivers will not be assigned to any routes.",
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              },
              "additionalProperties": false
            },
            "in": "query",
            "name": "filter",
            "required": false,
            "description": "The filter to apply to the list of drivers. The filter param is passed like this: `?filter[active]=true` or like this: `?filter.active=true`"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drivers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/driverSchema"
                      }
                    },
                    "nextPageToken": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "drivers",
                    "nextPageToken"
                  ],
                  "definitions": {
                    "driverSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "displayName": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "depots": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                          }
                        },
                        "routeOverrides": {
                          "type": "object",
                          "properties": {
                            "startTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "endTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "startAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "address": {
                                      "type": "string"
                                    },
                                    "addressLineOne": {
                                      "type": "string"
                                    },
                                    "addressLineTwo": {
                                      "type": "string"
                                    },
                                    "latitude": {
                                      "anyOf": [
                                        {
                                          "type": "number",
                                          "minimum": -90,
                                          "maximum": 90
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "longitude": {
                                      "anyOf": [
                                        {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "placeId": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "placeTypes": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "address",
                                    "addressLineOne",
                                    "addressLineTwo",
                                    "latitude",
                                    "longitude",
                                    "placeId",
                                    "placeTypes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "endAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "address": {
                                      "type": "string"
                                    },
                                    "addressLineOne": {
                                      "type": "string"
                                    },
                                    "addressLineTwo": {
                                      "type": "string"
                                    },
                                    "latitude": {
                                      "anyOf": [
                                        {
                                          "type": "number",
                                          "minimum": -90,
                                          "maximum": 90
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "longitude": {
                                      "anyOf": [
                                        {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "placeId": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "placeTypes": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "address",
                                    "addressLineOne",
                                    "addressLineTwo",
                                    "latitude",
                                    "longitude",
                                    "placeId",
                                    "placeTypes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "maxStops": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "drivingSpeed": {
                              "type": "string",
                              "enum": [
                                "slower",
                                "average",
                                "faster"
                              ]
                            },
                            "deliverySpeed": {
                              "type": "string",
                              "enum": [
                                "slower",
                                "average",
                                "faster"
                              ]
                            },
                            "vehicleType": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "bike",
                                    "scooter",
                                    "car",
                                    "small_truck",
                                    "truck",
                                    "electric_cargo_bike"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "startTime",
                            "endTime",
                            "startAddress",
                            "endAddress",
                            "maxStops",
                            "drivingSpeed",
                            "deliverySpeed",
                            "vehicleType"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "phone",
                        "displayName",
                        "active",
                        "depots",
                        "routeOverrides"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createDriver",
        "summary": "Create a new driver",
        "tags": [
          "Drivers"
        ],
        "description": "Create a driver with the given data in your team. Prefer using the [batch import endpoint](#operation/importDrivers) for creating multiple drivers at once as it is more efficient, faster.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The driver's full name",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "displayName": {
                    "description": "The name displayed for the driver in the UI",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "email": {
                    "description": "Driver's email",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "format": "email",
                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "phone": {
                    "description": "Driver's phone number",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "depots": {
                    "description": "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.",
                    "nullable": true,
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "description": "The depot ID, in the format `depots/<id>`",
                      "type": "string",
                      "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "routeOverrides": {
                    "description": "Overrides for the driver route behavior.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "startAddress": {
                        "description": "Address of a start location for every route assigned to this driver. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "addressName": {
                            "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineOne": {
                            "description": "The first line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineTwo": {
                            "description": "The second line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "city": {
                            "description": "The city of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "state": {
                            "description": "The state of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "zip": {
                            "description": "The zip code of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "country": {
                            "description": "The country of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "latitude": {
                            "description": "The latitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -90,
                            "maximum": 90
                          },
                          "longitude": {
                            "description": "The longitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -180,
                            "maximum": 180
                          }
                        },
                        "additionalProperties": false
                      },
                      "endAddress": {
                        "description": "Address of an end location for every route assigned to this driver. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "addressName": {
                            "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineOne": {
                            "description": "The first line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineTwo": {
                            "description": "The second line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "city": {
                            "description": "The city of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "state": {
                            "description": "The state of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "zip": {
                            "description": "The zip code of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "country": {
                            "description": "The country of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "latitude": {
                            "description": "The latitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -90,
                            "maximum": 90
                          },
                          "longitude": {
                            "description": "The longitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -180,
                            "maximum": 180
                          }
                        },
                        "additionalProperties": false
                      },
                      "startTime": {
                        "description": "The start time for the driver's work day.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "endTime": {
                        "description": "The end time for the driver's work day.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "maxStops": {
                        "description": "The maximum number of stops that can be allocated to this driver.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "drivingSpeed": {
                        "nullable": true,
                        "default": "average",
                        "description": "How fast this driver drives compared to the Team's average",
                        "type": "string",
                        "enum": [
                          "slower",
                          "average",
                          "faster"
                        ]
                      },
                      "deliverySpeed": {
                        "description": "How fast this driver delivers compared to the Team's average",
                        "nullable": true,
                        "default": "average",
                        "type": "string",
                        "enum": [
                          "slower",
                          "average",
                          "faster"
                        ]
                      },
                      "vehicleType": {
                        "description": "The type of vehicle used by this driver",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "bike",
                          "scooter",
                          "car",
                          "small_truck",
                          "truck",
                          "electric_cargo_bike"
                        ]
                      }
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created driver",
            "content": {
              "application/json": {
                "schema": {
                  "description": "The created driver",
                  "$ref": "#/components/schemas/driverSchema"
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occured when creating the driver, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/drivers/{driverId}": {
      "get": {
        "operationId": "getDriver",
        "summary": "Retrieve a driver",
        "tags": [
          "Drivers"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "driverId",
            "required": true,
            "description": "The driver id"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested driver",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/driverSchema",
                  "description": "The requested driver"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "Driver not found"
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Driver not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDriver",
        "summary": "Remove a driver",
        "tags": [
          "Drivers"
        ],
        "description": "Removes a driver from your team. If the driver also has dashboard access, the driver will only have their \"driver\" role revoked; thus not being listed among the team drivers, but will keep their dashboard access.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "driverId",
            "required": true,
            "description": "The driver id"
          }
        ],
        "responses": {
          "204": {
            "description": "Driver removed successfully"
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "Driver not found"
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Driver not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateDriver",
        "summary": "Update a driver",
        "tags": [
          "Drivers"
        ],
        "description": "Updates a driver from your team. The member must have the \"driver\" role.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The request body for updating a driver.",
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The driver's full name",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "displayName": {
                    "description": "The name displayed for the driver in the UI",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "depots": {
                    "description": "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.",
                    "nullable": true,
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "description": "The depot ID, in the format `depots/<id>`",
                      "type": "string",
                      "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "routeOverrides": {
                    "description": "Overrides for the driver route behavior.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "startAddress": {
                        "description": "Address of a start location for every route assigned to this driver. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "addressName": {
                            "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineOne": {
                            "description": "The first line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineTwo": {
                            "description": "The second line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "city": {
                            "description": "The city of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "state": {
                            "description": "The state of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "zip": {
                            "description": "The zip code of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "country": {
                            "description": "The country of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "latitude": {
                            "description": "The latitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -90,
                            "maximum": 90
                          },
                          "longitude": {
                            "description": "The longitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -180,
                            "maximum": 180
                          }
                        },
                        "additionalProperties": false
                      },
                      "endAddress": {
                        "description": "Address of an end location for every route assigned to this driver. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "addressName": {
                            "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineOne": {
                            "description": "The first line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "addressLineTwo": {
                            "description": "The second line of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "city": {
                            "description": "The city of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "state": {
                            "description": "The state of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "zip": {
                            "description": "The zip code of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "country": {
                            "description": "The country of the address.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "latitude": {
                            "description": "The latitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -90,
                            "maximum": 90
                          },
                          "longitude": {
                            "description": "The longitude of the address in decimal degrees.",
                            "nullable": true,
                            "type": "number",
                            "minimum": -180,
                            "maximum": 180
                          }
                        },
                        "additionalProperties": false
                      },
                      "startTime": {
                        "description": "The start time for the driver's work day.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "endTime": {
                        "description": "The end time for the driver's work day.",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "maxStops": {
                        "description": "The maximum number of stops that can be allocated to this driver.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "drivingSpeed": {
                        "nullable": true,
                        "default": "average",
                        "description": "How fast this driver drives compared to the Team's average",
                        "type": "string",
                        "enum": [
                          "slower",
                          "average",
                          "faster"
                        ]
                      },
                      "deliverySpeed": {
                        "description": "How fast this driver delivers compared to the Team's average",
                        "nullable": true,
                        "default": "average",
                        "type": "string",
                        "enum": [
                          "slower",
                          "average",
                          "faster"
                        ]
                      },
                      "vehicleType": {
                        "description": "The type of vehicle used by this driver",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "bike",
                          "scooter",
                          "car",
                          "small_truck",
                          "truck",
                          "electric_cargo_bike"
                        ]
                      }
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "description": "The request body for updating a driver."
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "driverId",
            "required": true,
            "description": "The driver id"
          }
        ],
        "responses": {
          "200": {
            "description": "The updated driver",
            "content": {
              "application/json": {
                "schema": {
                  "description": "The updated driver",
                  "$ref": "#/components/schemas/driverSchema"
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occured when updating the driver, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/drivers:import": {
      "post": {
        "operationId": "importDrivers",
        "summary": "Batch import drivers",
        "tags": [
          "Drivers"
        ],
        "description": "Creates multiple drivers in your team. The request body must contain an array of drivers to import.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "An array of driver descriptions to be created in batch.",
                "minItems": 1,
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "description": "The driver's full name",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    },
                    "displayName": {
                      "description": "The name displayed for the driver in the UI",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    },
                    "email": {
                      "description": "Driver's email",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255,
                      "format": "email",
                      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                    },
                    "phone": {
                      "description": "Driver's phone number",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    },
                    "depots": {
                      "description": "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.",
                      "nullable": true,
                      "minItems": 1,
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "description": "The depot ID, in the format `depots/<id>`",
                        "type": "string",
                        "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "routeOverrides": {
                      "description": "Overrides for the driver route behavior.",
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "startAddress": {
                          "description": "Address of a start location for every route assigned to this driver. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "addressName": {
                              "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "addressLineOne": {
                              "description": "The first line of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "addressLineTwo": {
                              "description": "The second line of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "city": {
                              "description": "The city of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "state": {
                              "description": "The state of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "zip": {
                              "description": "The zip code of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "country": {
                              "description": "The country of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "latitude": {
                              "description": "The latitude of the address in decimal degrees.",
                              "nullable": true,
                              "type": "number",
                              "minimum": -90,
                              "maximum": 90
                            },
                            "longitude": {
                              "description": "The longitude of the address in decimal degrees.",
                              "nullable": true,
                              "type": "number",
                              "minimum": -180,
                              "maximum": 180
                            }
                          },
                          "additionalProperties": false
                        },
                        "endAddress": {
                          "description": "Address of an end location for every route assigned to this driver. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "addressName": {
                              "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "addressLineOne": {
                              "description": "The first line of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "addressLineTwo": {
                              "description": "The second line of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "city": {
                              "description": "The city of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "state": {
                              "description": "The state of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "zip": {
                              "description": "The zip code of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "country": {
                              "description": "The country of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "latitude": {
                              "description": "The latitude of the address in decimal degrees.",
                              "nullable": true,
                              "type": "number",
                              "minimum": -90,
                              "maximum": 90
                            },
                            "longitude": {
                              "description": "The longitude of the address in decimal degrees.",
                              "nullable": true,
                              "type": "number",
                              "minimum": -180,
                              "maximum": 180
                            }
                          },
                          "additionalProperties": false
                        },
                        "startTime": {
                          "description": "The start time for the driver's work day.",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "hour": {
                              "description": "Hour of the day",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "minute": {
                              "description": "Minute of the hour",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "hour",
                            "minute"
                          ],
                          "additionalProperties": false
                        },
                        "endTime": {
                          "description": "The end time for the driver's work day.",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "hour": {
                              "description": "Hour of the day",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "minute": {
                              "description": "Minute of the hour",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "hour",
                            "minute"
                          ],
                          "additionalProperties": false
                        },
                        "maxStops": {
                          "description": "The maximum number of stops that can be allocated to this driver.",
                          "nullable": true,
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "drivingSpeed": {
                          "nullable": true,
                          "default": "average",
                          "description": "How fast this driver drives compared to the Team's average",
                          "type": "string",
                          "enum": [
                            "slower",
                            "average",
                            "faster"
                          ]
                        },
                        "deliverySpeed": {
                          "description": "How fast this driver delivers compared to the Team's average",
                          "nullable": true,
                          "default": "average",
                          "type": "string",
                          "enum": [
                            "slower",
                            "average",
                            "faster"
                          ]
                        },
                        "vehicleType": {
                          "description": "The type of vehicle used by this driver",
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "bike",
                            "scooter",
                            "car",
                            "small_truck",
                            "truck",
                            "electric_cargo_bike"
                          ]
                        }
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "description": "An array of driver descriptions to be created in batch."
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "error": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "message"
                            ]
                          },
                          "driver": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 255
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "displayName": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 255
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "email": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 255,
                                    "format": "email",
                                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "phone": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 255
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "depots": {
                                "anyOf": [
                                  {
                                    "minItems": 1,
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "routeOverrides": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "startAddress": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "addressName": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 255
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "addressLineOne": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 255
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "addressLineTwo": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 255
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "city": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "state": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "zip": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "country": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "latitude": {
                                                "anyOf": [
                                                  {
                                                    "type": "number",
                                                    "minimum": -90,
                                                    "maximum": 90
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "longitude": {
                                                "anyOf": [
                                                  {
                                                    "type": "number",
                                                    "minimum": -180,
                                                    "maximum": 180
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "endAddress": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "addressName": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 255
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "addressLineOne": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 255
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "addressLineTwo": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 255
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "city": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "state": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "zip": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "country": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "latitude": {
                                                "anyOf": [
                                                  {
                                                    "type": "number",
                                                    "minimum": -90,
                                                    "maximum": 90
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "longitude": {
                                                "anyOf": [
                                                  {
                                                    "type": "number",
                                                    "minimum": -180,
                                                    "maximum": 180
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "startTime": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "hour": {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              },
                                              "minute": {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "hour",
                                              "minute"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "endTime": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "hour": {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              },
                                              "minute": {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "hour",
                                              "minute"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "maxStops": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "drivingSpeed": {
                                        "anyOf": [
                                          {
                                            "default": "average",
                                            "type": "string",
                                            "enum": [
                                              "slower",
                                              "average",
                                              "faster"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "deliverySpeed": {
                                        "anyOf": [
                                          {
                                            "default": "average",
                                            "type": "string",
                                            "enum": [
                                              "slower",
                                              "average",
                                              "faster"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "vehicleType": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "enum": [
                                              "bike",
                                              "scooter",
                                              "car",
                                              "small_truck",
                                              "truck",
                                              "electric_cargo_bike"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          }
                        },
                        "required": [
                          "error",
                          "driver"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "failed"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occured when importing drivers, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/depots": {
      "get": {
        "operationId": "listDepots",
        "summary": "List Depots",
        "tags": [
          "Depots"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "pageToken",
            "required": false,
            "description": "The page token to continue from."
          },
          {
            "schema": {
              "default": 20,
              "type": "number",
              "minimum": 1,
              "maximum": 20
            },
            "in": "query",
            "name": "maxPageSize",
            "required": false,
            "description": "The maximum number of depots to return."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "depots": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/depotSchema"
                      }
                    },
                    "nextPageToken": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "depots",
                    "nextPageToken"
                  ],
                  "definitions": {
                    "depotSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/depots/{depotId}": {
      "get": {
        "operationId": "getDepot",
        "summary": "Retrieve a depot",
        "tags": [
          "Depots"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "depotId",
            "required": true,
            "description": "The depot id"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested depot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/depotSchema",
                  "description": "The requested depot"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Depot not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Depot not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/routes/{routeId}": {
      "get": {
        "operationId": "getRoute",
        "summary": "Retrieve a route",
        "tags": [
          "Routes"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "routeId",
            "required": true,
            "description": "The route id"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/routeSchema",
                  "description": "The requested route"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Route is no longer accessible due to data access restrictions."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "route_inaccessible"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Route not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/operations/{operationId}:cancel": {
      "post": {
        "operationId": "cancelOperation",
        "summary": "Cancel an operation",
        "tags": [
          "Operations"
        ],
        "description": "Cancel an operation that is not yet done.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "operationId",
            "required": true,
            "description": "The ID of the operation to cancel."
          }
        ],
        "responses": {
          "200": {
            "description": "The operation was canceled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationSchema",
                  "description": "The operation was canceled successfully"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "The operation was not found."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "operation_not_found"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "The operation cannot be canceled because it is already done."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "operation_already_done"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/operations/{operationId}": {
      "get": {
        "operationId": "getOperation",
        "summary": "Retrieve an operation",
        "tags": [
          "Operations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "operationId",
            "required": true,
            "description": "The ID of the operation to cancel."
          }
        ],
        "responses": {
          "200": {
            "description": "The requested operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationSchema",
                  "description": "The requested operation"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "The operation was not found."
                      ]
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "operation_not_found"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/operations": {
      "get": {
        "operationId": "listOperations",
        "summary": "List operations",
        "tags": [
          "Operations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "pageToken",
            "required": false,
            "description": "The page token to continue from."
          },
          {
            "schema": {
              "default": 20,
              "type": "number",
              "minimum": 1,
              "maximum": 20
            },
            "in": "query",
            "name": "maxPageSize",
            "required": false,
            "description": "The maximum number of operations to return per page."
          },
          {
            "schema": {
              "type": "object",
              "properties": {
                "done": {
                  "description": "Filter by whether the operation is done.",
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "true"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "false"
                      ]
                    }
                  ]
                },
                "type": {
                  "description": "The type of the operation. Use this to filter which operations to get when listing operations. If not specified, all operations are returned. If specified, only operations of the specified type are returned.",
                  "type": "string",
                  "enum": [
                    "plan_optimization"
                  ]
                }
              }
            },
            "in": "query",
            "name": "filter",
            "required": false,
            "description": "The filter to apply to the list of operations."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "operations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/operationSchema"
                      }
                    },
                    "nextPageToken": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "operations",
                    "nextPageToken"
                  ],
                  "definitions": {
                    "operationSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^operations\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "plan_optimization"
                          ]
                        },
                        "done": {
                          "type": "boolean"
                        },
                        "metadata": {
                          "type": "object",
                          "properties": {
                            "canceled": {
                              "type": "boolean"
                            },
                            "startedAt": {
                              "type": "number"
                            },
                            "finishedAt": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "startedBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "dispatcher"
                                  ]
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "api"
                                  ]
                                },
                                {
                                  "type": "string"
                                }
                              ]
                            },
                            "targetPlanId": {
                              "type": "string",
                              "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}$"
                            }
                          },
                          "required": [
                            "canceled",
                            "startedAt",
                            "finishedAt",
                            "startedBy",
                            "targetPlanId"
                          ]
                        },
                        "result": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "numOptimizedStops": {
                                      "type": "number"
                                    },
                                    "skippedStops": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^plans\\/[a-zA-Z0-9---_]{1,50}\\/stops\\/[a-zA-Z0-9---_]{1,50}$"
                                          },
                                          "reason": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "impossible_time_window"
                                                ]
                                              },
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "impossible_navigation"
                                                ]
                                              },
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "impossible_number_of_stops"
                                                ]
                                              },
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "impossible_order_of_stops"
                                                ]
                                              },
                                              {
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "reason"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "numOptimizedStops",
                                    "skippedStops"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message"
                                  ]
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "done",
                        "metadata",
                        "result"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/unassignedStops/{unassignedStopId}": {
      "get": {
        "operationId": "getUnassignedStop",
        "summary": "Retrieve an unassigned stop",
        "tags": [
          "Unassigned Stops"
        ],
        "description": "Retrieve an unassigned stop",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "unassignedStopId",
            "required": true,
            "description": "The unassigned stop id"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested unassigned stop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/unassignedStopSchema",
                  "description": "The requested unassigned stop"
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Unassigned stop not found"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteUnassignedStop",
        "summary": "Delete an unassigned stop",
        "tags": [
          "Unassigned Stops"
        ],
        "description": "Delete an unassigned stop. This action cannot be undone and will delete all the data associated with the unassigned stop.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "unassignedStopId",
            "required": true,
            "description": "The unassigned stop id"
          }
        ],
        "responses": {
          "204": {
            "description": "Unassigned Stop deleted successfully"
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateUnassignedStop",
        "summary": "Update an existing unassigned stop",
        "tags": [
          "Unassigned Stops"
        ],
        "description": "Does not support updating a unassigned stop's location, nor the `circuitClientId`. To do so, delete the unassignedStop and create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The request body for updating an unassigned stop. All the values present in the request will update the unassigned stop value. If you wish to update only certain fields, only set those and do not set the others. Any fields not set will not be updated.",
                "type": "object",
                "properties": {
                  "recipient": {
                    "nullable": true,
                    "description": "Recipient information for this stop",
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "description": "External ID of the recipient, as defined by the API user",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "email": {
                        "description": "Email of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "phone": {
                        "description": "Phone number of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "name": {
                        "description": "Name of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "orderInfo": {
                    "nullable": true,
                    "description": "Order information for this stop",
                    "type": "object",
                    "properties": {
                      "products": {
                        "description": "Products in this stop",
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "sellerOrderId": {
                        "description": "Seller order ID",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerName": {
                        "description": "Seller name",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerWebsite": {
                        "description": "Seller website",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "paymentOnDelivery": {
                    "nullable": true,
                    "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                        "nullable": true,
                        "type": "integer",
                        "exclusiveMinimum": true,
                        "maximum": 9007199254740991
                      },
                      "currency": {
                        "description": "Currency of the payment. Defaults to the team's currency.",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "AED",
                          "ARS",
                          "AUD",
                          "BRL",
                          "CAD",
                          "CHF",
                          "CLP",
                          "CNY",
                          "COP",
                          "DKK",
                          "EGP",
                          "EUR",
                          "GBP",
                          "HKD",
                          "HUF",
                          "ILS",
                          "INR",
                          "JPY",
                          "KRW",
                          "MYR",
                          "MXN",
                          "NOK",
                          "NZD",
                          "PEN",
                          "RON",
                          "RUB",
                          "SAR",
                          "SEK",
                          "SGD",
                          "TRY",
                          "USD",
                          "UYU",
                          "ZAR"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "proofOfAttemptRequirements": {
                    "nullable": true,
                    "description": "Proof of attempt requirement settings for this stop",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Whether proof of attempt is required for this stop",
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "allowedDrivers": {
                    "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization.",
                    "nullable": true,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "activity": {
                    "description": "Activity type",
                    "default": "delivery",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "delivery",
                      "pickup"
                    ]
                  },
                  "optimizationOrder": {
                    "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "first",
                      "last",
                      "default"
                    ]
                  },
                  "packageCount": {
                    "description": "Number of packages in the stop",
                    "nullable": true,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "weight": {
                    "description": "Weight information for this stop.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "The weight amount for this stop.",
                        "type": "number",
                        "minimum": 0,
                        "maximum": 999999,
                        "multipleOf": 0.01
                      },
                      "unit": {
                        "description": "The weight unit in which the amount is specified.",
                        "type": "string",
                        "enum": [
                          "kilogram",
                          "pound",
                          "metric-ton"
                        ]
                      }
                    },
                    "required": [
                      "amount",
                      "unit"
                    ]
                  },
                  "notes": {
                    "description": "Notes for the stop",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "barcodes": {
                    "description": "List of barcode IDs associated with this stop",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "customProperties": {
                    "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                    "nullable": true,
                    "type": "object",
                    "additionalProperties": {
                      "description": "The value of the custom stop property, up to 255 characters.",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "timing": {
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "earliestAttemptTime": {
                        "description": "Time of day of the earliest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "latestAttemptTime": {
                        "description": "Time of day of the latest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "estimatedAttemptDuration": {
                        "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  },
                  "depot": {
                    "description": "The Depot ID that this unassigned stop belongs to, in the format `depot/<id>`. If null, it will default to the team's main depot. If not provided, it will not be updated.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "description": "The request body for updating an unassigned stop. All the values present in the request will update the unassigned stop value. If you wish to update only certain fields, only set those and do not set the others. Any fields not set will not be updated."
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9---_]{1,50}$"
            },
            "in": "path",
            "name": "unassignedStopId",
            "required": true,
            "description": "The unassigned stop id"
          }
        ],
        "responses": {
          "200": {
            "description": "The updated unassigned stop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/unassignedStopSchema",
                  "description": "The updated unassigned stop"
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The request contains fields that are not supported by your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The request contains fields that are not supported by your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/unassignedStops": {
      "get": {
        "operationId": "listUnassignedStops",
        "summary": "List unassigned stops",
        "tags": [
          "Unassigned Stops"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "pageToken",
            "required": false,
            "description": "The page token to continue from."
          },
          {
            "schema": {
              "default": 20,
              "type": "number",
              "minimum": 1,
              "maximum": 20
            },
            "in": "query",
            "name": "maxPageSize",
            "required": false,
            "description": "The maximum number of unassigned stops to return per page."
          },
          {
            "schema": {
              "type": "object",
              "properties": {
                "externalId": {
                  "description": "Filter by the `recipient.externalId` field, exact match",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              }
            },
            "in": "query",
            "name": "filter",
            "required": false,
            "description": "The filter to apply to the list of unassigned stops."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "unassignedStops": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/unassignedStopSchema"
                      }
                    },
                    "nextPageToken": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "unassignedStops",
                    "nextPageToken"
                  ],
                  "definitions": {
                    "unassignedStopSchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^unassignedStops\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "depot": {
                          "type": "string",
                          "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                        },
                        "address": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "addressLineOne": {
                              "type": "string"
                            },
                            "addressLineTwo": {
                              "type": "string"
                            },
                            "latitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -90,
                                  "maximum": 90
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "longitude": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": -180,
                                  "maximum": 180
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "placeTypes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "address",
                            "addressLineOne",
                            "addressLineTwo",
                            "latitude",
                            "longitude",
                            "placeId",
                            "placeTypes"
                          ],
                          "additionalProperties": false
                        },
                        "barcodes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "allowedDriversIdentifiers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notes": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "packageCount": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "weight": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number",
                                  "minimum": 0
                                },
                                "unit": {
                                  "type": "string",
                                  "enum": [
                                    "kilogram",
                                    "pound",
                                    "metric-ton"
                                  ]
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "orderInfo": {
                          "type": "object",
                          "properties": {
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "sellerName": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerOrderId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sellerWebsite": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "products",
                            "sellerName",
                            "sellerOrderId",
                            "sellerWebsite"
                          ],
                          "additionalProperties": false
                        },
                        "recipient": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "phone": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "externalId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "email",
                            "phone",
                            "externalId"
                          ],
                          "additionalProperties": false
                        },
                        "activity": {
                          "default": "delivery",
                          "type": "string",
                          "enum": [
                            "delivery",
                            "pickup"
                          ]
                        },
                        "timing": {
                          "type": "object",
                          "properties": {
                            "estimatedAttemptDuration": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "earliestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "latestAttemptTime": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "hour": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "minute": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "hour",
                                    "minute"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "estimatedAttemptDuration",
                            "earliestAttemptTime",
                            "latestAttemptTime"
                          ],
                          "additionalProperties": false
                        },
                        "optimizationOrder": {
                          "default": "default",
                          "type": "string",
                          "enum": [
                            "first",
                            "last",
                            "default"
                          ]
                        },
                        "paymentOnDelivery": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "proofOfAttemptRequirements": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "enabled"
                          ],
                          "additionalProperties": false
                        },
                        "customProperties": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "circuitClientId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "depot",
                        "address",
                        "barcodes",
                        "allowedDriversIdentifiers",
                        "notes",
                        "packageCount",
                        "weight",
                        "orderInfo",
                        "recipient",
                        "timing",
                        "paymentOnDelivery",
                        "proofOfAttemptRequirements",
                        "customProperties",
                        "circuitClientId"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createUnassignedStop",
        "summary": "Create a new unassigned stop",
        "tags": [
          "Unassigned Stops"
        ],
        "description": "Create a new unassigned stop with the given data.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The request body for creating an unassigned stop. Address is a required field, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set (and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be. The depotId field is not required, but will default to the main depot of the team if not provided, be sure to provide it if you want to use a different depot.",
                "type": "object",
                "properties": {
                  "address": {
                    "type": "object",
                    "properties": {
                      "addressName": {
                        "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "addressLineOne": {
                        "description": "The first line of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "addressLineTwo": {
                        "description": "The second line of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "city": {
                        "description": "The city of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "state": {
                        "description": "The state of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "zip": {
                        "description": "The zip code of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "country": {
                        "description": "The country of the address.",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "latitude": {
                        "description": "The latitude of the address in decimal degrees.",
                        "nullable": true,
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "longitude": {
                        "description": "The longitude of the address in decimal degrees.",
                        "nullable": true,
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "additionalProperties": false
                  },
                  "depot": {
                    "description": "The Depot ID that this unassigned stop belongs to, in the format `depot/<id>`. If not provided, or null, it will default to the team's main depot.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                  },
                  "timing": {
                    "nullable": true,
                    "description": "Timing information for this stop",
                    "type": "object",
                    "properties": {
                      "earliestAttemptTime": {
                        "description": "Time of day of the earliest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "latestAttemptTime": {
                        "description": "Time of day of the latest time this stop should happen",
                        "nullable": true,
                        "type": "object",
                        "properties": {
                          "hour": {
                            "description": "Hour of the day",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minute": {
                            "description": "Minute of the hour",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "hour",
                          "minute"
                        ],
                        "additionalProperties": false
                      },
                      "estimatedAttemptDuration": {
                        "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                        "nullable": true,
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  },
                  "recipient": {
                    "nullable": true,
                    "description": "Recipient information for this stop",
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "description": "External ID of the recipient, as defined by the API user",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "email": {
                        "description": "Email of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "phone": {
                        "description": "Phone number of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "name": {
                        "description": "Name of the recipient",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "orderInfo": {
                    "nullable": true,
                    "description": "Order information for this stop",
                    "type": "object",
                    "properties": {
                      "products": {
                        "description": "Products in this stop",
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "sellerOrderId": {
                        "description": "Seller order ID",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerName": {
                        "description": "Seller name",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "sellerWebsite": {
                        "description": "Seller website",
                        "nullable": true,
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      }
                    },
                    "additionalProperties": false
                  },
                  "paymentOnDelivery": {
                    "nullable": true,
                    "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                        "nullable": true,
                        "type": "integer",
                        "exclusiveMinimum": true,
                        "maximum": 9007199254740991
                      },
                      "currency": {
                        "description": "Currency of the payment. Defaults to the team's currency.",
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "AED",
                          "ARS",
                          "AUD",
                          "BRL",
                          "CAD",
                          "CHF",
                          "CLP",
                          "CNY",
                          "COP",
                          "DKK",
                          "EGP",
                          "EUR",
                          "GBP",
                          "HKD",
                          "HUF",
                          "ILS",
                          "INR",
                          "JPY",
                          "KRW",
                          "MYR",
                          "MXN",
                          "NOK",
                          "NZD",
                          "PEN",
                          "RON",
                          "RUB",
                          "SAR",
                          "SEK",
                          "SGD",
                          "TRY",
                          "USD",
                          "UYU",
                          "ZAR"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "proofOfAttemptRequirements": {
                    "nullable": true,
                    "description": "Proof of attempt requirement settings for this stop",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Whether proof of attempt is required for this stop",
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "allowedDrivers": {
                    "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization.",
                    "nullable": true,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                    }
                  },
                  "activity": {
                    "description": "Activity type",
                    "default": "delivery",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "delivery",
                      "pickup"
                    ]
                  },
                  "optimizationOrder": {
                    "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                    "nullable": true,
                    "type": "string",
                    "enum": [
                      "first",
                      "last",
                      "default"
                    ]
                  },
                  "packageCount": {
                    "description": "Number of packages in the stop",
                    "nullable": true,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "weight": {
                    "description": "Weight information for this stop.",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "The weight amount for this stop.",
                        "type": "number",
                        "minimum": 0,
                        "maximum": 999999,
                        "multipleOf": 0.01
                      },
                      "unit": {
                        "description": "The weight unit in which the amount is specified.",
                        "type": "string",
                        "enum": [
                          "kilogram",
                          "pound",
                          "metric-ton"
                        ]
                      }
                    },
                    "required": [
                      "amount",
                      "unit"
                    ]
                  },
                  "notes": {
                    "description": "Notes for the stop",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "circuitClientId": {
                    "description": "Client ID of the retailer in Spoke Connect",
                    "nullable": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "barcodes": {
                    "description": "List of barcode IDs associated with this stop",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  },
                  "customProperties": {
                    "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                    "nullable": true,
                    "type": "object",
                    "additionalProperties": {
                      "description": "The value of the custom stop property, up to 255 characters.",
                      "nullable": true,
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  }
                },
                "required": [
                  "address"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true,
          "description": "The request body for creating an unassigned stop. Address is a required field, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set (and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be. The depotId field is not required, but will default to the main depot of the team if not provided, be sure to provide it if you want to use a different depot."
        },
        "responses": {
          "200": {
            "description": "The created unassignedStop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/unassignedStopSchema",
                  "description": "The created unassignedStop"
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The request contains fields that are not supported by your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The request contains fields that are not supported by your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "Driver not found"
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Driver not found"
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occurred when creating the unassigned stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/unassignedStops:import": {
      "post": {
        "operationId": "importUnassignedStops",
        "summary": "Batch import unassigned stops",
        "tags": [
          "Unassigned Stops"
        ],
        "description": "Batch import unassigned stops. The request body must contain an array of unassigned stops to import. Note that the `depot` is the same for all unassigned stops in a same request. This is because the depot is used as a biasing location for the unassigned stops, so that the geocoding results are more accurate for a same region.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "unassignedStops": {
                    "description": "An array of unassigned stops to import in batch. Supports a maximum of 100 unassigned stops per request. Note that the `depot` is shared across all unassigned stops in the request, and thus should not be provided for individual unassigned stops. That is because the `depot` location is used to bias the geocoding results of the stops.",
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "object",
                          "properties": {
                            "addressName": {
                              "description": "The name of the address. This will not be used for geocoding, and is only for the final address display purposes.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "addressLineOne": {
                              "description": "The first line of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "addressLineTwo": {
                              "description": "The second line of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "city": {
                              "description": "The city of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "state": {
                              "description": "The state of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "zip": {
                              "description": "The zip code of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "country": {
                              "description": "The country of the address.",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "latitude": {
                              "description": "The latitude of the address in decimal degrees.",
                              "nullable": true,
                              "type": "number",
                              "minimum": -90,
                              "maximum": 90
                            },
                            "longitude": {
                              "description": "The longitude of the address in decimal degrees.",
                              "nullable": true,
                              "type": "number",
                              "minimum": -180,
                              "maximum": 180
                            }
                          },
                          "additionalProperties": false
                        },
                        "timing": {
                          "nullable": true,
                          "description": "Timing information for this stop",
                          "type": "object",
                          "properties": {
                            "earliestAttemptTime": {
                              "description": "Time of day of the earliest time this stop should happen",
                              "nullable": true,
                              "type": "object",
                              "properties": {
                                "hour": {
                                  "description": "Hour of the day",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "minute": {
                                  "description": "Minute of the hour",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "hour",
                                "minute"
                              ],
                              "additionalProperties": false
                            },
                            "latestAttemptTime": {
                              "description": "Time of day of the latest time this stop should happen",
                              "nullable": true,
                              "type": "object",
                              "properties": {
                                "hour": {
                                  "description": "Hour of the day",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "minute": {
                                  "description": "Minute of the hour",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "hour",
                                "minute"
                              ],
                              "additionalProperties": false
                            },
                            "estimatedAttemptDuration": {
                              "description": "Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.",
                              "nullable": true,
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "additionalProperties": false
                        },
                        "recipient": {
                          "nullable": true,
                          "description": "Recipient information for this stop",
                          "type": "object",
                          "properties": {
                            "externalId": {
                              "description": "External ID of the recipient, as defined by the API user",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "email": {
                              "description": "Email of the recipient",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "phone": {
                              "description": "Phone number of the recipient",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "name": {
                              "description": "Name of the recipient",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            }
                          },
                          "additionalProperties": false
                        },
                        "orderInfo": {
                          "nullable": true,
                          "description": "Order information for this stop",
                          "type": "object",
                          "properties": {
                            "products": {
                              "description": "Products in this stop",
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 255
                              }
                            },
                            "sellerOrderId": {
                              "description": "Seller order ID",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "sellerName": {
                              "description": "Seller name",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "sellerWebsite": {
                              "description": "Seller website",
                              "nullable": true,
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            }
                          },
                          "additionalProperties": false
                        },
                        "paymentOnDelivery": {
                          "nullable": true,
                          "description": "Payment on delivery (also known as \"Cash on Delivery\") data for this stop",
                          "type": "object",
                          "properties": {
                            "amount": {
                              "description": "Amount *in minor units* (e.g. cents) to be collected upon delivery",
                              "nullable": true,
                              "type": "integer",
                              "exclusiveMinimum": true,
                              "maximum": 9007199254740991
                            },
                            "currency": {
                              "description": "Currency of the payment. Defaults to the team's currency.",
                              "nullable": true,
                              "type": "string",
                              "enum": [
                                "AED",
                                "ARS",
                                "AUD",
                                "BRL",
                                "CAD",
                                "CHF",
                                "CLP",
                                "CNY",
                                "COP",
                                "DKK",
                                "EGP",
                                "EUR",
                                "GBP",
                                "HKD",
                                "HUF",
                                "ILS",
                                "INR",
                                "JPY",
                                "KRW",
                                "MYR",
                                "MXN",
                                "NOK",
                                "NZD",
                                "PEN",
                                "RON",
                                "RUB",
                                "SAR",
                                "SEK",
                                "SGD",
                                "TRY",
                                "USD",
                                "UYU",
                                "ZAR"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "proofOfAttemptRequirements": {
                          "nullable": true,
                          "description": "Proof of attempt requirement settings for this stop",
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "description": "Whether proof of attempt is required for this stop",
                              "nullable": true,
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        },
                        "allowedDrivers": {
                          "description": "Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization.",
                          "nullable": true,
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^drivers\\/[a-zA-Z0-9---_]{1,50}$"
                          }
                        },
                        "activity": {
                          "description": "Activity type",
                          "default": "delivery",
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "delivery",
                            "pickup"
                          ]
                        },
                        "optimizationOrder": {
                          "description": "The preferred order of this stop in the optimized route. If not provided or `\"default\"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `\"first\"` or `\"last\"`.",
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "first",
                            "last",
                            "default"
                          ]
                        },
                        "packageCount": {
                          "description": "Number of packages in the stop",
                          "nullable": true,
                          "type": "number",
                          "minimum": 1,
                          "maximum": 10000
                        },
                        "weight": {
                          "description": "Weight information for this stop.",
                          "nullable": true,
                          "type": "object",
                          "properties": {
                            "amount": {
                              "description": "The weight amount for this stop.",
                              "type": "number",
                              "minimum": 0,
                              "maximum": 999999,
                              "multipleOf": 0.01
                            },
                            "unit": {
                              "description": "The weight unit in which the amount is specified.",
                              "type": "string",
                              "enum": [
                                "kilogram",
                                "pound",
                                "metric-ton"
                              ]
                            }
                          },
                          "required": [
                            "amount",
                            "unit"
                          ]
                        },
                        "notes": {
                          "description": "Notes for the stop",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "circuitClientId": {
                          "description": "Client ID of the retailer in Spoke Connect",
                          "nullable": true,
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "barcodes": {
                          "description": "List of barcode IDs associated with this stop",
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          }
                        },
                        "customProperties": {
                          "description": "Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.",
                          "nullable": true,
                          "type": "object",
                          "additionalProperties": {
                            "description": "The value of the custom stop property, up to 255 characters.",
                            "nullable": true,
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          }
                        }
                      },
                      "required": [
                        "address"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "depot": {
                    "description": "The Depot ID the unassigned stops in the batch belong to, in the format `depot/<id>`. This is used to bias the geocoding results of the unassigned stops, so every unassigned stop in the batch should belong to the same depot. If not provided, or null, it will default to the team's main depot.",
                    "nullable": true,
                    "type": "string",
                    "pattern": "^depots\\/[a-zA-Z0-9---_]{1,50}$"
                  }
                },
                "required": [
                  "unassignedStops"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^unassignedStops\\/[a-zA-Z0-9---_]{1,50}$"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "error": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "message"
                            ]
                          },
                          "unassignedStop": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "object",
                                "properties": {
                                  "addressName": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLineOne": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "addressLineTwo": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "state": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "zip": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "country": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 100
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "latitude": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "minimum": -90,
                                        "maximum": 90
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "longitude": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "minimum": -180,
                                        "maximum": 180
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "addressName",
                                  "addressLineOne",
                                  "addressLineTwo",
                                  "city",
                                  "state",
                                  "zip",
                                  "country",
                                  "latitude",
                                  "longitude"
                                ],
                                "additionalProperties": false
                              },
                              "recipient": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "externalId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "email": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "phone": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "name": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 255
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "externalId",
                                      "email",
                                      "phone",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "address",
                              "recipient"
                            ]
                          }
                        },
                        "required": [
                          "error",
                          "unassignedStop"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "failed"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request has errors. Either syntactic or semantic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "The request has errors. Either syntactic or semantic"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The request contains fields that are not supported by your team subscription/settings.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "feature_not_in_subscription"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/paywall"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "vehicle_capacity_disabled"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "enum": [
                            "https://dispatch.spoke.com/settings/team-profile"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code",
                        "url"
                      ]
                    }
                  ],
                  "description": "The request contains fields that are not supported by your team subscription/settings."
                }
              }
            }
          },
          "404": {
            "description": "A depot or a driver was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "A depot or a driver was not found"
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "An error occurred when creating the unassigned stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid."
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/team/customStopProperties/": {
      "get": {
        "operationId": "listCustomStopProperties",
        "summary": "List custom stop properties",
        "tags": [
          "Team"
        ],
        "description": "Returns a list of custom stop properties definitions.",
        "responses": {
          "200": {
            "description": "The set of custom stop properties.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customStopProperties": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/customStopPropertySchema"
                      }
                    }
                  },
                  "required": [
                    "customStopProperties"
                  ],
                  "definitions": {
                    "customStopPropertySchema": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "visibleToDrivers": {
                          "type": "boolean"
                        },
                        "visibleToRecipients": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "visibleToDrivers",
                        "visibleToRecipients"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "description": "The set of custom stop properties."
                }
              }
            }
          },
          "400": {
            "description": "Query parameters are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "description": "Query parameters are invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "feature_not_in_subscription"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/team/customStopProperties/{customStopPropertyId}": {
      "get": {
        "operationId": "getCustomStopProperty",
        "summary": "Retrieve a custom stop property",
        "tags": [
          "Team"
        ],
        "description": "Returns a custom stop property definition.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 50
            },
            "in": "path",
            "name": "customStopPropertyId",
            "required": true,
            "description": "The custom stop property id"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "visibleToDrivers": {
                      "type": "boolean"
                    },
                    "visibleToRecipients": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "visibleToDrivers",
                    "visibleToRecipients"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "ID format is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "The request is invalid",
                  "description": "ID format is invalid"
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "feature_not_in_subscription"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "enum": [
                        "https://dispatch.spoke.com/paywall"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "Custom stop property not found"
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "title": "Custom stop property not found"
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.getcircuit.com/public/v0.2b"
    }
  ],
  "security": [
    {
      "BasicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Plans",
      "description": "Endpoints to operate on [Plans](/docs/models/plan) resources.\n"
    },
    {
      "name": "Stops",
      "description": "Endpoints to operate on [Stop](/docs/models/stop) resources.\n\nFor any [Plans](/docs/models/plan) created before 2023-04-01 the stop\ncollections and all related operations will not be available.\n\nFor any operations here you will need a Plan ID beforehand. You can retrieve an\nexisting Plan by [listing your Plans](#tag/Plans/operation/listPlans) or you can\n[create a new one](#tag/Plans/operation/createPlan).\n"
    },
    {
      "name": "Unassigned Stops",
      "description": "Endpoints to operate on [Unassigned Stop](/docs/models/unassignedStop) resources.\n"
    },
    {
      "name": "Live Plans",
      "description": "Endpoints to operate on [Plans](/docs/models/plan) resources when it's pending re-optimization and re-distribution.\n\nYou must use these endpoints to apply the changes when any [Live Stops](#tag/Live-Stops) request returns `pending = true`.\n"
    },
    {
      "name": "Live Stops",
      "description": "Endpoints to operate on [Stop](/docs/models/stop) resources when the plan is already optimized and therefore not writable.\n\nAll the endpoints return the field `pending`. This field indicates whether the\nchange has been applied to the plan or if it's pending a new optimization and distribution. On `pending = true`,\nyou must use the [re-optimize](#tag/Live-Plans/operation/reoptimizePlan) and [re-distribute](#tag/Live-Plans/operation/redistributePlan)\nendpoints to apply the changes to the plan.\n"
    },
    {
      "name": "Drivers",
      "description": "Endpoints to operate on [Drivers](/docs/models/driver) resources.\n"
    },
    {
      "name": "Depots",
      "description": "Endpoints to operate on [Depots](/docs/models/depot) resources.\n\nThis resource is currently read-only on the API.\n"
    },
    {
      "name": "Routes",
      "description": "Endpoints to operate on [Routes](/docs/models/route) resources.\n\nThis resource is currently read-only on the API.\n"
    },
    {
      "name": "Operations",
      "description": "Endpoints to operate on [Operations](/docs/models/operation) resources.\n"
    },
    {
      "name": "Team",
      "description": "Endpoints to retrieve [Custom Stop Properties](docs/models/customStopProperty).\n"
    }
  ]
}
