{
  "openapi": "3.1.0",
  "info": {
    "title": "Delivery API",
    "version": "3.0.0",
    "description": "Create deliveries that a robot carries from a pickup to a dropoff, and follow them to the end."
  },
  "servers": [
    {
      "url": "https://api.remi.robot.com/api/v3"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Deliveries",
      "description": "Create, read, change and cancel deliveries."
    },
    {
      "name": "Loading",
      "description": "Open the bot door and confirm loads and hand-offs."
    },
    {
      "name": "Pickup-only",
      "description": "Milestones of orders the customer collects, with no bot."
    },
    {
      "name": "Kitchen availability",
      "description": "Whether a kitchen can take orders right now."
    },
    {
      "name": "Partner",
      "description": "Your partner account. Each API key has one, created once."
    },
    {
      "name": "Locations",
      "description": "The operating areas of your partner, and the paths our bots can drive in them."
    },
    {
      "name": "Points",
      "description": "Named coordinates inside a location, used as pickup and dropoff anchors."
    },
    {
      "name": "Bots",
      "description": "Status, live telemetry, camera and remote stops of your bots."
    }
  ],
  "paths": {
    "/delivery": {
      "get": {
        "operationId": "listDeliveries",
        "tags": [
          "Deliveries"
        ],
        "summary": "List deliveries",
        "description": "Newest first by default. Pass `pagination.next_cursor` as `cursor` to get the next page; it is null on the last page.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDeliveriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, for example `active` other than `true` or `false`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid query, for example `active` other than `true` or `false`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "createDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Create a delivery",
        "description": "Creates the delivery and returns it. REMI assigns a bot and starts it.\n\n- A point is a registered `id`, your `external_id`, or `lat` + `lng`.\n- `dropoff` is required for `standard` and not allowed for `pickup_only`.\n- Any error means no delivery exists, so retrying is safe.",
        "x-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeliveryRequest"
              },
              "example": {
                "name": "Order #4821",
                "external_id": "order-4821",
                "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                "pickup": {
                  "id": "V1StGXR8Z5jdHi6BmyT2q",
                  "contact": {
                    "name": "Ana",
                    "phone": "+573001234567"
                  }
                },
                "dropoff": {
                  "lat": 4.6602,
                  "lng": -74.0521,
                  "matching": {
                    "mode": "snap",
                    "radius": 25
                  }
                },
                "packages": [
                  {
                    "reference": "burger-pkg",
                    "station": "Burger Shop",
                    "items": [
                      {
                        "name": "Cheeseburger",
                        "quantity": 1
                      }
                    ]
                  }
                ],
                "options": {
                  "webhook_url": "https://example.com/hooks/remi"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                },
                "example": {
                  "data": {
                    "id": "ES-5867",
                    "name": "Order #4821",
                    "draft": false,
                    "mode": "standard",
                    "state": "pending",
                    "paused": false,
                    "bot": null,
                    "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "arriving": false,
                    "arriving_at": "2026-06-17T15:51:00.000Z",
                    "options": {
                      "bots": null,
                      "bot_tags": null,
                      "require_available_bot": false,
                      "webhook_url": "https://example.com/hooks/remi",
                      "webhook_headers": null,
                      "return_enabled": false,
                      "eta_updates": false
                    },
                    "external_id": "order-4821",
                    "pickup": {
                      "id": "V1StGXR8Z5jdHi6BmyT2q",
                      "name": "Downtown Store",
                      "lat": 4.6512,
                      "lng": -74.0689,
                      "azimuth": null,
                      "contact": {
                        "name": "Ana",
                        "phone": "+573001234567",
                        "email": null
                      },
                      "matching": null
                    },
                    "dropoff": {
                      "id": null,
                      "name": "dropoff",
                      "lat": 4.6602,
                      "lng": -74.0521,
                      "azimuth": null,
                      "contact": null,
                      "matching": {
                        "mode": "snap",
                        "radius": 25
                      }
                    },
                    "return_point": null,
                    "packages": [
                      {
                        "reference": "burger-pkg",
                        "items": [
                          {
                            "name": "Cheeseburger",
                            "quantity": 1,
                            "description": null,
                            "picture_url": null,
                            "metadata": null
                          }
                        ],
                        "dimensions": null,
                        "weight": null,
                        "metadata": null,
                        "station": "Burger Shop",
                        "loaded": false
                      }
                    ],
                    "deliver_by": null,
                    "created_at": "2026-06-17T15:42:00.000Z",
                    "metadata": null,
                    "event_type": null,
                    "estimates": {
                      "distance": 2980,
                      "duration": 2483000,
                      "pickup": {
                        "arrival_at": "2026-06-17T15:51:00.000Z",
                        "completion_at": "2026-06-17T15:54:00.000Z",
                        "source": "derived",
                        "unknown_reason": null
                      },
                      "dropoff": {
                        "arrival_at": "2026-06-17T16:12:00.000Z",
                        "completion_at": "2026-06-17T16:14:00.000Z",
                        "source": "derived",
                        "unknown_reason": null
                      },
                      "scheduled_at": null,
                      "target_completion_at": null
                    },
                    "tracker_url": "https://track.kiwibot.com/t/A1b2C3d4E5",
                    "scheduled": false,
                    "cancellation_reason": null,
                    "incomplete_reason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, an unresolvable point, or `require_available_bot` together with `deliver_by`.\n\n`INVALID_BOT`: The bot in `options.bots` does not exist for you.\n\n`PICKUP_ONLY_CONTACT_REQUIRED`: Pickup-only with tracking notifications but no pickup contact phone or email.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body, an unresolvable point, or `require_available_bot` together with `deliver_by`."
              },
              {
                "code": "INVALID_BOT",
                "when": "The bot in `options.bots` does not exist for you."
              },
              {
                "code": "PICKUP_ONLY_CONTACT_REQUIRED",
                "when": "Pickup-only with tracking notifications but no pickup contact phone or email."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "409": {
            "description": "`NO_AVAILABLE_BOT`: With `require_available_bot`: no bot is free.\n\n`BOT_UNAVAILABLE`: The pinned bot is not connected or not available.\n\n`BOT_BUSY`: The pinned bot is on another delivery.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "NO_AVAILABLE_BOT",
                "when": "With `require_available_bot`: no bot is free."
              },
              {
                "code": "BOT_UNAVAILABLE",
                "when": "The pinned bot is not connected or not available."
              },
              {
                "code": "BOT_BUSY",
                "when": "The pinned bot is on another delivery."
              }
            ]
          },
          "501": {
            "description": "More than one bot in `options.bots`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "More than one bot in `options.bots`."
              }
            ]
          }
        }
      }
    },
    "/delivery/eta": {
      "post": {
        "operationId": "estimateDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Estimate arrival times",
        "description": "Two modes:\n\n- `pickup` + `dropoff`: arrival of the nearest free bot, without creating anything. Travel time only.\n- `delivery_id`: the current estimate of an existing delivery, including load and unload time.",
        "x-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EstimateDeliveryRequest"
              },
              "example": {
                "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                "pickup": {
                  "lat": 4.6512,
                  "lng": -74.0689
                },
                "dropoff": {
                  "lat": 4.6602,
                  "lng": -74.0521
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Arrival times.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDeliveryResponse"
                },
                "example": {
                  "data": {
                    "bot_id": "4T001",
                    "pickup_eta": "2026-06-17T15:51:00.000Z",
                    "dropoff_eta": "2026-06-17T16:12:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Neither `delivery_id` nor both points, or points with no resolvable location.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Neither `delivery_id` nor both points, or points with no resolvable location."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.\n\nThe location is not yours.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              },
              {
                "when": "The location is not yours."
              }
            ]
          },
          "404": {
            "description": "No delivery with that `delivery_id`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with that `delivery_id`."
              }
            ]
          },
          "409": {
            "description": "`NO_AVAILABLE_BOT`: No connected, free bot with at least 20% battery.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "NO_AVAILABLE_BOT",
                "when": "No connected, free bot with at least 20% battery."
              }
            ]
          },
          "422": {
            "description": "No route between the points.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No route between the points."
              }
            ]
          }
        }
      }
    },
    "/delivery/points/availability": {
      "get": {
        "operationId": "listPointAvailability",
        "tags": [
          "Kitchen availability"
        ],
        "summary": "Check several kitchens",
        "description": "Send exactly one of `location_id` (every pickup point there) or `point_ids` (up to 100). Unknown ids come back with `reason: unknown_point`.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "point_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One entry per point.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPointAvailabilityResponse"
                },
                "example": {
                  "data": [
                    {
                      "point_id": "V1StGXR8Z5jdHi6BmyT2q",
                      "external_id": "kitchen-north",
                      "name": "North Kitchen",
                      "available": true,
                      "last_seen_at": "2026-06-17T15:40:00.000Z",
                      "reason": "ok"
                    },
                    {
                      "point_id": "9QzXcV5bNm1LkJhGfDsAp",
                      "external_id": "kitchen-south",
                      "name": "South Kitchen",
                      "available": false,
                      "reason": "no_session"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Both or neither filter, more than 100 ids, or `id_type` with `location_id`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Both or neither filter, more than 100 ids, or `id_type` with `location_id`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          }
        }
      }
    },
    "/delivery/points/{id}/availability": {
      "get": {
        "operationId": "getPointAvailability",
        "tags": [
          "Kitchen availability"
        ],
        "summary": "Check one kitchen",
        "description": "Whether the kitchen at this pickup point can take orders now: its tablet session is live. Fails closed: when unsure, `available` is false. Always 200 for a known caller.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Point id (ours, not `external_id`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The availability.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPointAvailabilityResponse"
                },
                "example": {
                  "data": {
                    "available": true,
                    "last_seen_at": "2026-06-17T15:40:00.000Z",
                    "reason": "ok"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`id_type` was sent. Use the batch endpoint to look up by `external_id`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "`id_type` was sent. Use the batch endpoint to look up by `external_id`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}": {
      "get": {
        "operationId": "getDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Get a delivery",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                },
                "example": {
                  "data": {
                    "id": "ES-5867",
                    "name": "Order #4821",
                    "draft": false,
                    "mode": "standard",
                    "state": "going_to_pickup",
                    "paused": false,
                    "bot": {
                      "id": "4T001",
                      "lat": 4.6498,
                      "lng": -74.0712,
                      "door_status": "closed",
                      "control": null
                    },
                    "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "arriving": false,
                    "arriving_at": "2026-06-17T15:51:00.000Z",
                    "options": {
                      "bots": null,
                      "bot_tags": null,
                      "require_available_bot": false,
                      "webhook_url": "https://example.com/hooks/remi",
                      "webhook_headers": null,
                      "return_enabled": false,
                      "eta_updates": false
                    },
                    "external_id": "order-4821",
                    "pickup": {
                      "id": "V1StGXR8Z5jdHi6BmyT2q",
                      "name": "Downtown Store",
                      "lat": 4.6512,
                      "lng": -74.0689,
                      "azimuth": null,
                      "contact": {
                        "name": "Ana",
                        "phone": "+573001234567",
                        "email": null
                      },
                      "matching": null
                    },
                    "dropoff": {
                      "id": null,
                      "name": "dropoff",
                      "lat": 4.6602,
                      "lng": -74.0521,
                      "azimuth": null,
                      "contact": null,
                      "matching": {
                        "mode": "snap",
                        "radius": 25
                      }
                    },
                    "return_point": null,
                    "packages": [
                      {
                        "reference": "burger-pkg",
                        "items": [
                          {
                            "name": "Cheeseburger",
                            "quantity": 1,
                            "description": null,
                            "picture_url": null,
                            "metadata": null
                          }
                        ],
                        "dimensions": null,
                        "weight": null,
                        "metadata": null,
                        "station": "Burger Shop",
                        "loaded": false
                      }
                    ],
                    "deliver_by": null,
                    "created_at": "2026-06-17T15:42:00.000Z",
                    "metadata": null,
                    "event_type": null,
                    "estimates": {
                      "distance": 2980,
                      "duration": 2483000,
                      "pickup": {
                        "arrival_at": "2026-06-17T15:51:00.000Z",
                        "completion_at": "2026-06-17T15:54:00.000Z",
                        "source": "derived",
                        "unknown_reason": null
                      },
                      "dropoff": {
                        "arrival_at": "2026-06-17T16:12:00.000Z",
                        "completion_at": "2026-06-17T16:14:00.000Z",
                        "source": "derived",
                        "unknown_reason": null
                      },
                      "scheduled_at": null,
                      "target_completion_at": null
                    },
                    "tracker_url": "https://track.kiwibot.com/t/A1b2C3d4E5",
                    "scheduled": false,
                    "cancellation_reason": null,
                    "incomplete_reason": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          }
        }
      },
      "patch": {
        "operationId": "updateDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Update a delivery",
        "description": "Supported today: change `external_id`, and publish a draft with `draft: false` (add `scheduled_at` to schedule it). Other fields answer 501.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeliveryRequest"
              },
              "example": {
                "draft": false,
                "scheduled_at": "2026-06-17T23:30:00.000Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "`draft: false` on a delivery that is not a draft, or a point that can no longer change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "`draft: false` on a delivery that is not a draft, or a point that can no longer change."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          },
          "501": {
            "description": "The field cannot be updated yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The field cannot be updated yet."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/route": {
      "get": {
        "operationId": "getDeliveryRoute",
        "tags": [
          "Deliveries"
        ],
        "summary": "Get the remaining route",
        "description": "The path the bot still has to drive, from its last position through the remaining stops. Before a bot starts, it begins at the pickup.\n\nPoll it: nothing is pushed when the bot reroutes. A result can be up to 10 seconds old (`computed_at`).",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDeliveryRouteResponse"
                },
                "example": {
                  "data": {
                    "source": "estimated",
                    "mapped": true,
                    "computed_at": "2026-06-17T15:48:10.000Z",
                    "position_recorded_at": "2026-06-17T15:48:08.000Z",
                    "distance": 2980,
                    "duration": 2483000,
                    "points": [
                      [
                        4.6498,
                        -74.0712
                      ],
                      [
                        4.6512,
                        -74.0689
                      ],
                      [
                        4.6577,
                        -74.0571
                      ],
                      [
                        4.6602,
                        -74.0521
                      ]
                    ],
                    "stops": [
                      {
                        "name": "pickup",
                        "lat": 4.6512,
                        "lng": -74.0689,
                        "point_index": 1
                      },
                      {
                        "name": "dropoff",
                        "lat": 4.6602,
                        "lng": -74.0521,
                        "point_index": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          },
          "409": {
            "description": "`PICKUP_ONLY_DELIVERY`: Pickup-only deliveries have no bot.\n\n`DELIVERY_FINALIZED`: The delivery is delivered, returned, canceled or failed.\n\n`BOT_POSITION_UNKNOWN`: No bot position from the last 30 minutes. Retry shortly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "PICKUP_ONLY_DELIVERY",
                "when": "Pickup-only deliveries have no bot."
              },
              {
                "code": "DELIVERY_FINALIZED",
                "when": "The delivery is delivered, returned, canceled or failed."
              },
              {
                "code": "BOT_POSITION_UNKNOWN",
                "when": "No bot position from the last 30 minutes. Retry shortly."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/cancel": {
      "post": {
        "operationId": "cancelDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Cancel a delivery",
        "description": "With a return configured and the order already loaded, the bot brings it back and the delivery ends `returned`. Pickup-only: stations already handed over stay handed over.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canceled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelDeliveryResponse"
                },
                "example": {
                  "success": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/pause": {
      "post": {
        "operationId": "pauseDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Pause a delivery",
        "description": "Stops the bot where it is and alerts our operations team. Not an emergency stop: for a physical emergency, call operations too. Pausing again is a no-op.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseDeliveryRequest"
              },
              "example": {
                "reason": "The robot is blocking a building entrance"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery, with `paused: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          },
          "409": {
            "description": "`DELIVERY_NOT_IN_PROGRESS`: Only a delivery in progress can be paused.\n\n`STOP_NOT_SUPPORTED`: This bot or delivery cannot be stopped through the API. Call operations.\n\n`OPERATOR_IN_CONTROL`: An operator is driving the bot. Call operations.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "DELIVERY_NOT_IN_PROGRESS",
                "when": "Only a delivery in progress can be paused."
              },
              {
                "code": "STOP_NOT_SUPPORTED",
                "when": "This bot or delivery cannot be stopped through the API. Call operations."
              },
              {
                "code": "OPERATOR_IN_CONTROL",
                "when": "An operator is driving the bot. Call operations."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/resume": {
      "post": {
        "operationId": "resumeDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Resume a delivery",
        "description": "Resumes a delivery you paused. A pause made by our operations team is theirs to resume.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseDeliveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery, with `paused: false`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "`RESUME_JOB_NO_BOT`: The delivery no longer has a bot. Call operations.\n\n`RESUME_JOB_INVALID_STATE`: The delivery changed at the same moment. Read it again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "RESUME_JOB_NO_BOT",
                "when": "The delivery no longer has a bot. Call operations."
              },
              {
                "code": "RESUME_JOB_INVALID_STATE",
                "when": "The delivery changed at the same moment. Read it again."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          },
          "409": {
            "description": "`DELIVERY_NOT_PAUSED`: The delivery is not paused.\n\n`PAUSED_BY_OPERATIONS`: Our operations team paused it.\n\n`OPERATOR_IN_CONTROL`: An operator is driving the bot. Call operations.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "DELIVERY_NOT_PAUSED",
                "when": "The delivery is not paused."
              },
              {
                "code": "PAUSED_BY_OPERATIONS",
                "when": "Our operations team paused it."
              },
              {
                "code": "OPERATOR_IN_CONTROL",
                "when": "An operator is driving the bot. Call operations."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/preparation/start": {
      "post": {
        "operationId": "startPreparation",
        "tags": [
          "Pickup-only"
        ],
        "summary": "Start preparation",
        "description": "Pickup-only. Moves the delivery to `preparing`. Repeating it is a no-op.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a pickup-only delivery.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Not a pickup-only delivery."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              }
            ]
          },
          "409": {
            "description": "`MILESTONE_OUT_OF_ORDER`: The delivery ended before this milestone.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "MILESTONE_OUT_OF_ORDER",
                "when": "The delivery ended before this milestone."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/preparation/finish": {
      "post": {
        "operationId": "finishPreparation",
        "tags": [
          "Pickup-only"
        ],
        "summary": "Finish preparation",
        "description": "Pickup-only. Marks the order, or one `station` or `package` of it, ready. With several stations, send one call per station; the delivery is `ready_for_pickup` when all are ready. Repeating it is a no-op.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinishPreparationRequest"
              },
              "example": {
                "station": "Burger Shop"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "`MILESTONE_TARGET_AMBIGUOUS`: Both `package` and `station` were sent.\n\n`MILESTONE_TARGET_REQUIRED`: The order has several stations or packages and no target was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "MILESTONE_TARGET_AMBIGUOUS",
                "when": "Both `package` and `station` were sent."
              },
              {
                "code": "MILESTONE_TARGET_REQUIRED",
                "when": "The order has several stations or packages and no target was sent."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).\n\n`MILESTONE_TARGET_NOT_FOUND`: Unknown `package` or `station`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              },
              {
                "code": "MILESTONE_TARGET_NOT_FOUND",
                "when": "Unknown `package` or `station`."
              }
            ]
          },
          "409": {
            "description": "`MILESTONE_OUT_OF_ORDER`: A previous milestone is missing, or the delivery ended without this one.\n\n`MILESTONE_TARGET_NOT_LOADABLE`: The target is paused, failed, skipped or canceled. Nothing changed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "MILESTONE_OUT_OF_ORDER",
                "when": "A previous milestone is missing, or the delivery ended without this one."
              },
              {
                "code": "MILESTONE_TARGET_NOT_LOADABLE",
                "when": "The target is paused, failed, skipped or canceled. Nothing changed."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/pickup/confirm": {
      "post": {
        "operationId": "confirmPickup",
        "tags": [
          "Pickup-only"
        ],
        "summary": "Confirm pickup",
        "description": "Pickup-only. The customer took the order, or one `station` or `package` of it. The delivery is `picked_up` when every station is. The customer can also confirm from the tracker page. Repeating it is a no-op.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinishPreparationRequest"
              },
              "example": {
                "station": "Burger Shop"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "`MILESTONE_TARGET_AMBIGUOUS`: Both `package` and `station` were sent.\n\n`MILESTONE_TARGET_REQUIRED`: The order has several stations or packages and no target was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "MILESTONE_TARGET_AMBIGUOUS",
                "when": "Both `package` and `station` were sent."
              },
              {
                "code": "MILESTONE_TARGET_REQUIRED",
                "when": "The order has several stations or packages and no target was sent."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery with this id in your namespace (by `external_id`: no active one).\n\n`MILESTONE_TARGET_NOT_FOUND`: Unknown `package` or `station`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery with this id in your namespace (by `external_id`: no active one)."
              },
              {
                "code": "MILESTONE_TARGET_NOT_FOUND",
                "when": "Unknown `package` or `station`."
              }
            ]
          },
          "409": {
            "description": "`MILESTONE_OUT_OF_ORDER`: A previous milestone is missing, or the delivery ended without this one.\n\n`MILESTONE_TARGET_NOT_LOADABLE`: The target is paused, failed, skipped or canceled. Nothing changed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "MILESTONE_OUT_OF_ORDER",
                "when": "A previous milestone is missing, or the delivery ended without this one."
              },
              {
                "code": "MILESTONE_TARGET_NOT_LOADABLE",
                "when": "The target is paused, failed, skipped or canceled. Nothing changed."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/load/start": {
      "post": {
        "operationId": "startLoad",
        "tags": [
          "Loading"
        ],
        "summary": "Open the door to load",
        "description": "At `at_pickup`: opens the bot door. The state does not change.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "The delivery is not `at_pickup`, or has no bot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The delivery is not `at_pickup`, or has no bot."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery in progress with this id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery in progress with this id."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/load/finish": {
      "post": {
        "operationId": "finishLoad",
        "tags": [
          "Loading"
        ],
        "summary": "Finish loading",
        "description": "Confirms the whole pickup is loaded: REMI closes the door and the delivery moves to `going_to_dropoff`. Takes no body. To finish one station or package, use the targeted route. On a bot whose lid a person closes (`manual_close_door`), this does nothing: the load completes when the lid closes.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "The delivery is not `at_pickup` (also when it already left), or has no bot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The delivery is not `at_pickup` (also when it already left), or has no bot."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery in progress with this id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery in progress with this id."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/load/finish/target": {
      "post": {
        "operationId": "finishLoadTarget",
        "tags": [
          "Loading"
        ],
        "summary": "Finish loading one station or package",
        "description": "Completes only the `package` or `station` you name. The bot leaves when every package is loaded. Repeating it is a no-op. On a 409, do not fall back to the untargeted finish: it would load everything.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinishLoadTargetRequest"
              },
              "example": {
                "station": "Burger Shop"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "The delivery is not `at_pickup`, or has no bot.\n\n`LOAD_TARGET_AMBIGUOUS`: Both `package` and `station` were sent.\n\n`LOAD_TARGET_REQUIRED`: No target, and the delivery has several load actions.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The delivery is not `at_pickup`, or has no bot."
              },
              {
                "code": "LOAD_TARGET_AMBIGUOUS",
                "when": "Both `package` and `station` were sent."
              },
              {
                "code": "LOAD_TARGET_REQUIRED",
                "when": "No target, and the delivery has several load actions."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery in progress with this id.\n\n`LOAD_TARGET_NOT_FOUND`: Unknown `package` or `station`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery in progress with this id."
              },
              {
                "code": "LOAD_TARGET_NOT_FOUND",
                "when": "Unknown `package` or `station`."
              }
            ]
          },
          "409": {
            "description": "`LOAD_TARGET_NOT_LOADABLE`: The target is paused, failed, skipped or canceled. Nothing changed.\n\n`LOAD_TARGET_NO_ACTIONS`: The target has nothing to load. Nothing changed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "LOAD_TARGET_NOT_LOADABLE",
                "when": "The target is paused, failed, skipped or canceled. Nothing changed."
              },
              {
                "code": "LOAD_TARGET_NO_ACTIONS",
                "when": "The target has nothing to load. Nothing changed."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/unload/start": {
      "post": {
        "operationId": "startUnload",
        "tags": [
          "Loading"
        ],
        "summary": "Open the door to unload",
        "description": "At `at_dropoff`: opens the bot door. The state does not change.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "The delivery is not `at_dropoff`, or has no bot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The delivery is not `at_dropoff`, or has no bot."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery in progress with this id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery in progress with this id."
              }
            ]
          }
        }
      }
    },
    "/delivery/{id}/unload/finish": {
      "post": {
        "operationId": "finishUnload",
        "tags": [
          "Loading"
        ],
        "summary": "Finish unloading",
        "description": "Confirms the hand-off: the delivery is `delivered`. On a bot whose lid a person closes (`manual_close_door`), this does nothing: the unload completes when the lid closes.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Delivery id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`. Resolves only active deliveries.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDeliveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "The delivery is not `at_dropoff`, or has no bot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The delivery is not `at_dropoff`, or has no bot."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No delivery in progress with this id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No delivery in progress with this id."
              }
            ]
          }
        }
      }
    },
    "/partners": {
      "post": {
        "operationId": "createPartner",
        "tags": [
          "Partner"
        ],
        "summary": "Create your partner",
        "description": "Creates the partner of your API key, which can have only one.",
        "x-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnerRequest"
              },
              "example": {
                "name": "Acme Logistics"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created partner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResponse"
                },
                "example": {
                  "data": {
                    "id": "V1StGXR8Z5jdHi6BmyT2q",
                    "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                    "namespace": "partner_acme",
                    "name": "Acme Logistics",
                    "enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, for example a missing `name`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body, for example a missing `name`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "409": {
            "description": "Your key already has a partner. Use `GET` or `PATCH /partners`.\n\n`PARTNER_NAME_TAKEN`: `name` is already used by another partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your key already has a partner. Use `GET` or `PATCH /partners`."
              },
              {
                "code": "PARTNER_NAME_TAKEN",
                "when": "`name` is already used by another partner."
              }
            ]
          }
        }
      },
      "get": {
        "operationId": "getPartner",
        "tags": [
          "Partner"
        ],
        "summary": "Get your partner",
        "x-scope": "delivery",
        "responses": {
          "200": {
            "description": "Your partner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResponse"
                },
                "example": {
                  "data": {
                    "id": "V1StGXR8Z5jdHi6BmyT2q",
                    "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                    "namespace": "partner_acme",
                    "name": "Acme Logistics",
                    "enabled": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "You have not created your partner yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "You have not created your partner yet. Create it with `POST /partners`."
              }
            ]
          }
        }
      },
      "patch": {
        "operationId": "updatePartner",
        "tags": [
          "Partner"
        ],
        "summary": "Update your partner",
        "x-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerRequest"
              },
              "example": {
                "name": "Acme Logistics US"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Your updated partner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResponse"
                },
                "example": {
                  "data": {
                    "id": "V1StGXR8Z5jdHi6BmyT2q",
                    "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                    "namespace": "partner_acme",
                    "name": "Acme Logistics US",
                    "enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, or no field to update.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body, or no field to update."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "You have not created your partner yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "You have not created your partner yet. Create it with `POST /partners`."
              }
            ]
          },
          "409": {
            "description": "`PARTNER_NAME_TAKEN`: `name` is already used by another partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "PARTNER_NAME_TAKEN",
                "when": "`name` is already used by another partner."
              }
            ]
          }
        }
      }
    },
    "/locations": {
      "post": {
        "operationId": "createLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Create a location",
        "x-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationRequest"
              },
              "example": {
                "full_name": "Downtown Campus",
                "short_name": "DTC",
                "country_code": "CO",
                "city_name": "Bogotá",
                "polygon": {
                  "type": "Polygon",
                  "coordinates": [
                    [
                      -74.0712,
                      4.6498
                    ],
                    [
                      -74.0521,
                      4.6498
                    ],
                    [
                      -74.0521,
                      4.6602
                    ],
                    [
                      -74.0712,
                      4.6602
                    ],
                    [
                      -74.0712,
                      4.6498
                    ]
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created location.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponse"
                },
                "example": {
                  "data": {
                    "id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "full_name": "Downtown Campus",
                    "short_name": "DTC",
                    "country_code": "CO",
                    "city_name": "Bogotá",
                    "state_name": null,
                    "time_zone": "America/Bogota",
                    "enabled": true,
                    "polygon": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          -74.0712,
                          4.6498
                        ],
                        [
                          -74.0521,
                          4.6498
                        ],
                        [
                          -74.0521,
                          4.6602
                        ],
                        [
                          -74.0712,
                          4.6602
                        ],
                        [
                          -74.0712,
                          4.6498
                        ]
                      ]
                    },
                    "availability_intervals": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, for example a `short_name` that is not 3 to 4 characters or a `polygon` with nested rings.\n\nYour partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body, for example a `short_name` that is not 3 to 4 characters or a `polygon` with nested rings."
              },
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "409": {
            "description": "`LOCATION_NAME_TAKEN`: `full_name` or `short_name` is already used: names are unique across all partners. `params.field` says which.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "LOCATION_NAME_TAKEN",
                "when": "`full_name` or `short_name` is already used: names are unique across all partners. `params.field` says which."
              }
            ]
          }
        }
      },
      "get": {
        "operationId": "listLocations",
        "tags": [
          "Locations"
        ],
        "summary": "List locations",
        "x-scope": "delivery",
        "responses": {
          "200": {
            "description": "Every location of your partner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListLocationsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "7Nk2QhVpXrLmT4wZaBcDe",
                      "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                      "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                      "full_name": "Downtown Campus",
                      "short_name": "DTC",
                      "country_code": "CO",
                      "city_name": "Bogotá",
                      "state_name": null,
                      "time_zone": "America/Bogota",
                      "enabled": true,
                      "polygon": {
                        "type": "Polygon",
                        "coordinates": [
                          [
                            -74.0712,
                            4.6498
                          ],
                          [
                            -74.0521,
                            4.6498
                          ],
                          [
                            -74.0521,
                            4.6602
                          ],
                          [
                            -74.0712,
                            4.6602
                          ],
                          [
                            -74.0712,
                            4.6498
                          ]
                        ]
                      },
                      "availability_intervals": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          }
        }
      }
    },
    "/locations/{id}": {
      "get": {
        "operationId": "getLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Get a location",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Location id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The location.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponse"
                },
                "example": {
                  "data": {
                    "id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "full_name": "Downtown Campus",
                    "short_name": "DTC",
                    "country_code": "CO",
                    "city_name": "Bogotá",
                    "state_name": null,
                    "time_zone": "America/Bogota",
                    "enabled": true,
                    "polygon": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          -74.0712,
                          4.6498
                        ],
                        [
                          -74.0521,
                          4.6498
                        ],
                        [
                          -74.0521,
                          4.6602
                        ],
                        [
                          -74.0712,
                          4.6602
                        ],
                        [
                          -74.0712,
                          4.6498
                        ]
                      ]
                    },
                    "availability_intervals": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No location with this id in your partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No location with this id in your partner."
              }
            ]
          }
        }
      },
      "patch": {
        "operationId": "updateLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Update a location",
        "description": "Send only the fields you change.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Location id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationRequest"
              },
              "example": {
                "city_name": "Bogotá D.C."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated location.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponse"
                },
                "example": {
                  "data": {
                    "id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "full_name": "Downtown Campus",
                    "short_name": "DTC",
                    "country_code": "CO",
                    "city_name": "Bogotá D.C.",
                    "state_name": null,
                    "time_zone": "America/Bogota",
                    "enabled": true,
                    "polygon": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          -74.0712,
                          4.6498
                        ],
                        [
                          -74.0521,
                          4.6498
                        ],
                        [
                          -74.0521,
                          4.6602
                        ],
                        [
                          -74.0712,
                          4.6602
                        ],
                        [
                          -74.0712,
                          4.6498
                        ]
                      ]
                    },
                    "availability_intervals": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, or no field to update.\n\nYour partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body, or no field to update."
              },
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No location with this id in your partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No location with this id in your partner."
              }
            ]
          },
          "409": {
            "description": "`LOCATION_NAME_TAKEN`: `full_name` or `short_name` is already used: names are unique across all partners. `params.field` says which.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "LOCATION_NAME_TAKEN",
                "when": "`full_name` or `short_name` is already used: names are unique across all partners. `params.field` says which."
              }
            ]
          }
        }
      }
    },
    "/locations/{id}/paths": {
      "get": {
        "operationId": "getLocationPaths",
        "tags": [
          "Locations"
        ],
        "summary": "Get the paths of a location",
        "description": "The paths our bots can drive at the location: sidewalks, crossings and driveways, as a GeoJSON FeatureCollection of LineStrings. A location with no map returns an empty collection. Not paginated; a change to the map can take up to 10 minutes to appear.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Location id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The path network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetLocationPathsResponse"
                },
                "example": {
                  "data": {
                    "type": "FeatureCollection",
                    "features": [
                      {
                        "type": "Feature",
                        "geometry": {
                          "type": "LineString",
                          "coordinates": [
                            [
                              -74.0712,
                              4.6498
                            ],
                            [
                              -74.0689,
                              4.6512
                            ],
                            [
                              -74.0671,
                              4.6527
                            ]
                          ]
                        },
                        "properties": {
                          "id": 1042,
                          "kind": "sidewalk"
                        }
                      },
                      {
                        "type": "Feature",
                        "geometry": {
                          "type": "LineString",
                          "coordinates": [
                            [
                              -74.0671,
                              4.6527
                            ],
                            [
                              -74.067,
                              4.6531
                            ]
                          ]
                        },
                        "properties": {
                          "id": 1043,
                          "kind": "crossing"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No location with this id in your partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No location with this id in your partner."
              }
            ]
          },
          "503": {
            "description": "The map service is temporarily unavailable. Retry later.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The map service is temporarily unavailable. Retry later."
              }
            ]
          }
        }
      }
    },
    "/points": {
      "post": {
        "operationId": "createPoint",
        "tags": [
          "Points"
        ],
        "summary": "Create a point",
        "description": "Adds a point to one of your locations. A point without the `pickup` tag is never reported as available by the kitchen availability check (`not_pickup`).",
        "x-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePointRequest"
              },
              "example": {
                "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                "external_id": "kitchen-north",
                "name": "North Kitchen",
                "lat": 4.6512,
                "lng": -74.0689,
                "tags": [
                  "pickup"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created point.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PointResponse"
                },
                "example": {
                  "data": {
                    "id": "Qm3LxYtR9vBnKs2FdHjWp",
                    "external_id": "kitchen-north",
                    "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "name": "North Kitchen",
                    "description": null,
                    "lat": 4.6512,
                    "lng": -74.0689,
                    "azimuth": null,
                    "tags": [
                      "pickup"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, for example a `lat` out of range or a tag other than `pickup` or `dropoff`.\n\nYour partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body, for example a `lat` out of range or a tag other than `pickup` or `dropoff`."
              },
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No location with this id in your partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No location with this id in your partner."
              }
            ]
          },
          "409": {
            "description": "`POINT_EXTERNAL_ID_TAKEN`: `external_id` is already used by another of your points.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "POINT_EXTERNAL_ID_TAKEN",
                "when": "`external_id` is already used by another of your points."
              }
            ]
          }
        }
      },
      "get": {
        "operationId": "listPoints",
        "tags": [
          "Points"
        ],
        "summary": "List points",
        "description": "The points of one location.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "location_id",
            "in": "query",
            "required": true,
            "description": "A location you own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The points of the location.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPointsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "Qm3LxYtR9vBnKs2FdHjWp",
                      "external_id": "kitchen-north",
                      "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                      "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                      "name": "North Kitchen",
                      "description": null,
                      "lat": 4.6512,
                      "lng": -74.0689,
                      "azimuth": null,
                      "tags": [
                        "pickup"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`location_id` is missing.\n\nYour partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "`location_id` is missing."
              },
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No location with this id in your partner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No location with this id in your partner."
              }
            ]
          }
        }
      }
    },
    "/points/{id}": {
      "get": {
        "operationId": "getPoint",
        "tags": [
          "Points"
        ],
        "summary": "Get a point",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Point id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The point.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PointResponse"
                },
                "example": {
                  "data": {
                    "id": "Qm3LxYtR9vBnKs2FdHjWp",
                    "external_id": "kitchen-north",
                    "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "name": "North Kitchen",
                    "description": null,
                    "lat": 4.6512,
                    "lng": -74.0689,
                    "azimuth": null,
                    "tags": [
                      "pickup"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No point with this id in your partner (by `external_id`: no point with this value).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No point with this id in your partner (by `external_id`: no point with this value)."
              }
            ]
          }
        }
      },
      "patch": {
        "operationId": "updatePoint",
        "tags": [
          "Points"
        ],
        "summary": "Update a point",
        "description": "Send only the fields you change. `tags` replaces the `pickup` and `dropoff` roles, so omit it to keep them. A point cannot move to another location.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Point id, or your `external_id` with `id_type=external`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "required": false,
            "description": "Treat `{id}` as your `external_id`.",
            "schema": {
              "type": "string",
              "const": "external"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePointRequest"
              },
              "example": {
                "tags": [
                  "pickup",
                  "dropoff"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated point.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PointResponse"
                },
                "example": {
                  "data": {
                    "id": "Qm3LxYtR9vBnKs2FdHjWp",
                    "external_id": "kitchen-north",
                    "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "name": "North Kitchen",
                    "description": null,
                    "lat": 4.6512,
                    "lng": -74.0689,
                    "azimuth": null,
                    "tags": [
                      "dropoff",
                      "pickup"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body: no field to update, an unknown field (such as `location_id`), or an empty `tags`.\n\nYour partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body: no field to update, an unknown field (such as `location_id`), or an empty `tags`."
              },
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No point with this id in your partner (by `external_id`: no point with this value).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No point with this id in your partner (by `external_id`: no point with this value)."
              }
            ]
          },
          "409": {
            "description": "`POINT_EXTERNAL_ID_TAKEN`: `external_id` is already used by another of your points.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "POINT_EXTERNAL_ID_TAKEN",
                "when": "`external_id` is already used by another of your points."
              }
            ]
          }
        }
      }
    },
    "/bots": {
      "get": {
        "operationId": "listBots",
        "tags": [
          "Bots"
        ],
        "summary": "List bots",
        "description": "Your bots: assigned to your partner, or with no partner and at one of your locations. Connected bots come first. No telemetry or control.",
        "x-scope": "delivery",
        "responses": {
          "200": {
            "description": "Your bots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBotsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "4T001",
                      "commercial_name": "Bot 12",
                      "available": true,
                      "can_take_delivery": true,
                      "availability_status": "available",
                      "connected": true,
                      "operational": true,
                      "autonomy_enabled": true,
                      "manual_close_door": false,
                      "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                      "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                      "current_action": null,
                      "current_job_id": null,
                      "reserved_job_id": null,
                      "current_target_point_id": null,
                      "last_connection_event_at": 1781710800000,
                      "last_operational_event_at": 1781710200000
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          }
        }
      }
    },
    "/bots/{id}": {
      "get": {
        "operationId": "getBot",
        "tags": [
          "Bots"
        ],
        "summary": "Get a bot",
        "description": "The bot with its last telemetry and who controls it. Check `recorded_at` and `connected` before trusting a position.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The bot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBotResponse"
                },
                "example": {
                  "data": {
                    "id": "4T001",
                    "commercial_name": "Bot 12",
                    "available": true,
                    "can_take_delivery": true,
                    "availability_status": "available",
                    "connected": true,
                    "operational": true,
                    "autonomy_enabled": true,
                    "manual_close_door": false,
                    "location_id": "7Nk2QhVpXrLmT4wZaBcDe",
                    "partner_id": "V1StGXR8Z5jdHi6BmyT2q",
                    "current_action": null,
                    "current_job_id": null,
                    "reserved_job_id": null,
                    "current_target_point_id": null,
                    "last_connection_event_at": 1781710800000,
                    "last_operational_event_at": 1781710200000,
                    "telemetry": {
                      "position": {
                        "lat": 4.6498,
                        "lng": -74.0712,
                        "heading": 87.5,
                        "recorded_at": "2026-06-17T15:41:01.000Z"
                      },
                      "battery": {
                        "percentage": 82,
                        "charging": false,
                        "recorded_at": "2026-06-17T15:40:52.000Z"
                      },
                      "speed": {
                        "mps": 0.84,
                        "recorded_at": "2026-06-17T15:41:00.500Z"
                      },
                      "door": {
                        "status": "closed",
                        "recorded_at": "2026-06-17T15:40:58.000Z"
                      }
                    },
                    "control": {
                      "mode": "autonomous",
                      "since": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No bot with this id among your bots.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No bot with this id among your bots."
              }
            ]
          }
        }
      }
    },
    "/bots/{id}/video": {
      "post": {
        "operationId": "createBotVideoLink",
        "tags": [
          "Bots"
        ],
        "summary": "Watch a bot live",
        "description": "Returns a short-lived link to the bot camera, to open or embed. Request one link per viewer. Works with a `delivery` key for your bots, or a `fleet` key for the bots of your fleet.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The player link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBotVideoLinkResponse"
                },
                "example": {
                  "data": {
                    "url": "https://remi.kiwi/live#s=miami&b=4T001&t=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ2aWV3ZXIifQ.c2lnbmF0dXJl",
                    "expires_at": "2027-06-17T23:40:00.000Z",
                    "live": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No bot with this id that your key may watch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No bot with this id that your key may watch."
              }
            ]
          },
          "409": {
            "description": "The bot has no live video source.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The bot has no live video source."
              }
            ]
          },
          "503": {
            "description": "Live video is temporarily unavailable. Retry later.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Live video is temporarily unavailable. Retry later."
              }
            ]
          }
        }
      }
    },
    "/bots/{id}/stop": {
      "post": {
        "operationId": "stopBot",
        "tags": [
          "Bots"
        ],
        "summary": "Stop a bot",
        "description": "Asks a bot that is not on a delivery in progress to halt where it is. It does not hold the bot: its next delivery moves it. Not a hardware emergency stop.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StopBotRequest"
              },
              "example": {
                "reason": "Blocking a door"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stop was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopBotResponse"
                },
                "example": {
                  "data": {
                    "bot_id": "4T001",
                    "stopped": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No bot with this id among your bots.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No bot with this id among your bots."
              }
            ]
          },
          "409": {
            "description": "`BOT_OFFLINE`: The bot is offline.\n\n`STOP_NOT_SUPPORTED`: This robot cannot be stopped through the API.\n\n`ACTIVE_DELIVERY`: The bot is on a delivery in progress, and a stop would not hold. Pause the delivery instead. `params.delivery_id` names it when it is yours.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "BOT_OFFLINE",
                "when": "The bot is offline."
              },
              {
                "code": "STOP_NOT_SUPPORTED",
                "when": "This robot cannot be stopped through the API."
              },
              {
                "code": "ACTIVE_DELIVERY",
                "when": "The bot is on a delivery in progress, and a stop would not hold. Pause the delivery instead. `params.delivery_id` names it when it is yours."
              }
            ]
          }
        }
      }
    },
    "/bots/{id}/hard_stop": {
      "post": {
        "operationId": "hardStopBot",
        "tags": [
          "Bots"
        ],
        "summary": "Hard stop a bot",
        "description": "Sends the stop our teleoperators use: pressed, then released after one second. It works while the bot is on a delivery (operations is alerted) and does not pause the delivery. Not a hardware emergency stop: in an emergency call operations.",
        "x-scope": "delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HardStopBotRequest"
              },
              "example": {
                "reason": "Person in the path"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stop was sent and released.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HardStopBotResponse"
                },
                "example": {
                  "data": {
                    "bot_id": "4T001",
                    "hard_stopped": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your partner does not exist yet. Create it with `POST /partners`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Your partner does not exist yet. Create it with `POST /partners`."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `delivery` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `delivery` scope."
              }
            ]
          },
          "404": {
            "description": "No bot with this id among your bots.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No bot with this id among your bots."
              }
            ]
          },
          "409": {
            "description": "`BOT_OFFLINE`: The bot is offline.\n\n`STOP_NOT_SUPPORTED`: This robot cannot take a hard stop through the API.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "BOT_OFFLINE",
                "when": "The bot is offline."
              },
              {
                "code": "STOP_NOT_SUPPORTED",
                "when": "This robot cannot take a hard stop through the API."
              }
            ]
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key with the `delivery` scope, sent as `Authorization: Bearer <key>`. Ask your Robot.com representative for one."
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Always `about:blank`."
          },
          "title": {
            "type": "string",
            "description": "The HTTP status text."
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "detail": {
            "type": "string",
            "description": "Human-readable. Do not parse it: branch on `code`."
          },
          "instance": {
            "type": "string",
            "description": "The request path."
          },
          "code": {
            "description": "Stable machine-readable error code, when the error has one.",
            "type": "string"
          },
          "params": {
            "description": "Values that explain the error, keyed by name.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance"
        ]
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Delivery id, usually like `ES-5867`. Treat it as an opaque string."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "draft": {
            "type": "boolean",
            "description": "True while a draft. Publish with `PATCH` and `draft: false`."
          },
          "mode": {
            "type": "string",
            "enum": [
              "standard",
              "pickup_only"
            ],
            "description": "`standard`: a bot delivers. `pickup_only`: the customer picks up, no bot."
          },
          "state": {
            "$ref": "#/components/schemas/DeliveryState"
          },
          "paused": {
            "type": "boolean",
            "description": "True while on hold. `state` keeps the leg it was on."
          },
          "bot": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "lat": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "lng": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "door_status": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "control": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "autonomous",
                              "teleop_requested",
                              "teleop"
                            ],
                            "description": "`autonomous`: drives itself. `teleop_requested`: waiting for an operator. `teleop`: an operator is driving."
                          },
                          "since": {
                            "description": "Epoch milliseconds when the mode started. Null when autonomous.",
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "mode",
                          "since"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Who drives the bot. Set on webhooks only; null on reads."
                  }
                },
                "required": [
                  "id",
                  "lat",
                  "lng",
                  "door_status",
                  "control"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The assigned bot. Null before assignment and for pickup-only."
          },
          "location_id": {
            "type": "string"
          },
          "arriving": {
            "description": "True while the bot approaches its current stop. Not the signal to load: wait for `at_pickup`.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "arriving_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estimated arrival at the current stop."
          },
          "options": {
            "type": "object",
            "properties": {
              "bots": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bot_tags": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "require_available_bot": {
                "type": "boolean"
              },
              "webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "webhook_headers": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "return_enabled": {
                "type": "boolean"
              },
              "eta_updates": {
                "type": "boolean"
              }
            },
            "required": [
              "bots",
              "bot_tags",
              "require_available_bot",
              "webhook_url",
              "webhook_headers",
              "return_enabled",
              "eta_updates"
            ],
            "description": "Stored options. `tracking` is not returned."
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "pickup": {
            "$ref": "#/components/schemas/DeliveryPoint"
          },
          "dropoff": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeliveryPoint"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null for pickup-only."
          },
          "return_point": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeliveryPoint"
              },
              {
                "type": "null"
              }
            ]
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeliveryPackage"
            }
          },
          "deliver_by": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "event_type": {
            "description": "On a webhook, the event that sent it. Null on reads.",
            "type": [
              "string",
              "null"
            ]
          },
          "estimates": {
            "type": "object",
            "properties": {
              "distance": {
                "description": "Meters left.",
                "type": [
                  "number",
                  "null"
                ]
              },
              "duration": {
                "description": "Milliseconds of travel left.",
                "type": [
                  "number",
                  "null"
                ]
              },
              "pickup": {
                "$ref": "#/components/schemas/DeliveryNodeEstimate"
              },
              "dropoff": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/DeliveryNodeEstimate"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "target_completion_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "distance",
              "duration",
              "pickup",
              "dropoff",
              "scheduled_at",
              "target_completion_at"
            ]
          },
          "tracker_url": {
            "description": "Tracking page for the recipient.",
            "type": [
              "string",
              "null"
            ]
          },
          "scheduled": {
            "type": "boolean"
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "incomplete_reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "draft",
          "mode",
          "state",
          "paused",
          "bot",
          "location_id",
          "arriving",
          "arriving_at",
          "options",
          "external_id",
          "pickup",
          "dropoff",
          "return_point",
          "packages",
          "deliver_by",
          "created_at",
          "metadata",
          "event_type",
          "estimates",
          "tracker_url",
          "scheduled",
          "cancellation_reason",
          "incomplete_reason"
        ]
      },
      "DeliveryState": {
        "type": "string",
        "enum": [
          "draft",
          "pending",
          "going_to_pickup",
          "at_pickup",
          "going_to_dropoff",
          "at_dropoff",
          "delivered",
          "canceled",
          "failed",
          "going_to_return",
          "at_return",
          "returned",
          "preparing",
          "ready_for_pickup",
          "picked_up"
        ],
        "description": "Where the delivery is. Standard: `pending` → `going_to_pickup` → `at_pickup` → `going_to_dropoff` → `at_dropoff` → `delivered`, or `going_to_return` → `at_return` → `returned`. Pickup-only: `pending` → `preparing` → `ready_for_pickup` → `picked_up`. `canceled` means someone called it off; `failed` means it could not be completed."
      },
      "DeliveryPoint": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Registered point id, or null when the point was sent as coordinates only.",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "azimuth": {
            "description": "Approach heading in degrees, 0 to 360.",
            "type": [
              "number",
              "null"
            ]
          },
          "contact": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "phone",
                  "email"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "matching": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "exact"
                      },
                      "required": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "mode"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "snap"
                      },
                      "radius": {
                        "type": "number"
                      },
                      "required": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "mode",
                      "radius"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "associate"
                      },
                      "radius": {
                        "type": "number"
                      },
                      "required": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "mode",
                      "radius"
                    ]
                  }
                ],
                "description": "Link coordinates to a registered point. `exact`: a point within 5 m, use its coordinates. `snap`: the nearest point within `radius` meters, use its coordinates. `associate`: the nearest point within `radius` meters, keep your coordinates. `required: true` fails with 400 when none is found."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "lat",
          "lng",
          "azimuth",
          "contact",
          "matching"
        ]
      },
      "DeliveryPackage": {
        "type": "object",
        "properties": {
          "reference": {
            "description": "Your reference, as sent.",
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "number"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "picture_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "name",
                    "quantity",
                    "description",
                    "picture_url",
                    "metadata"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "length": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "width": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "height": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "length",
                  "width",
                  "height"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Always null today: dimensions are accepted on create but not stored."
          },
          "weight": {
            "description": "Grams.",
            "type": [
              "number",
              "null"
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "station": {
            "description": "Prep station, trimmed. Send this value back to target the station.",
            "type": [
              "string",
              "null"
            ]
          },
          "loaded": {
            "type": "boolean",
            "description": "True once this package's pickup load is complete."
          }
        },
        "required": [
          "reference",
          "items",
          "dimensions",
          "weight",
          "metadata",
          "station",
          "loaded"
        ]
      },
      "DeliveryNodeEstimate": {
        "type": "object",
        "properties": {
          "arrival_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "The real arrival once reached, else a projection. Null when unknown."
          },
          "completion_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the stop finishes: real once done, else a projection."
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "actual",
                  "derived"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "`actual`: `arrival_at` already happened. `derived`: a projection."
          },
          "unknown_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "no_route",
                  "unpriced_leg",
                  "not_departed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Set whenever `arrival_at` is null. `no_route`: no bot yet. `unpriced_leg`: leg not priced yet. `not_departed`: not on its way yet."
          }
        },
        "required": [
          "arrival_at",
          "completion_at",
          "source",
          "unknown_reason"
        ]
      },
      "DeliveryEta": {
        "type": "object",
        "properties": {
          "bot_id": {
            "description": "The bot the estimate is for. Null until a bot is assigned.",
            "type": [
              "string",
              "null"
            ]
          },
          "pickup_eta": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dropoff_eta": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "bot_id",
          "pickup_eta",
          "dropoff_eta"
        ]
      },
      "DeliveryRoute": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "estimated",
              "robot"
            ],
            "description": "Always `estimated` today. Handle other values."
          },
          "mapped": {
            "type": "boolean",
            "description": "False when at least one leg is a straight-line estimate."
          },
          "computed_at": {
            "type": "string",
            "format": "date-time"
          },
          "position_recorded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the bot reported the start position. Null before a bot drives it."
          },
          "distance": {
            "type": "number",
            "description": "Meters left, travel only."
          },
          "duration": {
            "type": "number",
            "description": "Milliseconds left, travel only."
          },
          "points": {
            "type": "array",
            "items": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            },
            "description": "`[lat, lng]` pairs in driving order. Empty at the last stop."
          },
          "stops": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "enum": [
                    "pickup",
                    "dropoff",
                    "return"
                  ]
                },
                "lat": {
                  "type": "number"
                },
                "lng": {
                  "type": "number"
                },
                "point_index": {
                  "type": "number",
                  "description": "Index into `points` of this stop."
                }
              },
              "required": [
                "name",
                "lat",
                "lng",
                "point_index"
              ]
            }
          }
        },
        "required": [
          "source",
          "mapped",
          "computed_at",
          "position_recorded_at",
          "distance",
          "duration",
          "points",
          "stops"
        ]
      },
      "PointAvailability": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "last_seen_at": {
            "description": "Present only when available.",
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "ok",
              "no_session",
              "no_kds_session",
              "not_engine_mode",
              "reporting_disabled",
              "not_pickup",
              "unknown_point"
            ]
          },
          "pds": {
            "description": "Kitchen-display locations only: the operator tablet.",
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "last_seen_at": {
                "type": "string"
              }
            },
            "required": [
              "available"
            ]
          },
          "kds": {
            "description": "Kitchen-display locations only: the kitchen board.",
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "last_seen_at": {
                "type": "string"
              }
            },
            "required": [
              "available"
            ]
          },
          "point_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "available",
          "reason",
          "point_id",
          "external_id",
          "name"
        ]
      },
      "Availability": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "last_seen_at": {
            "description": "Present only when available.",
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "ok",
              "no_session",
              "no_kds_session",
              "not_engine_mode",
              "reporting_disabled",
              "not_pickup",
              "unknown_point"
            ]
          },
          "pds": {
            "description": "Kitchen-display locations only: the operator tablet.",
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "last_seen_at": {
                "type": "string"
              }
            },
            "required": [
              "available"
            ]
          },
          "kds": {
            "description": "Kitchen-display locations only: the kitchen board.",
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "last_seen_at": {
                "type": "string"
              }
            },
            "required": [
              "available"
            ]
          }
        },
        "required": [
          "available",
          "reason"
        ]
      },
      "CreateDeliveryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Display name, for example the order number.",
            "type": "string"
          },
          "location_id": {
            "description": "Optional when a point is a registered one.",
            "type": "string"
          },
          "draft": {
            "description": "Create without starting it. Publish with `PATCH` and `draft: false`.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "mode": {
            "description": "Delivery mode. Defaults to standard (bot delivery).",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "standard",
                  "pickup_only"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "options": {
            "$ref": "#/components/schemas/DeliveryOptionsInput"
          },
          "external_id": {
            "description": "Your id. Unique among your active deliveries; use it with `id_type=external`.",
            "type": [
              "string",
              "null"
            ]
          },
          "pickup": {
            "$ref": "#/components/schemas/PointInput"
          },
          "dropoff": {
            "description": "Required for `standard`, not allowed for `pickup_only`.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/PointInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "return_point": {
            "description": "Where a canceled, loaded order goes back to. Turns the return on.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/PointInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "packages": {
            "anyOf": [
              {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PackageInput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "deliver_by": {
            "description": "Deadline. Not with `require_available_bot`.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "description": "Free-form, returned as sent.",
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "pickup"
        ]
      },
      "PointInput": {
        "type": "object",
        "properties": {
          "id": {
            "description": "A registered point.",
            "type": "string"
          },
          "external_id": {
            "description": "A registered point, by your id.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "azimuth": {
            "description": "Approach heading in degrees.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 360
              },
              {
                "type": "null"
              }
            ]
          },
          "contact": {
            "description": "Contact at this point. On the dropoff, the recipient of tracking messages.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "description": "With country code. Needed for SMS tracking.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "description": "Needed for email tracking.",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "matching": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "exact"
                      },
                      "required": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "mode"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "snap"
                      },
                      "radius": {
                        "type": "number"
                      },
                      "required": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "mode",
                      "radius"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "associate"
                      },
                      "radius": {
                        "type": "number"
                      },
                      "required": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "mode",
                      "radius"
                    ]
                  }
                ],
                "description": "Link coordinates to a registered point. `exact`: a point within 5 m, use its coordinates. `snap`: the nearest point within `radius` meters, use its coordinates. `associate`: the nearest point within `radius` meters, keep your coordinates. `required: true` fails with 400 when none is found."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PackageInput": {
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "picture_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "description": "Your reference. Target this package by it when loading.",
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "picture_url": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "metadata": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "name",
                    "quantity"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "length": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Length in millimeters"
                  },
                  "width": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Width in millimeters"
                  },
                  "height": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Height in millimeters"
                  }
                },
                "required": [
                  "length",
                  "width",
                  "height"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "weight": {
            "description": "Grams.",
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "station": {
            "description": "Prep station that owns this package (e.g. \"Burger Shop\"). Create one package per station to enable the PDS station filter. Trimmed; blank is treated as no station; max 50 characters.",
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DeliveryOptionsInput": {
        "type": "object",
        "properties": {
          "bots": {
            "description": "Pin the delivery to one bot id.",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "bot_tags": {
            "description": "Only bots carrying every tag can take it.",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "require_available_bot": {
            "description": "Fail with 409 `NO_AVAILABLE_BOT` instead of waiting when no bot is free. Not with `deliver_by`.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "webhook_url": {
            "description": "Where this delivery's webhooks go. No URL, no webhooks.",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "webhook_headers": {
            "description": "Sent with every webhook, for example your auth header.",
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "return_enabled": {
            "description": "If canceled after loading, the bot brings the order back to `return_point`, else to the pickup.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "eta_updates": {
            "description": "Also send a `node_eta_changed` webhook when an arrival time moves.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "tracking": {
            "description": "Text or email the recipient at each step. Needs the matching contact detail.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "notify": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "sms": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "email": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Partner": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "external_id": {
            "type": "string",
            "description": "Assigned by REMI, starting with `ext_`. You cannot set it."
          },
          "namespace": {
            "type": "string",
            "description": "Taken from your API key."
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "external_id",
          "namespace",
          "name",
          "enabled"
        ]
      },
      "PartnerResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Partner"
          }
        },
        "required": [
          "data"
        ]
      },
      "Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "external_id": {
            "type": "string",
            "description": "Assigned by REMI, starting with `ext_`. You cannot set it."
          },
          "partner_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "full_name": {
            "type": "string"
          },
          "short_name": {
            "type": "string"
          },
          "country_code": {
            "type": "string"
          },
          "city_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "state_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "time_zone": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "polygon": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "Polygon"
              },
              "coordinates": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "minItems": 2,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "description": "Operating area. `coordinates` is a flat list of `[lng, lat]` pairs, not the nested rings of standard GeoJSON."
          },
          "availability_intervals": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "isOpen": {
                      "type": "boolean"
                    },
                    "openTime": {
                      "type": "string"
                    },
                    "closeTime": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "isOpen",
                    "openTime",
                    "closeTime"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Opening hours, set by REMI. Null when none are configured."
          }
        },
        "required": [
          "id",
          "external_id",
          "partner_id",
          "full_name",
          "short_name",
          "country_code",
          "city_name",
          "state_name",
          "time_zone",
          "enabled",
          "polygon",
          "availability_intervals"
        ]
      },
      "LocationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Location"
          }
        },
        "required": [
          "data"
        ]
      },
      "LocationPaths": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "FeatureCollection"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Feature"
                },
                "geometry": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "LineString"
                    },
                    "coordinates": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "prefixItems": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "number"
                          }
                        ],
                        "items": false,
                        "minItems": 2,
                        "maxItems": 2
                      },
                      "description": "`[lng, lat]` pairs in drive order."
                    }
                  },
                  "required": [
                    "type",
                    "coordinates"
                  ]
                },
                "properties": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "Id of the way in our map. Null when the map has none.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "sidewalk",
                        "crossing",
                        "driveway"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "kind"
                  ]
                }
              },
              "required": [
                "type",
                "geometry",
                "properties"
              ]
            }
          }
        },
        "required": [
          "type",
          "features"
        ]
      },
      "Point": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "external_id": {
            "type": "string",
            "description": "Your `external_id`, or `ext_` followed by 21 characters when you did not set one."
          },
          "location_id": {
            "type": "string"
          },
          "partner_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "azimuth": {
            "description": "Approach heading in degrees, 0 to 360.",
            "type": [
              "number",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pickup",
                "dropoff"
              ]
            },
            "description": "Roles of the point, the same values `PATCH` accepts. REMI may set other roles that are not shown."
          }
        },
        "required": [
          "id",
          "external_id",
          "location_id",
          "partner_id",
          "name",
          "description",
          "lat",
          "lng",
          "azimuth",
          "tags"
        ]
      },
      "PointResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Point"
          }
        },
        "required": [
          "data"
        ]
      },
      "Bot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "commercial_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "available": {
            "type": "boolean",
            "description": "In service. Stays true during a delivery: use `can_take_delivery` to know whether the bot is free."
          },
          "can_take_delivery": {
            "type": "boolean",
            "description": "True when the bot is in service, connected, and free or only on work that a new delivery replaces."
          },
          "availability_status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "available",
                  "marketing",
                  "maintenance",
                  "mapping",
                  "off_duty",
                  "unknown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "connected": {
            "type": "boolean",
            "description": "True while the bot is online."
          },
          "operational": {
            "type": "boolean"
          },
          "autonomy_enabled": {
            "type": "boolean"
          },
          "manual_close_door": {
            "type": "boolean"
          },
          "location_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "partner_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_action": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "move",
                  "load",
                  "activity",
                  "unload",
                  "finish",
                  "panic"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Deprecated. Always null."
          },
          "current_job_id": {
            "description": "The delivery the bot is serving. Null while it is free or only on work that a new delivery replaces.",
            "type": [
              "string",
              "null"
            ]
          },
          "reserved_job_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_target_point_id": {
            "description": "Deprecated. Always null.",
            "type": [
              "string",
              "null"
            ]
          },
          "last_connection_event_at": {
            "description": "Epoch milliseconds.",
            "type": [
              "number",
              "null"
            ]
          },
          "last_operational_event_at": {
            "description": "Epoch milliseconds.",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "commercial_name",
          "available",
          "can_take_delivery",
          "availability_status",
          "connected",
          "operational",
          "autonomy_enabled",
          "manual_close_door",
          "location_id",
          "partner_id",
          "current_action",
          "current_job_id",
          "reserved_job_id",
          "current_target_point_id",
          "last_connection_event_at",
          "last_operational_event_at"
        ]
      },
      "BotDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "commercial_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "available": {
            "type": "boolean",
            "description": "In service. Stays true during a delivery: use `can_take_delivery` to know whether the bot is free."
          },
          "can_take_delivery": {
            "type": "boolean",
            "description": "True when the bot is in service, connected, and free or only on work that a new delivery replaces."
          },
          "availability_status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "available",
                  "marketing",
                  "maintenance",
                  "mapping",
                  "off_duty",
                  "unknown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "connected": {
            "type": "boolean",
            "description": "True while the bot is online."
          },
          "operational": {
            "type": "boolean"
          },
          "autonomy_enabled": {
            "type": "boolean"
          },
          "manual_close_door": {
            "type": "boolean"
          },
          "location_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "partner_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_action": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "move",
                  "load",
                  "activity",
                  "unload",
                  "finish",
                  "panic"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Deprecated. Always null."
          },
          "current_job_id": {
            "description": "The delivery the bot is serving. Null while it is free or only on work that a new delivery replaces.",
            "type": [
              "string",
              "null"
            ]
          },
          "reserved_job_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_target_point_id": {
            "description": "Deprecated. Always null.",
            "type": [
              "string",
              "null"
            ]
          },
          "last_connection_event_at": {
            "description": "Epoch milliseconds.",
            "type": [
              "number",
              "null"
            ]
          },
          "last_operational_event_at": {
            "description": "Epoch milliseconds.",
            "type": [
              "number",
              "null"
            ]
          },
          "telemetry": {
            "description": "The last values the robot reported. A group is null when it has not reported it.",
            "$ref": "#/components/schemas/BotTelemetry"
          },
          "control": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BotControl"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who drives the bot. Null when it could not be read: retry."
          }
        },
        "required": [
          "id",
          "commercial_name",
          "available",
          "can_take_delivery",
          "availability_status",
          "connected",
          "operational",
          "autonomy_enabled",
          "manual_close_door",
          "location_id",
          "partner_id",
          "current_action",
          "current_job_id",
          "reserved_job_id",
          "current_target_point_id",
          "last_connection_event_at",
          "last_operational_event_at",
          "telemetry",
          "control"
        ]
      },
      "BotTelemetry": {
        "type": "object",
        "properties": {
          "position": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "lat": {
                    "type": "number"
                  },
                  "lng": {
                    "type": "number"
                  },
                  "heading": {
                    "description": "Compass bearing in degrees: 0 is north, 90 is east. Null when the robot reports none.",
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "recorded_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the robot measured it, in UTC."
                  }
                },
                "required": [
                  "lat",
                  "lng",
                  "heading",
                  "recorded_at"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "battery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "percentage": {
                    "type": "number"
                  },
                  "charging": {
                    "description": "True while the battery takes current (pad or cable) or a full bot rests on the pad. Null when the robot reports no battery current.",
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "recorded_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the robot measured it, in UTC."
                  }
                },
                "required": [
                  "percentage",
                  "charging",
                  "recorded_at"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "speed": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "mps": {
                    "type": "number",
                    "description": "Meters per second, never negative."
                  },
                  "recorded_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the robot measured it, in UTC."
                  }
                },
                "required": [
                  "mps",
                  "recorded_at"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Null while the bot is offline."
          },
          "door": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "opened",
                      "closed",
                      "opening",
                      "closing",
                      "stalled"
                    ]
                  },
                  "recorded_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the robot measured it, in UTC."
                  }
                },
                "required": [
                  "status",
                  "recorded_at"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "position",
          "battery",
          "speed",
          "door"
        ]
      },
      "BotControl": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "autonomous",
              "teleop_requested",
              "teleop"
            ],
            "description": "`autonomous`: drives itself. `teleop_requested`: waiting for an operator. `teleop`: an operator is driving."
          },
          "since": {
            "description": "Epoch milliseconds when the mode started. Null when autonomous.",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "mode",
          "since"
        ]
      },
      "ListDeliveriesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Delivery"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "limit": {
                "type": "number"
              }
            },
            "required": [
              "next_cursor",
              "limit"
            ]
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "CreateDeliveryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Delivery"
          }
        },
        "required": [
          "data"
        ]
      },
      "EstimateDeliveryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DeliveryEta"
          }
        },
        "required": [
          "data"
        ]
      },
      "EstimateDeliveryRequest": {
        "type": "object",
        "properties": {
          "delivery_id": {
            "description": "An existing delivery. When set, the points are ignored.",
            "type": "string",
            "minLength": 1
          },
          "id_type": {
            "description": "Treat `delivery_id` as your `external_id`.",
            "type": "string",
            "const": "external"
          },
          "pickup": {
            "$ref": "#/components/schemas/PointInput"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PointInput"
          },
          "location_id": {
            "description": "Needed when neither point is a registered one.",
            "type": "string"
          }
        }
      },
      "ListPointAvailabilityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PointAvailability"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "GetPointAvailabilityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Availability"
          }
        },
        "required": [
          "data"
        ]
      },
      "GetDeliveryRouteResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DeliveryRoute"
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateDeliveryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "draft": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "options": {
            "$ref": "#/components/schemas/DeliveryOptionsInput"
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "pickup": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "lat": {
                    "type": "number"
                  },
                  "lng": {
                    "type": "number"
                  },
                  "azimuth": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 360
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contact": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phone": {
                            "description": "With country code. Needed for SMS tracking.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "email": {
                            "description": "Needed for email tracking.",
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "email",
                                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            ]
          },
          "dropoff": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "lat": {
                    "type": "number"
                  },
                  "lng": {
                    "type": "number"
                  },
                  "azimuth": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 360
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contact": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phone": {
                            "description": "With country code. Needed for SMS tracking.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "email": {
                            "description": "Needed for email tracking.",
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "email",
                                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            ]
          },
          "return_point": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "azimuth": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 360
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "contact": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "phone": {
                                "description": "With country code. Needed for SMS tracking.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "email": {
                                "description": "Needed for email tracking.",
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "email",
                                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "packages": {
            "anyOf": [
              {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PackageInput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "deliver_by": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CancelDeliveryResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "success"
        ]
      },
      "PauseDeliveryRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "description": "Shown to operations. Cut to 200 characters.",
            "type": "string"
          }
        }
      },
      "FinishPreparationRequest": {
        "type": "object",
        "properties": {
          "package": {
            "description": "A package `reference`.",
            "type": "string",
            "minLength": 1
          },
          "station": {
            "description": "Every package of this station.",
            "type": "string",
            "minLength": 1
          },
          "all_stations": {
            "description": "Accepted, but has no effect today.",
            "type": "boolean"
          }
        }
      },
      "FinishLoadTargetRequest": {
        "type": "object",
        "properties": {
          "package": {
            "description": "A package `reference`.",
            "type": "string",
            "minLength": 1
          },
          "station": {
            "description": "Every package of this station.",
            "type": "string",
            "minLength": 1
          }
        }
      },
      "CreatePartnerRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Display name. Must be unique."
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdatePartnerRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Display name. Must be unique."
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateLocationRequest": {
        "type": "object",
        "properties": {
          "full_name": {
            "type": "string",
            "minLength": 1,
            "description": "Display name. Must be unique."
          },
          "short_name": {
            "type": "string",
            "minLength": 3,
            "maxLength": 4,
            "description": "Short code, 3 to 4 characters. Must be unique."
          },
          "country_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2, for example `US`."
          },
          "city_name": {
            "type": "string"
          },
          "state_name": {
            "type": "string"
          },
          "time_zone": {
            "description": "IANA time zone, for example `America/Bogota`. Defaults to `America/Bogota`.",
            "type": "string"
          },
          "polygon": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "Polygon"
              },
              "coordinates": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "minItems": 2,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "description": "Operating area. `coordinates` is a flat list of `[lng, lat]` pairs, not the nested rings of standard GeoJSON."
          }
        },
        "required": [
          "full_name",
          "short_name",
          "country_code",
          "polygon"
        ]
      },
      "ListLocationsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "GetLocationPathsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/LocationPaths"
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateLocationRequest": {
        "type": "object",
        "properties": {
          "full_name": {
            "type": "string",
            "minLength": 1,
            "description": "Display name. Must be unique."
          },
          "short_name": {
            "type": "string",
            "minLength": 3,
            "maxLength": 4,
            "description": "Short code, 3 to 4 characters. Must be unique."
          },
          "country_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2, for example `US`."
          },
          "city_name": {
            "type": "string"
          },
          "state_name": {
            "type": "string"
          },
          "time_zone": {
            "description": "IANA time zone, for example `America/Bogota`. Defaults to `America/Bogota`.",
            "type": "string"
          },
          "polygon": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "Polygon"
              },
              "coordinates": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "minItems": 2,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "description": "Operating area. `coordinates` is a flat list of `[lng, lat]` pairs, not the nested rings of standard GeoJSON."
          }
        }
      },
      "CreatePointRequest": {
        "type": "object",
        "properties": {
          "location_id": {
            "type": "string",
            "description": "A location you own."
          },
          "lat": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "lng": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "azimuth": {
            "description": "Approach heading in degrees, 0 to 360.",
            "type": "integer",
            "minimum": 0,
            "maximum": 360
          },
          "external_id": {
            "description": "Your own id for the point. Must be unique across your points. Generated when omitted.",
            "type": "string",
            "minLength": 1
          },
          "tags": {
            "description": "Roles of the point: `pickup` (kitchen, where orders start) and `dropoff` (delivery destination).",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pickup",
                "dropoff"
              ]
            }
          }
        },
        "required": [
          "location_id",
          "lat",
          "lng"
        ]
      },
      "ListPointsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdatePointRequest": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "lng": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "azimuth": {
            "description": "Approach heading in degrees, 0 to 360.",
            "type": "integer",
            "minimum": 0,
            "maximum": 360
          },
          "external_id": {
            "description": "Your own id for the point. Must be unique across your points. Generated when omitted.",
            "type": "string",
            "minLength": 1
          },
          "tags": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pickup",
                "dropoff"
              ]
            },
            "description": "The complete set of roles. It replaces the current `pickup` and `dropoff` roles, so send every role you want to keep."
          }
        },
        "additionalProperties": false
      },
      "ListBotsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bot"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "GetBotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/BotDetail"
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateBotVideoLinkResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "Player link with its own viewing credential. Do not log it."
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "Open the link before this time. A player that is already open keeps playing."
              },
              "live": {
                "type": "boolean",
                "description": "False when the camera is not sending now. The player starts when it does."
              }
            },
            "required": [
              "url",
              "expires_at",
              "live"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "StopBotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "bot_id": {
                "type": "string"
              },
              "stopped": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "bot_id",
              "stopped"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "StopBotRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "description": "Optional note. Cut to 200 characters.",
            "type": "string"
          }
        }
      },
      "HardStopBotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "bot_id": {
                "type": "string"
              },
              "hard_stopped": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "bot_id",
              "hard_stopped"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "HardStopBotRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "description": "Why you stopped it. Operations sees it when the bot is on a delivery. Cut to 200 characters.",
            "type": "string"
          }
        }
      }
    }
  }
}
