> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skyvexsoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pilot's current bids

> Every flight the authenticated pilot has currently bid on (and not yet flown or unbid). The Stratos client renders this as the **My Bookings** list. If the `pilots.only_flights_from_current` VA setting is enabled, bookings whose departure airport is not the pilot's current location are filtered out server-side.



## OpenAPI

````yaml /api-reference/openapi.json get /flights/bookings
openapi: 3.1.0
info:
  title: Stratos Core API
  version: 0.3.0
  summary: >-
    The Stratos VA API contract — auth, pilot identity, reference data, and the
    flight lifecycle.
  description: >-
    The contract every Stratos desktop client speaks to a virtual airline's crew
    system. The reference implementation is the open-source [stratos-core-api
    phpVMS 7 module](https://github.com/SkyvexSoftware/stratos-core-api), but
    any backend can implement these endpoints — they're framework-agnostic.


    Every endpoint in this reference is documented under `/api/stratos` — that's
    the convention the phpVMS module uses, and what we recommend for
    consistency. You're free to mount the surface anywhere you like; the desktop
    client just uses whatever base URL is set in your Stratos airline
    configuration.


    ## Authentication


    Most endpoints require a Bearer token — the pilot's API key, obtained via
    `POST /pilot/login` or your OAuth flow. Send as `Authorization: Bearer
    <api_key>` on every authenticated request.


    Public (no token): `GET /` and `POST /pilot/login`.


    ## Conventions


    - JSON, `snake_case` field names.

    - Distances in nautical miles, weights in pounds, flight times in decimal
    hours (unless suffixed `_minutes`).

    - Coordinates are decimal degrees (WGS84).

    - CORS is wide-open; the client preflights every method.
servers:
  - url: '{baseUrl}'
    description: >-
      Your VA's Stratos API base — set this to whatever URL the Stratos client
      is pointed at, including any path prefix you chose to mount the surface
      under.
    variables:
      baseUrl:
        default: https://crew.example.com/api/stratos
        description: >-
          Full base URL including the path prefix (no trailing slash). The
          phpVMS reference module mounts under `/api/stratos`; if you mounted
          yours somewhere else (e.g. `https://api.youva.com/stratos/v1`), use
          that.
security:
  - BearerAuth: []
tags:
  - name: Pilot
    description: Authentication, profile, and career statistics.
  - name: Reference Data
    description: Static lookup data the client renders in UI.
  - name: Flights
    description: >-
      Browse the schedule, manage bids, and run the active-flight lifecycle
      (start, update, complete, cancel).
paths:
  /flights/bookings:
    get:
      tags:
        - Flights
      summary: Pilot's current bids
      description: >-
        Every flight the authenticated pilot has currently bid on (and not yet
        flown or unbid). The Stratos client renders this as the **My Bookings**
        list. If the `pilots.only_flights_from_current` VA setting is enabled,
        bookings whose departure airport is not the pilot's current location are
        filtered out server-side.
      operationId: listBookings
      responses:
        '200':
          description: Array of bookings (may be empty).
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Booking'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Booking:
      type: object
      required:
        - bid_id
        - number
        - code
        - departure_airport
        - arrival_airport
        - route
        - flight_level
        - distance
        - departure_time
        - arrival_time
        - flight_time
        - days_of_week
        - type
        - aircraft
        - notes
      properties:
        bid_id:
          type: integer
          description: Unique bid ID. Used by `/flights/start` and `/flights/unbook`.
        number:
          type: string
          description: Flight number (no airline code).
        code:
          type: string
          description: Operating airline code.
        departure_airport:
          type: string
          description: Departure airport ID (ICAO).
          example: YSSY
        arrival_airport:
          type: string
          example: YMML
        route:
          type: array
          items:
            type: string
          description: >-
            Route waypoints split on whitespace. Empty array if no route is
            filed.
          example:
            - YSSY
            - DCT
            - RIC
            - YMML
        flight_level:
          type: string
          description: Cruise altitude as filed (free-form string, e.g. `360` or `FL360`).
        distance:
          type: number
          format: float
          description: >-
            Great-circle distance in the VA's configured local unit (typically
            nautical miles).
        departure_time:
          type: string
          description: Scheduled departure, free-form per VA setting.
          example: '0930'
        arrival_time:
          type: string
          example: '1145'
        flight_time:
          type: number
          format: float
          description: Scheduled flight time in decimal hours.
          example: 1.42
        days_of_week:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 6
          description: Days the flight operates (0 = Sunday). Empty if not configured.
        type:
          $ref: '#/components/schemas/FlightType'
        aircraft:
          type: integer
          nullable: true
          description: >-
            Aircraft ID assigned to the bid: the SimBrief airframe if set,
            otherwise the bid's aircraft. Null when no aircraft is assigned —
            the pilot must pick one (e.g. via /flights/change-aircraft) before
            starting.
        aircraft_changeable:
          type: boolean
          description: >-
            Whether the pilot may switch the aircraft for this bid before
            starting. False when the authenticated pilot has their own SimBrief
            OFP for this flight — per-pilot, so another pilot's OFP does not
            lock it. Drives the client's dropdown-vs-text rendering.
        notes:
          type: string
    FlightType:
      type: string
      enum:
        - P
        - C
      description: >-
        Coarse flight category derived from phpVMS's flight_type. `P` =
        passenger (scheduled/charter/extra/govt/other), `C` = cargo
        (ambulance/cargo/training/mail/military/positioning/special/general
        aviation/technical).
    Error:
      type: object
      properties:
        error:
          type: string
        success:
          type: boolean
        message:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid Bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: Invalid Token
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The pilot's API key, obtained via `POST /pilot/login` or your OAuth
        flow. Send as `Authorization: Bearer <api_key>` on every authenticated
        request.

````