{
  "openapi": "3.0.4",
  "info": {
    "title": "SpeakerTravel API",
    "contact": {
      "name": "SpeakerTravel Support",
      "email": "support@speaker.travel"
    },
    "version": "v1"
  },
  "paths": {
    "/api/v1/events": {
      "get": {
        "tags": [
          "Event"
        ],
        "operationId": "ListEvents",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/events/{eventSlug}": {
      "get": {
        "tags": [
          "Event"
        ],
        "operationId": "GetEventDetails",
        "parameters": [
          {
            "name": "eventSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/events/{eventSlug}/travellers": {
      "get": {
        "tags": [
          "Event",
          "Traveller"
        ],
        "operationId": "ListTravellers",
        "parameters": [
          {
            "name": "eventSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Traveller"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Event"
        ],
        "operationId": "InviteTraveller",
        "parameters": [
          {
            "name": "eventSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TravellerInvitation"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TravellerDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/events/{eventSlug}/travellers/{travellerId}": {
      "get": {
        "tags": [
          "Event",
          "Traveller"
        ],
        "operationId": "GetTravellerDetails",
        "parameters": [
          {
            "name": "eventSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "travellerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TravellerDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Booking": {
        "required": [
          "bookingType"
        ],
        "type": "object",
        "properties": {
          "bookingType": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "bookingType",
          "mapping": {
            "flight": "#/components/schemas/FlightBooking",
            "rail": "#/components/schemas/RailBooking"
          }
        }
      },
      "BookingClass": {
        "enum": [
          0,
          10,
          20,
          30,
          40
        ],
        "type": "integer",
        "description": "<p>Possible values:</p><ul><li><i>0</i> - Unknown</li><li><i>10</i> - Economy</li><li><i>20</i> - PremiumEconomy</li><li><i>30</i> - Business</li><li><i>40</i> - First</li></ul>",
        "format": "int32"
      },
      "BudgetType": {
        "enum": [
          0,
          10,
          99
        ],
        "type": "integer",
        "description": "<p>Possible values:</p><ul><li><i>0</i> - Default</li><li><i>10</i> - Fixed</li><li><i>99</i> - Disabled</li></ul>",
        "format": "int32"
      },
      "Event": {
        "type": "object",
        "properties": {
          "_links": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "Links to related resources"
          },
          "slug": {
            "type": "string",
            "description": "Event slug"
          },
          "name": {
            "type": "string",
            "description": "Name of the event",
            "nullable": true
          },
          "location": {
            "type": "string",
            "description": "Location of the event",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "description": "Start date",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "EventDetails": {
        "type": "object",
        "properties": {
          "_links": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "Links to related resources"
          },
          "slug": {
            "type": "string",
            "description": "Event slug"
          },
          "name": {
            "type": "string",
            "description": "Name of the event",
            "nullable": true
          },
          "location": {
            "type": "string",
            "description": "Location of the event",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "description": "Start date",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date",
            "format": "date-time"
          },
          "description": {
            "type": "string",
            "description": "Event description",
            "nullable": true
          },
          "websiteUrl": {
            "type": "string",
            "description": "Website URL",
            "nullable": true
          },
          "recommendedArrivalDate": {
            "type": "string",
            "description": "Recommended arrival date for travellers",
            "format": "date-time",
            "nullable": true
          },
          "recommendedDepartureDate": {
            "type": "string",
            "description": "Recommended departure date for travellers",
            "format": "date-time",
            "nullable": true
          },
          "earliestTravelDate": {
            "type": "string",
            "description": "Earliest date travellers can search",
            "format": "date-time",
            "nullable": true
          },
          "latestReturnDate": {
            "type": "string",
            "description": "Latest date travellers can search",
            "format": "date-time",
            "nullable": true
          },
          "nearestAirportIataCode": {
            "type": "string",
            "description": "Nearest airport IATA code",
            "nullable": true
          },
          "nearestAirportName": {
            "type": "string",
            "description": "Nearest airport name",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FlightBooking": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Booking"
          },
          {
            "type": "object",
            "properties": {
              "pnr": {
                "type": "string",
                "description": "Booking code (PNR)"
              },
              "passengerNames": {
                "type": "string",
                "description": "Passenger names"
              },
              "ticketNumbers": {
                "type": "string",
                "description": "Ticket numbers"
              },
              "airlineLocators": {
                "type": "string",
                "description": "Airline locators",
                "nullable": true
              },
              "flightSegments": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FlightSegment"
                },
                "description": "Flight segments"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "FlightSegment": {
        "type": "object",
        "properties": {
          "flightNumber": {
            "type": "string",
            "description": "Flight number"
          },
          "operator": {
            "type": "string",
            "description": "Flight operator"
          },
          "operatorIataCode": {
            "type": "string",
            "description": "Flight operator IATA code"
          },
          "marketingIataCode": {
            "type": "string",
            "description": "Flight marketing IATA code",
            "nullable": true
          },
          "equipment": {
            "type": "string",
            "description": "Equipment",
            "nullable": true
          },
          "cabinAndTicketClass": {
            "type": "string",
            "description": "Cabin and ticket class",
            "nullable": true
          },
          "departureDateTime": {
            "type": "string",
            "description": "Departure date and time",
            "format": "date-time"
          },
          "departureCity": {
            "type": "string",
            "description": "Departure city"
          },
          "departureAirport": {
            "type": "string",
            "description": "Departure airport"
          },
          "departureAirportTerminal": {
            "type": "string",
            "description": "Departure airport terminal",
            "nullable": true
          },
          "departureAirportIataCode": {
            "type": "string",
            "description": "Departure airport IATA code"
          },
          "arrivalDateTime": {
            "type": "string",
            "description": "Arrival date and time",
            "format": "date-time"
          },
          "arrivalCity": {
            "type": "string",
            "description": "Arrival city"
          },
          "arrivalAirport": {
            "type": "string",
            "description": "Arrival airport"
          },
          "arrivalAirportTerminal": {
            "type": "string",
            "description": "Arrival airport terminal",
            "nullable": true
          },
          "arrivalAirportIataCode": {
            "type": "string",
            "description": "Arrival airport IATA code"
          }
        },
        "additionalProperties": false
      },
      "HttpValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "RailBooking": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Booking"
          },
          {
            "type": "object",
            "properties": {
              "bookingReference": {
                "type": "string",
                "description": "Booking reference"
              },
              "ticketNumbers": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Ticket numbers (if available)",
                "nullable": true
              },
              "ticketDownloads": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Ticket downloads (if available)",
                "nullable": true
              },
              "railSegments": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RailSegment"
                },
                "description": "Rail segments"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "RailSegment": {
        "type": "object",
        "properties": {
          "departureDateTime": {
            "type": "string",
            "description": "Departure date and time",
            "format": "date-time"
          },
          "arrivalDateTime": {
            "type": "string",
            "description": "Arrival date and time",
            "format": "date-time"
          },
          "trainNumber": {
            "type": "string",
            "description": "Train number"
          },
          "operatingCarrier": {
            "type": "string",
            "description": "Operating carrier"
          },
          "marketingCarrier": {
            "type": "string",
            "description": "Marketing carrier"
          },
          "comfortCategory": {
            "type": "string",
            "description": "Comfort category",
            "nullable": true
          },
          "flexibility": {
            "type": "string",
            "description": "Flexibility",
            "nullable": true
          },
          "departureStation": {
            "type": "string",
            "description": "Departure station code"
          },
          "departureStationLabel": {
            "type": "string",
            "description": "Departure station label"
          },
          "arrivalStation": {
            "type": "string",
            "description": "Arrival station code"
          },
          "arrivalStationLabel": {
            "type": "string",
            "description": "Arrival station label"
          }
        },
        "additionalProperties": false
      },
      "Traveller": {
        "type": "object",
        "properties": {
          "_links": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "Links to related resources"
          },
          "eventSlug": {
            "type": "string",
            "description": "Event slug"
          },
          "eventName": {
            "type": "string",
            "description": "Name of the event"
          },
          "travellerId": {
            "type": "integer",
            "description": "Traveller id",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "Traveller name"
          },
          "email": {
            "type": "string",
            "description": "Traveller email"
          },
          "status": {
            "$ref": "#/components/schemas/TravellerStatus"
          },
          "spentAmount": {
            "type": "number",
            "description": "Amount spent",
            "format": "double"
          },
          "spentCurrency": {
            "type": "string",
            "description": "Amount spent currency"
          },
          "budgetType": {
            "$ref": "#/components/schemas/BudgetType"
          },
          "budgetAmount": {
            "type": "number",
            "description": "Budget amount",
            "format": "double"
          },
          "budgetCurrency": {
            "type": "string",
            "description": "Budget amount currency"
          },
          "budgetOverrunPercentage": {
            "type": "integer",
            "description": "Budget overrun percentage",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "TravellerDetails": {
        "type": "object",
        "properties": {
          "_links": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "Links to related resources"
          },
          "eventSlug": {
            "type": "string",
            "description": "Event slug"
          },
          "eventName": {
            "type": "string",
            "description": "Name of the event"
          },
          "travellerId": {
            "type": "integer",
            "description": "Traveller id",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "Traveller name"
          },
          "email": {
            "type": "string",
            "description": "Traveller email"
          },
          "status": {
            "$ref": "#/components/schemas/TravellerStatus"
          },
          "spentAmount": {
            "type": "number",
            "description": "Amount spent",
            "format": "double"
          },
          "spentCurrency": {
            "type": "string",
            "description": "Amount spent currency"
          },
          "budgetType": {
            "$ref": "#/components/schemas/BudgetType"
          },
          "budgetAmount": {
            "type": "number",
            "description": "Budget amount",
            "format": "double"
          },
          "budgetCurrency": {
            "type": "string",
            "description": "Budget amount currency"
          },
          "budgetOverrunPercentage": {
            "type": "integer",
            "description": "Budget overrun percentage",
            "format": "int32"
          },
          "invitationLink": {
            "type": "string",
            "description": "Traveller invitation link (when not accepted yet)",
            "nullable": true
          },
          "booking": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FlightBooking"
              },
              {
                "$ref": "#/components/schemas/RailBooking"
              }
            ],
            "description": "Booking",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TravellerInvitation": {
        "required": [
          "email",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string",
            "description": "Traveller name"
          },
          "email": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string",
            "description": "Traveller email"
          },
          "nearestAirportIataCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Nearest/departure airport (if known)",
            "nullable": true
          },
          "nearestStation": {
            "maxLength": 50,
            "type": "string",
            "description": "Nearest/departure station (if known)",
            "nullable": true
          },
          "allowedPassengers": {
            "maximum": 4,
            "minimum": 1,
            "type": "integer",
            "description": "Number of passengers allowed on booking",
            "format": "int32"
          },
          "allowedBookingClass": {
            "$ref": "#/components/schemas/BookingClass"
          },
          "allowBookingOneWay": {
            "type": "boolean",
            "description": "Can request a one-way flight"
          },
          "allowBookingRoundTrip": {
            "type": "boolean",
            "description": "Can request a round trip flight"
          },
          "allowBookingMultiCity": {
            "type": "boolean",
            "description": "Can request a multi-city flight"
          },
          "budgetType": {
            "$ref": "#/components/schemas/BudgetType"
          },
          "budgetAmount": {
            "type": "number",
            "description": "Budget amount",
            "format": "double"
          },
          "earliestTravelDate": {
            "type": "string",
            "description": "Earliest travel date",
            "format": "date",
            "nullable": true
          },
          "latestReturnDate": {
            "type": "string",
            "description": "Latest return date",
            "format": "date",
            "nullable": true
          },
          "showCustomFields": {
            "type": "boolean",
            "description": "Show custom fields for event"
          }
        },
        "additionalProperties": false
      },
      "TravellerStatus": {
        "enum": [
          0,
          10,
          20,
          25,
          30,
          40,
          50,
          60,
          9990,
          9999
        ],
        "type": "integer",
        "description": "<p>Possible values:</p><ul><li><i>0</i> - Unknown</li><li><i>10</i> - InvitationSent</li><li><i>20</i> - AwaitingSelection</li><li><i>25</i> - AwaitingConciergeOffer</li><li><i>30</i> - AwaitingApproval</li><li><i>40</i> - AwaitingTickets</li><li><i>50</i> - AwaitingConfirmation</li><li><i>60</i> - Confirmed</li><li><i>9990</i> - Archived</li><li><i>9999</i> - Cancelled</li></ul>",
        "format": "int32"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "Event"
    },
    {
      "name": "Traveller"
    }
  ]
}