{
  "openapi": "3.0.2",
  "info": {
    "title": "Polymath API Service",
    "description": "Polymath API service to interact with a real or simulated polymath-powered robot",
    "termsOfService": "https://www.polymathrobotics.com/legal/terms-of-service",
    "contact": {
      "name": "Polymath Support",
      "url": "https://www.polymathrobotics.com",
      "email": "api@polymathrobotics.com"
    },
    "license": {
      "name": "All rights reserved",
      "url": "https://www.polymathrobotics.com/legal/privacy-policy"
    },
    "version": "2.0.0"
  },
  "paths": {
    "/v2/version": {
      "get": {
        "tags": [
          "Health Check"
        ],
        "summary": "Get the version of the Polymath system",
        "description": "Returns the current Polymath Synapse and polymath_core commit SHAs.",
        "operationId": "get_version",
        "responses": {
          "200": {
            "description": "Polymath Synapse and polymath_core commit SHAs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/health": {
      "get": {
        "tags": [
          "Health Check"
        ],
        "summary": "Health check endpoint",
        "description": "Returns a basic self health status response. This endpoint is used to verify that the Polymath Synapse API is running and responsive.",
        "operationId": "get_health",
        "responses": {
          "200": {
            "description": "Health status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/uuid": {
      "get": {
        "tags": [
          "Health Check"
        ],
        "summary": "Get the UUID of the Polymath system",
        "description": "Returns the device UUID derived from its MAC address. Deprecated; use `/health`.",
        "operationId": "get_device_uuid",
        "responses": {
          "200": {
            "description": "Device UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UUIDResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": true
      }
    },
    "/v2/polymath-feedback": {
      "get": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Get the combined Autonomy, Navigation and Vehicle feedback from the Polymath system",
        "description": "Returns combined autonomy, navigation, and vehicle feedback from the Polymath system.",
        "operationId": "polymath_feedback",
        "responses": {
          "200": {
            "description": "Combined autonomy, navigation, and vehicle feedback.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolymathFeedbackResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/costmap/boundary": {
      "get": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Get global costmap boundary coordinates",
        "description": "Returns the latest latitude/longitude coordinates for the four corners of the global costmap boundary.",
        "operationId": "costmap_boundary",
        "responses": {
          "200": {
            "description": "Costmap boundary corner coordinates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostmapBoundaryResponse"
                }
              }
            }
          },
          "404": {
            "description": "Costmap boundary data unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/navigation-path-options": {
      "get": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Get the available Navigation Path Options and associated Parameters",
        "description": "Returns available navigation path options and configurable parameters.",
        "operationId": "navigation_path_options",
        "responses": {
          "200": {
            "description": "Available navigation path options and parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PathLogicOptionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/vehicle-commands": {
      "get": {
        "tags": [
          "Vehicle Operations"
        ],
        "summary": "Get the available Vehicle Commands and associated Parameters",
        "description": "Returns available vehicle command options and configurable parameters.",
        "operationId": "vehicle_commands",
        "responses": {
          "200": {
            "description": "Available vehicle command options and parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleCommandOptionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/motion-commands": {
      "get": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Get the available motion commands",
        "description": "Returns available motion commands that can be sent to the Polymath system.",
        "operationId": "get_nav_cmds",
        "responses": {
          "200": {
            "description": "Available motion command names and numeric alternatives.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionCommandListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/reference-targets": {
      "get": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Get all previously set reference targets",
        "description": "Returns all previously set reference targets.",
        "operationId": "reference_targets",
        "responses": {
          "200": {
            "description": "All previously set reference targets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceTargetsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Set the location and details of a reference location or an object",
        "description": "Sets one or more reference targets for relative navigation. Each target may include optional `time_validity` and `recorded_speed_m_s` metadata. Use `POST /relative-waypoints` to send waypoints relative to these targets.",
        "operationId": "set_reference_targets",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferenceTargetsModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sent reference targets and upstream service response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceTargetSetResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/reference-targets/current-location": {
      "post": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Set a reference target at the current robot location",
        "description": "Creates a `previous_location` reference target from the robot's current GPS pose for subsequent relative navigation.",
        "operationId": "set_reference_target_current_location",
        "responses": {
          "200": {
            "description": "Generated current-location reference target and upstream service response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceTargetSetResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/gps-waypoints": {
      "post": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Send a set of gps waypoints to the robot",
        "description": "Sends GPS waypoints and navigation options to the robot.",
        "operationId": "gps_waypoints",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GPSWaypoints"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sent GPS waypoints and upstream service response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GPSWaypointTransmissionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/relative-waypoints": {
      "post": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Send a set of relative waypoints to the robot",
        "description": "Sends relative waypoints and navigation options to the robot.",
        "operationId": "relative_waypoints",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelativeWaypoints"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sent relative waypoints and upstream service response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RelativeWaypointTransmissionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/motion-command": {
      "post": {
        "tags": [
          "Vehicle Autonomy"
        ],
        "summary": "Send a motion command to the robot to change its current state",
        "description": "Sends a motion command to change the robot motion state. Supported commands: `STOP` (0), `PAUSE` (1), and `RESUME` (2).",
        "operationId": "nav_cmd",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MotionCommandAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Motion command execution response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionCommandExecutionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/vehicle-command": {
      "post": {
        "tags": [
          "Vehicle Operations"
        ],
        "summary": "Send a vehicle command to the robot",
        "description": "Sends a vehicle command to the robot.",
        "operationId": "vehicle_command",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleCommandAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sent vehicle command and upstream service response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleCommandResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/media/streams": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "List Media Devices",
        "operationId": "list_media_devices",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response List Media Devices V2 Media Streams Get",
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/BaseStream"
                      },
                      {
                        "$ref": "#/components/schemas/BaseStream"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/livekit/config": {
      "get": {
        "tags": [
          "Livekit"
        ],
        "summary": "Get LiveKit discovery configuration",
        "description": "Returns the configured discovery values and effective LiveKit URL.",
        "operationId": "get_livekit_config",
        "responses": {
          "200": {
            "description": "Effective LiveKit discovery values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitConfigResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/livekit/token": {
      "post": {
        "tags": [
          "Livekit"
        ],
        "summary": "Generate a Livekit access token",
        "description": "Generates a LiveKit access token for the specified identity and room.",
        "operationId": "generate_livekit_token",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Identity",
              "type": "string"
            },
            "name": "identity",
            "in": "query"
          },
          {
            "required": true,
            "schema": {
              "title": "Room Name",
              "type": "string"
            },
            "name": "room_name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Generated LiveKit access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Failed to generate token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/livekit/room": {
      "get": {
        "tags": [
          "Livekit"
        ],
        "summary": "Get the current status of the room",
        "description": "Returns the current LiveKit room status.",
        "operationId": "get_room",
        "responses": {
          "200": {
            "description": "Current LiveKit room status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitRoomResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Livekit"
        ],
        "summary": "Create a livekit room on this robot",
        "description": "Connects this robot to the specified LiveKit room.",
        "operationId": "create_room",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Room Name",
              "type": "string"
            },
            "name": "room_name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Room status after connecting to LiveKit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitRoomResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid room request (for example, empty or invalid room name)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to connect to the room",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Livekit"
        ],
        "summary": "Disconnect from the current room",
        "description": "Disconnects this robot from the current LiveKit room.",
        "operationId": "delete_room",
        "responses": {
          "200": {
            "description": "Room status after disconnecting from LiveKit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitRoomResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to disconnect the room",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/livekit/room/track": {
      "post": {
        "tags": [
          "Livekit"
        ],
        "summary": "Create a track on the current room",
        "description": "Creates and publishes a track in the current LiveKit room.",
        "operationId": "create_track",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            },
            "name": "name",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Fps",
              "type": "integer",
              "default": 30
            },
            "name": "fps",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/CodecEnum"
                }
              ],
              "default": "H264"
            },
            "name": "codec",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/MediaTypeEnum"
                }
              ],
              "default": "media_device"
            },
            "name": "media_type",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Stream Path",
              "type": "string"
            },
            "name": "stream_path",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Use Experimental Reader",
              "type": "boolean",
              "default": false
            },
            "name": "use_experimental_reader",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Width",
              "type": "integer"
            },
            "name": "width",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Height",
              "type": "integer"
            },
            "name": "height",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Max Bitrate Kbps",
              "type": "integer"
            },
            "name": "max_bitrate_kbps",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Room status after track creation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitRoomResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid track request (for example, no room, invalid configuration, or duplicate track name)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to publish track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Livekit"
        ],
        "summary": "Delete a track from the current room",
        "description": "Deletes a track from the current LiveKit room.",
        "operationId": "delete_track",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            },
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Room status after track deletion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LivekitRoomResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid track delete request (for example, no room or track does not exist)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to delete track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/canbus/interfaces": {
      "get": {
        "tags": [
          "CANBus"
        ],
        "summary": "Get the list of available CAN interfaces on the system",
        "description": "Returns available CAN interfaces on the system.",
        "operationId": "get_can_interfaces",
        "responses": {
          "200": {
            "description": "Available CAN interfaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanInterfaceListResponse"
                }
              }
            }
          },
          "404": {
            "description": "Failed to retrieve CAN interfaces",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/teleop-control/acquire": {
      "post": {
        "tags": [
          "Teleop Control"
        ],
        "summary": "Acquire control lease granting exclusive access to teleop",
        "description": "Acquire control lease if none exists or has expired.",
        "operationId": "acquire_lease",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlResponse"
                }
              }
            }
          },
          "403": {
            "description": "Lease is unavailable or not held by the requesting user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v2/teleop-control/renew": {
      "post": {
        "tags": [
          "Teleop Control"
        ],
        "summary": "Renew existing control lease",
        "description": "Renew an existing lease. Only the current lease holder can renew.",
        "operationId": "renew_lease",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlResponse"
                }
              }
            }
          },
          "403": {
            "description": "Lease is unavailable or not held by the requesting user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v2/teleop-control/release": {
      "post": {
        "tags": [
          "Teleop Control"
        ],
        "summary": "Release the current control lease",
        "description": "Explicitly release the current lease.",
        "operationId": "release_lease",
        "parameters": [
          {
            "description": "If true, release the lease regardless of who holds it. Requires valid bearer token; no additional admin validation exists.",
            "required": false,
            "schema": {
              "title": "Force",
              "type": "boolean",
              "description": "If true, release the lease regardless of who holds it. Requires valid bearer token; no additional admin validation exists.",
              "default": false
            },
            "name": "force",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlResponse"
                }
              }
            }
          },
          "403": {
            "description": "Lease is unavailable or not held by the requesting user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v2/teleop-control/transfer": {
      "post": {
        "tags": [
          "Teleop Control"
        ],
        "summary": "Transfer control lease to another user",
        "description": "Transfer the lease to another user. Only the current lease holder can transfer.",
        "operationId": "transfer_lease",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferLeaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlResponse"
                }
              }
            }
          },
          "403": {
            "description": "Lease is unavailable or not held by the requesting user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v2/teleop-control/status": {
      "get": {
        "tags": [
          "Teleop Control"
        ],
        "summary": "Get current control lease status",
        "description": "Get current lease status and lease holder identity.",
        "operationId": "get_lease_status",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/systemd/{path}": {
      "get": {
        "tags": [
          "systemd"
        ],
        "summary": "Proxy Systemd Request",
        "description": "Reverse proxy for Polymath systemd API requests. Please refer to the API documentation for details on available endpoints.\n\nForwards all requests under /v2/systemd/* to the systemd API service\nat POLYMATH_SYSTEMD_API_IP:POLYMATH_SYSTEMD_API_PORT.\n\nE.g. to list user services, send a GET request to: `/v2/systemd/list/user`",
        "operationId": "proxy_systemd_request",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            },
            "name": "path",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "systemd"
        ],
        "summary": "Proxy Systemd Request",
        "description": "Reverse proxy for Polymath systemd API requests. Please refer to the API documentation for details on available endpoints.\n\nForwards all requests under /v2/systemd/* to the systemd API service\nat POLYMATH_SYSTEMD_API_IP:POLYMATH_SYSTEMD_API_PORT.\n\nE.g. to list user services, send a GET request to: `/v2/systemd/list/user`",
        "operationId": "proxy_systemd_request",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            },
            "name": "path",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/fs/health": {
      "get": {
        "tags": [
          "filesystem",
          "filesystem"
        ],
        "summary": "Health check for dufs service",
        "description": "Checks whether the dufs service is reachable. Always returns HTTP 200 and reports health in the response body.",
        "operationId": "health_check",
        "responses": {
          "200": {
            "description": "Service health status (healthy or degraded)",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v2/fs/recursive-list": {
      "get": {
        "tags": [
          "filesystem",
          "filesystem"
        ],
        "summary": "List files and directories recursively",
        "description": "Returns a recursive file and directory tree from the robot data directory.",
        "operationId": "list_files_and_directories",
        "parameters": [
          {
            "required": false,
            "schema": {
              "title": "Depth",
              "type": "integer",
              "default": 5
            },
            "name": "depth",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Path",
              "type": "string",
              "default": "/"
            },
            "name": "path",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List of files and directories",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "503": {
            "description": "Service unavailable"
          },
          "504": {
            "description": "Request timed out"
          },
          "500": {
            "description": "Internal server error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/fs/{path}": {
      "get": {
        "tags": [
          "filesystem",
          "filesystem"
        ],
        "summary": "Get file or directory",
        "description": "Returns file content or a directory listing from the robot data directory. Use `?zip` to download a zip archive. Use `?json` for directory listings in JSON format.",
        "operationId": "get_file_or_directory",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            },
            "name": "path",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "File content or directory listing",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "File or directory not found"
          },
          "503": {
            "description": "Service unavailable"
          },
          "504": {
            "description": "Request timed out"
          },
          "500": {
            "description": "Internal server error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "filesystem",
          "filesystem"
        ],
        "summary": "Delete file or directory",
        "description": "Deletes a file or directory from the robot data directory.",
        "operationId": "delete_file_or_directory",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            },
            "name": "path",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "204": {
            "description": "File or directory deleted successfully"
          },
          "404": {
            "description": "File or directory not found"
          },
          "503": {
            "description": "Service unavailable"
          },
          "504": {
            "description": "Request timed out"
          },
          "500": {
            "description": "Internal server error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/ros/{path}": {
      "get": {
        "tags": [
          "ros"
        ],
        "summary": "Proxy Systemd Request",
        "description": "Reverse proxy for RESTful ROS2 API requests. Please refer to the API documentation for details on available endpoints.",
        "operationId": "proxy_systemd_request",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            },
            "name": "path",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ros"
        ],
        "summary": "Proxy Systemd Request",
        "description": "Reverse proxy for RESTful ROS2 API requests. Please refer to the API documentation for details on available endpoints.",
        "operationId": "proxy_systemd_request",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            },
            "name": "path",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BaseStream": {
        "title": "BaseStream",
        "required": [
          "media_type"
        ],
        "type": "object",
        "properties": {
          "media_type": {
            "$ref": "#/components/schemas/MediaTypeEnum"
          },
          "data": {
            "title": "Data"
          }
        },
        "description": "Abstract base class for generic types.\n\nOn Python 3.12 and newer, generic classes implicitly inherit from\nGeneric when they declare a parameter list after the class's name::\n\n    class Mapping[KT, VT]:\n        def __getitem__(self, key: KT) -> VT:\n            ...\n        # Etc.\n\nOn older versions of Python, however, generic classes have to\nexplicitly inherit from Generic.\n\nAfter a class has been declared to be generic, it can then be used as\nfollows::\n\n    def lookup_name[KT, VT](mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:\n        try:\n            return mapping[key]\n        except KeyError:\n            return default"
      },
      "CanInterfaceListResponse": {
        "title": "CanInterfaceListResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "title": "Data",
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CodecEnum": {
        "title": "CodecEnum",
        "enum": [
          "VP8",
          "H264",
          "AV1",
          "VP9"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "CommandMode": {
        "title": "CommandMode",
        "enum": [
          0,
          1
        ],
        "description": "An enumeration."
      },
      "ControlLease": {
        "title": "ControlLease",
        "type": "object",
        "properties": {
          "holder_id": {
            "title": "Holder Id",
            "type": "string"
          },
          "expires_at": {
            "title": "Expires At",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ControlResponse": {
        "title": "ControlResponse",
        "required": [
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "enum": [
              "success"
            ],
            "type": "string",
            "description": "JSend status",
            "default": "success"
          },
          "message": {
            "title": "Message",
            "type": "string",
            "description": "Human readable message"
          },
          "data": {
            "title": "Data",
            "allOf": [
              {
                "$ref": "#/components/schemas/ControlLease"
              }
            ],
            "description": "Current lease data"
          }
        },
        "description": "Model for successful responses in the control API"
      },
      "CortexNavigationOptions": {
        "title": "CortexNavigationOptions",
        "type": "object",
        "properties": {
          "path_option": {
            "title": "Path Option",
            "allOf": [
              {
                "$ref": "#/components/schemas/CortexOption"
              }
            ],
            "description": "Navigation path logic option to set. See the GET /navigation-path-options endpoint for the available path options and their parameters.",
            "example": {
              "name": "target_follower",
              "params": [
                {
                  "key": "speed",
                  "value": "0.5"
                }
              ]
            }
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandMode"
              }
            ],
            "description": "Mode of execution of previous and current waypoints. Available options: 'ADD','PREEMPT'. ADD or 0: Add a new waypoint to existing queue of waypoints, PREEMPT or 1: Delete the existing queue and adds the new waypoint.",
            "default": 0,
            "example": "ADD"
          }
        }
      },
      "CortexOption": {
        "title": "CortexOption",
        "required": [
          "name",
          "params"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "params": {
            "title": "Params",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            }
          }
        }
      },
      "CortexStatus": {
        "title": "CortexStatus",
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/CortexStatusEnum"
          },
          "status_text": {
            "title": "Status Text",
            "type": "string",
            "default": ""
          },
          "description": {
            "title": "Description",
            "type": "string"
          }
        }
      },
      "CortexStatusEnum": {
        "title": "CortexStatusEnum",
        "enum": [
          0,
          1,
          2,
          3,
          4
        ],
        "description": "An enumeration."
      },
      "CostmapBoundaryResponse": {
        "title": "CostmapBoundaryResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/GeofenceBoundary"
          }
        }
      },
      "ErrorDetails": {
        "title": "ErrorDetails",
        "required": [
          "details"
        ],
        "type": "object",
        "properties": {
          "details": {
            "title": "Details",
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "title": "ErrorResponse",
        "required": [
          "status",
          "message"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "enum": [
              "error"
            ],
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDetails"
          }
        }
      },
      "GPSWaypointTransmissionData": {
        "title": "GPSWaypointTransmissionData",
        "required": [
          "sent"
        ],
        "type": "object",
        "properties": {
          "sent": {
            "$ref": "#/components/schemas/GPSWaypoints"
          },
          "received": {
            "title": "Received"
          }
        }
      },
      "GPSWaypointTransmissionResponse": {
        "title": "GPSWaypointTransmissionResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/GPSWaypointTransmissionData"
          }
        }
      },
      "GPSWaypoints": {
        "title": "GPSWaypoints",
        "required": [
          "goals"
        ],
        "type": "object",
        "properties": {
          "timestamp_utc": {
            "title": "Timestamp Utc",
            "type": "string",
            "description": "Timestamp in UTC ISO format. Should be provided in ISO 8601 format: 'YYYY-MM-DDTHH:MM:SSZ'. If not provided, it will default to the current UTC time.",
            "default": ""
          },
          "goals": {
            "title": "Goals",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoalPoses"
            },
            "description": "Ordered list of GPS waypoints. When multiple waypoints are provided, the robot navigates through them continuously as a single path rather than stopping discretely at each one."
          },
          "navigation_options": {
            "title": "Navigation Options",
            "allOf": [
              {
                "$ref": "#/components/schemas/CortexNavigationOptions"
              }
            ],
            "description": "Optional navigation options for this command, including the path logic option and execution mode. See the GET /navigation-path-options endpoint for the available path options and their parameters."
          }
        }
      },
      "GeoPoint": {
        "title": "GeoPoint",
        "required": [
          "lat",
          "lon"
        ],
        "type": "object",
        "properties": {
          "lat": {
            "title": "Lat",
            "type": "number",
            "description": "Latitude"
          },
          "lon": {
            "title": "Lon",
            "type": "number",
            "description": "Longitude"
          },
          "altitude": {
            "title": "Altitude",
            "type": "number",
            "description": "Altitude (meters)"
          },
          "yaw": {
            "title": "Yaw",
            "type": "number",
            "description": "Yaw (radians). Robot body frame: x forward, y left, z up; positive yaw is counter-clockwise."
          }
        }
      },
      "GeofenceBoundary": {
        "title": "GeofenceBoundary",
        "required": [
          "bottom_left",
          "bottom_right",
          "top_left",
          "top_right"
        ],
        "type": "object",
        "properties": {
          "bottom_left": {
            "$ref": "#/components/schemas/NavSatFixModel"
          },
          "bottom_right": {
            "$ref": "#/components/schemas/NavSatFixModel"
          },
          "top_left": {
            "$ref": "#/components/schemas/NavSatFixModel"
          },
          "top_right": {
            "$ref": "#/components/schemas/NavSatFixModel"
          }
        }
      },
      "GoalInfo": {
        "title": "GoalInfo",
        "required": [
          "stamp"
        ],
        "type": "object",
        "properties": {
          "goal_id": {
            "$ref": "#/components/schemas/UUID"
          },
          "stamp": {
            "$ref": "#/components/schemas/Stamp"
          }
        }
      },
      "GoalPoses": {
        "title": "GoalPoses",
        "required": [
          "lat",
          "lon"
        ],
        "type": "object",
        "properties": {
          "timestamp_utc": {
            "title": "Timestamp Utc",
            "type": "string",
            "description": "Timestamp in UTC ISO format. Should be provided in ISO 8601 format: 'YYYY-MM-DDTHH:MM:SSZ'. If not provided, it will default to the current UTC time.",
            "default": ""
          },
          "lat": {
            "title": "Lat",
            "type": "number",
            "description": "Latitude"
          },
          "lon": {
            "title": "Lon",
            "type": "number",
            "description": "Longitude"
          },
          "yaw": {
            "title": "Yaw",
            "type": "number",
            "description": "Yaw (radians). 0.0 indicates east. positive yaw is counter-clockwise."
          }
        }
      },
      "HTTPExceptionResponse": {
        "title": "HTTPExceptionResponse",
        "required": [
          "detail"
        ],
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          }
        },
        "description": "Response model for HTTPException errors."
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "Header": {
        "title": "Header",
        "required": [
          "stamp",
          "frame_id"
        ],
        "type": "object",
        "properties": {
          "stamp": {
            "$ref": "#/components/schemas/Stamp"
          },
          "frame_id": {
            "title": "Frame Id",
            "type": "string"
          }
        }
      },
      "HealthStatusResponse": {
        "title": "HealthStatusResponse",
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          }
        }
      },
      "KeyValuePair": {
        "title": "KeyValuePair",
        "required": [
          "key",
          "value"
        ],
        "type": "object",
        "properties": {
          "key": {
            "title": "Key",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        }
      },
      "LivekitConfigResponse": {
        "title": "LivekitConfigResponse",
        "type": "object",
        "properties": {
          "room_name": {
            "title": "Room Name",
            "type": "string"
          },
          "bridge_identity": {
            "title": "Bridge Identity",
            "type": "string"
          },
          "livekit_url": {
            "title": "Livekit Url",
            "type": "string"
          }
        },
        "description": "Response model for environment-backed LiveKit discovery configuration."
      },
      "LivekitRoomDetails": {
        "title": "LivekitRoomDetails",
        "type": "object",
        "properties": {
          "room": {
            "$ref": "#/components/schemas/LivekitRoomInfo"
          },
          "hostname": {
            "title": "Hostname",
            "type": "string"
          },
          "tracks": {
            "title": "Tracks",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LivekitTrack"
            },
            "default": []
          }
        },
        "description": "Details about the current LiveKit room state."
      },
      "LivekitRoomInfo": {
        "title": "LivekitRoomInfo",
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "description": "Information about a connected LiveKit room."
      },
      "LivekitRoomResponse": {
        "title": "LivekitRoomResponse",
        "required": [
          "alive",
          "message",
          "room"
        ],
        "type": "object",
        "properties": {
          "alive": {
            "title": "Alive",
            "type": "boolean"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "room": {
            "$ref": "#/components/schemas/LivekitRoomDetails"
          }
        },
        "description": "Response model for LiveKit room operations."
      },
      "LivekitTokenResponse": {
        "title": "LivekitTokenResponse",
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "description": "Response model for LiveKit token generation."
      },
      "LivekitTrack": {
        "title": "LivekitTrack",
        "required": [
          "name",
          "codec",
          "fps",
          "media_type",
          "stream_path",
          "use_experimental_reader",
          "stats"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "sid": {
            "title": "Sid",
            "type": "string"
          },
          "codec": {
            "$ref": "#/components/schemas/CodecEnum"
          },
          "fps": {
            "title": "Fps",
            "type": "number"
          },
          "media_type": {
            "$ref": "#/components/schemas/MediaTypeEnum"
          },
          "stream_path": {
            "title": "Stream Path",
            "type": "string"
          },
          "use_experimental_reader": {
            "title": "Use Experimental Reader",
            "type": "boolean"
          },
          "stats": {
            "$ref": "#/components/schemas/LivekitTrackStats"
          },
          "width": {
            "title": "Width",
            "type": "integer"
          },
          "height": {
            "title": "Height",
            "type": "integer"
          },
          "max_bitrate_kbps": {
            "title": "Max Bitrate Kbps",
            "type": "integer"
          }
        },
        "description": "Track information for API responses, including configuration and runtime data."
      },
      "LivekitTrackStats": {
        "title": "LivekitTrackStats",
        "type": "object",
        "properties": {
          "timestamp": {
            "title": "Timestamp",
            "type": "number",
            "default": 0.0
          },
          "fps": {
            "title": "Fps",
            "allOf": [
              {
                "$ref": "#/components/schemas/Metric"
              }
            ],
            "default": {
              "p50": 0.0,
              "p95": 0.0,
              "p99": 0.0
            }
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer",
            "default": 0
          }
        }
      },
      "MediaTypeEnum": {
        "title": "MediaTypeEnum",
        "enum": [
          "media_device",
          "rtsp",
          "ros",
          "gstream"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "Metric": {
        "title": "Metric",
        "required": [
          "p50",
          "p95",
          "p99"
        ],
        "type": "object",
        "properties": {
          "p50": {
            "title": "P50",
            "type": "number"
          },
          "p95": {
            "title": "P95",
            "type": "number"
          },
          "p99": {
            "title": "P99",
            "type": "number"
          }
        }
      },
      "MotionCommandAction": {
        "title": "MotionCommandAction",
        "type": "object",
        "properties": {
          "motion_command": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MotionCommandOptions"
              }
            ],
            "description": "Motion command options. STOP (0) will cancel all current and queued navigation or vehicle commands. When in STOP, no new commands will be added to the queue until resumed. PAUSE (1) will pause the current command execution, leaving remaining commands in the queue, and RESUME (2) will resume the paused waypoint execution and place the autonomy state back to IDLE if the queue is empty.",
            "default": 0
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandMode"
              }
            ],
            "description": "Mode of execution of previous and current waypoints. Available options: 'ADD','PREEMPT'. ADD or 0: Add a new waypoint to existing queue of waypoints, PREEMPT or 1: Delete the existing queue and adds the new waypoint.",
            "default": 1,
            "example": "PREEMPT"
          }
        }
      },
      "MotionCommandExecutionData": {
        "title": "MotionCommandExecutionData",
        "type": "object",
        "properties": {
          "received": {
            "title": "Received"
          }
        }
      },
      "MotionCommandExecutionResponse": {
        "title": "MotionCommandExecutionResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/MotionCommandExecutionData"
          }
        }
      },
      "MotionCommandListResponse": {
        "title": "MotionCommandListResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "title": "Data",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MotionCommandSummary"
            }
          }
        }
      },
      "MotionCommandOptions": {
        "title": "MotionCommandOptions",
        "enum": [
          0,
          1,
          2
        ],
        "description": "An enumeration."
      },
      "MotionCommandSummary": {
        "title": "MotionCommandSummary",
        "required": [
          "motion_command",
          "alternative"
        ],
        "type": "object",
        "properties": {
          "motion_command": {
            "title": "Motion Command",
            "type": "string"
          },
          "alternative": {
            "title": "Alternative",
            "type": "integer"
          }
        }
      },
      "NavSatFixModel": {
        "title": "NavSatFixModel",
        "required": [
          "latitude",
          "longitude",
          "altitude"
        ],
        "type": "object",
        "properties": {
          "latitude": {
            "title": "Latitude",
            "type": "number"
          },
          "longitude": {
            "title": "Longitude",
            "type": "number"
          },
          "altitude": {
            "title": "Altitude",
            "type": "number"
          }
        }
      },
      "NavigationFeedback": {
        "title": "NavigationFeedback",
        "type": "object",
        "properties": {
          "nav2_goal_status": {
            "$ref": "#/components/schemas/NavigationGoalStatus"
          },
          "total_distance_remaining": {
            "title": "Total Distance Remaining",
            "type": "number",
            "description": "Total remaining distance to the goal, in meters."
          },
          "target_pose": {
            "$ref": "#/components/schemas/PoseWithHeader"
          },
          "final_pose": {
            "$ref": "#/components/schemas/PoseWithHeader"
          },
          "current_pose_index": {
            "title": "Current Pose Index",
            "type": "integer"
          },
          "number_of_poses_remaining": {
            "title": "Number Of Poses Remaining",
            "type": "integer"
          },
          "navigation_time": {
            "title": "Navigation Time",
            "allOf": [
              {
                "$ref": "#/components/schemas/Stamp"
              }
            ],
            "description": "Elapsed navigation time as a duration (seconds and nanoseconds)."
          },
          "estimated_time_remaining": {
            "title": "Estimated Time Remaining",
            "allOf": [
              {
                "$ref": "#/components/schemas/Stamp"
              }
            ],
            "description": "Estimated time remaining as a duration (seconds and nanoseconds)."
          }
        }
      },
      "NavigationGoalStatus": {
        "title": "NavigationGoalStatus",
        "required": [
          "goal_info",
          "status"
        ],
        "type": "object",
        "properties": {
          "goal_info": {
            "$ref": "#/components/schemas/GoalInfo"
          },
          "status": {
            "$ref": "#/components/schemas/Ros2ActionServerGoalStatus"
          },
          "status_text": {
            "title": "Status Text",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        }
      },
      "Orientation": {
        "title": "Orientation",
        "required": [
          "x",
          "y",
          "z",
          "w"
        ],
        "type": "object",
        "properties": {
          "x": {
            "title": "X",
            "type": "number"
          },
          "y": {
            "title": "Y",
            "type": "number"
          },
          "z": {
            "title": "Z",
            "type": "number"
          },
          "w": {
            "title": "W",
            "type": "number"
          }
        }
      },
      "PathLogicOptionResponse": {
        "title": "PathLogicOptionResponse",
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "title": "Data",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CortexOption"
            }
          }
        }
      },
      "PolymathFeedback": {
        "title": "PolymathFeedback",
        "required": [
          "navigation_feedback",
          "vehicle_feedback",
          "current_pose",
          "current_command_index",
          "number_commands_remaining"
        ],
        "type": "object",
        "properties": {
          "timestamp_utc": {
            "title": "Timestamp Utc",
            "allOf": [
              {
                "$ref": "#/components/schemas/TimeStamp"
              }
            ],
            "default": {}
          },
          "cortex_status": {
            "$ref": "#/components/schemas/CortexStatus"
          },
          "navigation_feedback": {
            "$ref": "#/components/schemas/NavigationFeedback"
          },
          "vehicle_feedback": {
            "$ref": "#/components/schemas/VehicleFeedback"
          },
          "current_pose": {
            "$ref": "#/components/schemas/PoseWithHeader"
          },
          "current_command_index": {
            "title": "Current Command Index",
            "type": "integer"
          },
          "number_commands_remaining": {
            "title": "Number Commands Remaining",
            "type": "integer"
          }
        }
      },
      "PolymathFeedbackData": {
        "title": "PolymathFeedbackData",
        "required": [
          "polymath_feedback"
        ],
        "type": "object",
        "properties": {
          "polymath_feedback": {
            "$ref": "#/components/schemas/PolymathFeedback"
          }
        }
      },
      "PolymathFeedbackResponse": {
        "title": "PolymathFeedbackResponse",
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/PolymathFeedbackData"
          }
        }
      },
      "Pose": {
        "title": "Pose",
        "required": [
          "position",
          "orientation"
        ],
        "type": "object",
        "properties": {
          "position": {
            "$ref": "#/components/schemas/Position"
          },
          "orientation": {
            "$ref": "#/components/schemas/Orientation"
          }
        }
      },
      "PoseWithHeader": {
        "title": "PoseWithHeader",
        "required": [
          "header",
          "pose"
        ],
        "type": "object",
        "properties": {
          "header": {
            "$ref": "#/components/schemas/Header"
          },
          "pose": {
            "$ref": "#/components/schemas/Pose"
          }
        }
      },
      "Position": {
        "title": "Position",
        "required": [
          "latitude",
          "longitude",
          "altitude"
        ],
        "type": "object",
        "properties": {
          "latitude": {
            "title": "Latitude",
            "type": "number"
          },
          "longitude": {
            "title": "Longitude",
            "type": "number"
          },
          "altitude": {
            "title": "Altitude",
            "type": "number"
          }
        }
      },
      "ReferenceTarget": {
        "title": "ReferenceTarget",
        "required": [
          "pose"
        ],
        "type": "object",
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": "string",
            "description": "Unique name or ID of the reference target",
            "default": "string"
          },
          "timestamp_utc": {
            "title": "Timestamp Utc",
            "type": "string",
            "description": "Timestamp in UTC ISO format. Should be provided in ISO 8601 format: 'YYYY-MM-DDTHH:MM:SSZ'. If not provided, it will default to the current UTC time."
          },
          "pose": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "time_validity": {
            "title": "Time Validity",
            "type": "number",
            "description": "Time validity in seconds. -1 means forever.",
            "default": -1
          },
          "recorded_speed_m_s": {
            "title": "Recorded Speed M S",
            "type": "number",
            "description": "Recorded speed of the object in m/s. `None` indicates no measurement available."
          }
        }
      },
      "ReferenceTargetSetData": {
        "title": "ReferenceTargetSetData",
        "required": [
          "sent"
        ],
        "type": "object",
        "properties": {
          "sent": {
            "$ref": "#/components/schemas/ReferenceTargetsModel"
          },
          "received": {
            "title": "Received"
          }
        }
      },
      "ReferenceTargetSetResponse": {
        "title": "ReferenceTargetSetResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ReferenceTargetSetData"
          }
        }
      },
      "ReferenceTargetsModel": {
        "title": "ReferenceTargetsModel",
        "required": [
          "reference_targets"
        ],
        "type": "object",
        "properties": {
          "reference_targets": {
            "title": "Reference Targets",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferenceTarget"
            }
          }
        }
      },
      "ReferenceTargetsResponse": {
        "title": "ReferenceTargetsResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ReferenceTargetsModel"
          }
        }
      },
      "RelativeCommand": {
        "title": "RelativeCommand",
        "type": "object",
        "properties": {
          "timestamp_utc": {
            "title": "Timestamp Utc",
            "type": "string",
            "description": "Timestamp in UTC ISO format. Should be provided in ISO 8601 format: 'YYYY-MM-DDTHH:MM:SSZ'. If not provided, it will default to the current UTC time.",
            "default": ""
          },
          "x": {
            "title": "X",
            "type": "number",
            "description": "Offset distance in meters along the X axis.",
            "default": 0.0
          },
          "y": {
            "title": "Y",
            "type": "number",
            "description": "Offset distance in meters along the Y axis.",
            "default": 0.0
          },
          "z": {
            "title": "Z",
            "type": "number",
            "description": "Offset distance in meters along the Z axis.",
            "default": 0.0
          },
          "yaw": {
            "title": "Yaw",
            "type": "number",
            "description": "Yaw (radians) angular offset indicating the direction the robot should face relative to the target.",
            "default": 0.0
          }
        }
      },
      "RelativeWaypointTransmissionData": {
        "title": "RelativeWaypointTransmissionData",
        "required": [
          "sent"
        ],
        "type": "object",
        "properties": {
          "sent": {
            "$ref": "#/components/schemas/RelativeWaypoints"
          },
          "received": {
            "title": "Received"
          }
        }
      },
      "RelativeWaypointTransmissionResponse": {
        "title": "RelativeWaypointTransmissionResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RelativeWaypointTransmissionData"
          }
        }
      },
      "RelativeWaypoints": {
        "title": "RelativeWaypoints",
        "required": [
          "move_to"
        ],
        "type": "object",
        "properties": {
          "relative_to": {
            "title": "Relative To",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ReferenceTarget"
              }
            ],
            "description": "The target that waypoints are specified relative to. Accepts either a name as string or a fully specified ReferenceTarget. The name can be 'current_position', a previously set ReferenceTarget, or the name of a frame in the transform tree, such as 'base_link'. Unknown strings are passed through verbatim and will fail downstream if the reference does not exist. Defaults to 'current_position' so waypoints are interpreted relative to the robot's current pose.",
            "default": "current_position"
          },
          "timestamp_utc": {
            "title": "Timestamp Utc",
            "type": "string",
            "description": "Timestamp in UTC ISO format. Should be provided in ISO 8601 format: 'YYYY-MM-DDTHH:MM:SSZ'. If not provided, it will default to the current UTC time.",
            "default": ""
          },
          "move_to": {
            "title": "Move To",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RelativeCommand"
            },
            "description": "Ordered list of relative waypoints. When multiple waypoints are provided, the robot navigates through them continuously as a single path rather than stopping discretely at each one. Robot body frame: x forward, y left, z up; positive yaw is counter-clockwise."
          },
          "navigation_options": {
            "title": "Navigation Options",
            "allOf": [
              {
                "$ref": "#/components/schemas/CortexNavigationOptions"
              }
            ],
            "description": "Optional navigation options for this command, including the path logic option and execution mode. See the GET /navigation-path-options endpoint for the available path options and their parameters."
          }
        }
      },
      "Ros2ActionServerGoalStatus": {
        "title": "Ros2ActionServerGoalStatus",
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "description": "An enumeration."
      },
      "Stamp": {
        "title": "Stamp",
        "type": "object",
        "properties": {
          "sec": {
            "title": "Sec",
            "type": "integer"
          },
          "nanosec": {
            "title": "Nanosec",
            "type": "integer"
          }
        }
      },
      "TimeStamp": {
        "title": "TimeStamp",
        "type": "object",
        "properties": {
          "sec": {
            "title": "Sec",
            "type": "integer"
          },
          "nanosec": {
            "title": "Nanosec",
            "type": "integer"
          }
        }
      },
      "TransferLeaseRequest": {
        "title": "TransferLeaseRequest",
        "required": [
          "to"
        ],
        "type": "object",
        "properties": {
          "to": {
            "title": "To",
            "type": "string",
            "description": "User ID to transfer lease to"
          }
        }
      },
      "UUID": {
        "title": "UUID",
        "required": [
          "uuid"
        ],
        "type": "object",
        "properties": {
          "uuid": {
            "title": "Uuid",
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "UUIDData": {
        "title": "UUIDData",
        "required": [
          "uuid"
        ],
        "type": "object",
        "properties": {
          "uuid": {
            "title": "Uuid",
            "type": "string"
          }
        }
      },
      "UUIDResponse": {
        "title": "UUIDResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/UUIDData"
          }
        }
      },
      "ValidationError": {
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "title": "Location",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        }
      },
      "VehicleCommandAction": {
        "title": "VehicleCommandAction",
        "type": "object",
        "properties": {
          "vehicle_command": {
            "title": "Vehicle Command",
            "allOf": [
              {
                "$ref": "#/components/schemas/CortexOption"
              }
            ],
            "description": "Vehicle command to execute"
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandMode"
              }
            ],
            "description": "Mode of execution of previous and current waypoints. Available options: 'ADD','PREEMPT'. ADD or 0: Add a new waypoint to existing queue of waypoints, PREEMPT or 1: Delete the existing queue and adds the new waypoint.",
            "default": 0,
            "example": "ADD"
          }
        }
      },
      "VehicleCommandData": {
        "title": "VehicleCommandData",
        "required": [
          "sent",
          "received"
        ],
        "type": "object",
        "properties": {
          "sent": {
            "$ref": "#/components/schemas/VehicleCommandAction"
          },
          "received": {
            "title": "Received",
            "type": "object"
          }
        }
      },
      "VehicleCommandOptionResponse": {
        "title": "VehicleCommandOptionResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "title": "Data",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CortexOption"
            }
          }
        }
      },
      "VehicleCommandResponse": {
        "title": "VehicleCommandResponse",
        "required": [
          "status",
          "message",
          "data"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/VehicleCommandData"
          }
        }
      },
      "VehicleFeedback": {
        "title": "VehicleFeedback",
        "type": "object",
        "properties": {
          "state": {
            "title": "State",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "data": {
            "title": "Data",
            "type": "array",
            "items": {}
          }
        }
      },
      "VersionResponse": {
        "title": "VersionResponse",
        "required": [
          "commit_sha",
          "polymath_core_commit_sha"
        ],
        "type": "object",
        "properties": {
          "commit_sha": {
            "title": "Commit Sha",
            "type": "string"
          },
          "polymath_core_commit_sha": {
            "title": "Polymath Core Commit Sha",
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Health Check",
      "description": "Contains UUID endpoint that can be used to health check the robot"
    },
    {
      "name": "Vehicle Autonomy",
      "description": "All endpoints related to interacting with Robot's autonomy operations here"
    },
    {
      "name": "Vehicle Operations",
      "description": "All endpoints related to interacting with Robot's vehicle operations here"
    },
    {
      "name": "Media",
      "description": "All endpoints related to interacting with Robot's media resources"
    },
    {
      "name": "Teleop Control",
      "description": "Endpoints for managing control leases"
    }
  ]
}
