swagger: "2.0"
schemes:
  - https
host: test.api.amadeus.com
basePath: /v2
info:
  description: |
    
    Before using this API, we recommend you read our **[Authorization Guide](https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262)** for more information on how to generate an access token. 
      
    Please also be aware that our test environment is based on a subset of the production, to see what is included in test please refer to our **[data collection](https://github.com/amadeus4dev/data-collection)**.
  title: On-Demand Flight Status
  version: 2.0.2
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_amadeus.com_images_en_technology_mobile-tablet_mobile-woman-office-city.jpg.transform_medium_img.jpg
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/amadeus4dev/amadeus-open-api-specification/main/spec/json/OnDemandFlightStatus_v2_swagger_specification.json
      version: "2.0"
  x-providerName: amadeus.com
  x-release-note:
    "2.0":
      - Initial version
  x-serviceName: amadeus-on-demand-flight-status
  x-status: validated
consumes:
  - application/vnd.amadeus+json
produces:
  - application/vnd.amadeus+json
responses:
  "400":
    description: |
      code    | title
      ------- | -------------------------------------
      477     | INVALID FORMAT
      572     | INVALID OPTION
      2781    | INVALID LENGTH
      4926    | INVALID DATA RECEIVED
      32171   | MANDATORY DATA MISSING
    schema:
      $ref: "#/definitions/Error_400"
  "401":
    description: Unauthorized
    schema:
      $ref: "#/definitions/Error_401"
  "500":
    description: Unexpected Error
    schema:
      $ref: "#/definitions/Error_500"
  datedFlights:
    description: A list of dated flights
    schema:
      example:
        data:
          - flightDesignator:
              carrierCode: TP
              flightNumber: 487
            flightPoints:
              - departure:
                  timings:
                    - qualifier: STD
                      value: 2023-08-01T18:10+02:00
                iataCode: NCE
              - arrival:
                  timings:
                    - qualifier: STA
                      value: 2023-08-01T19:45+01:00
                iataCode: LIS
            legs:
              - aircraftEquipment:
                  aircraftType: E90
                boardPointIataCode: NCE
                offPointIataCode: LIS
                scheduledLegDuration: PT2H35M
            scheduledDepartureDate: 2023-08-01
            segments:
              - boardPointIataCode: NCE
                offPointIataCode: LIS
                partnership:
                  operatingFlight:
                    carrierCode: A3
                    flightNumber: 1748
                scheduledSegmentDuration: PT2H35M
            type: DatedFlight
        meta:
          count: 1
          links:
            self: https://test.api.amadeus.com/v2/schedule/flights?carrierCode=TP&flightNumber=487&scheduledDepartureDate=2023-08-01
      properties:
        data:
          items:
            $ref: "#/definitions/DatedFlight"
          type: array
        meta:
          $ref: "#/definitions/Collection_Meta"
        warnings:
          items:
            $ref: "#/definitions/Issue"
          type: array
      required:
        - data
      title: Success Flights.
paths:
  /schedule/flights:
    get:
      description: ""
      operationId: getFlightsStatus
      parameters:
        - description: |
            2 to 3-character IATA carrier code ([IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)).
          in: query
          name: carrierCode
          required: true
          type: string
          x-example: TP
        - description: 1 to 4-digit number of the flight. e.g. 4537
          in: query
          name: flightNumber
          required: true
          type: string
          x-example: "487"
        - description: scheduled departure date of the flight, local to the departure airport, format YYYY-MM-DD.
          format: date
          in: query
          name: scheduledDepartureDate
          required: true
          type: string
          x-example: 2023-08-01
        - description: |
            1-letter operational suffix assigned by the carrier to differentiate flight in case of delay changing the departure date e.g. A
          in: query
          name: operationalSuffix
          type: string
      responses:
        "200":
          $ref: "#/responses/datedFlights"
        "400":
          $ref: "#/responses/400"
        "401":
          $ref: "#/responses/401"
        default:
          $ref: "#/responses/500"
      summary: Retrieves a unique flight by search criteria.
      tags:
        - flights
definitions:
  AircraftEquipment:
    properties:
      aircraftType:
        description: the type of aircraft that will operate the leg
        example: 733
        type: string
  Arrival:
    properties:
      gate:
        $ref: "#/definitions/Gate"
        description: the arrival gate of the airport
      terminal:
        $ref: "#/definitions/Terminal"
        description: the arrival terminal of the airport
      timings:
        description: the list of timings
        items:
          $ref: "#/definitions/Timing"
        type: array
  Collection_Meta:
    properties:
      count:
        example: 1
        type: integer
      links:
        example:
          self: https://test.api.amadeus.com/v1/area/resources?param=value
        properties:
          first:
            example: https://test.api.amadeus.com/v1/area/resources?...
            format: uri
            type: string
          last:
            example: https://test.api.amadeus.com/v1/area/resources?...
            format: uri
            type: string
          next:
            example: https://test.api.amadeus.com/v1/area/resources?...
            format: uri
            type: string
          previous:
            example: https://test.api.amadeus.com/v1/area/resources?...
            format: uri
            type: string
          self:
            example: https://test.api.amadeus.com/v1/area/resources?...
            format: uri
            type: string
          up:
            example: https://test.api.amadeus.com/v1/area/resources?...
            format: uri
            type: string
        title: CollectionLinks
        type: object
    title: Collection_Meta
    type: object
  DatedFlight:
    properties:
      flightDesignator:
        $ref: "#/definitions/FlightDesignator"
        description: the flight designator element
        example:
          carrierCode: QF
          flightNumber: 1
          operationalSuffix: _
      flightPoints:
        description: |
          the flight points of the flight.
          At least one departure, one arrival
        items:
          $ref: "#/definitions/FlightPoint"
        type: array
      legs:
        description: |
          the list of legs of the datedFlight.
          - definition of leg: operation of the aircraft between a departure station and the next arrival station (between take off and landing)
        items:
          $ref: "#/definitions/Leg"
        type: array
      scheduledDepartureDate:
        description: the scheduled departure date
        example: 2018-11-06
        format: date
        type: string
      segments:
        description: |
          the list of segments of the datedFlight
          - definition of segment: the commercial unit corresponding to the passenger journey traveling between two points with the same flight (same flight designator)
        items:
          $ref: "#/definitions/Segment"
        type: array
      type:
        description: the resource name
        readOnly: true
        type: string
  Delay:
    properties:
      duration:
        description: the delay recorded for the timing following [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations)
        example: PT25M
        type: string
  Departure:
    properties:
      gate:
        $ref: "#/definitions/Gate"
        description: the departure gate of the airport
      terminal:
        $ref: "#/definitions/Terminal"
        description: the departure terminal of the airport
      timings:
        description: the list of timings
        items:
          $ref: "#/definitions/Timing"
        type: array
  Error_400:
    example:
      errors:
        - code: 477
          detail: invalid query parameter format
          source:
            example: CDG
            parameter: airport
          status: 400
          title: INVALID FORMAT
    properties:
      errors:
        items:
          $ref: "#/definitions/Issue"
        type: array
    required:
      - errors
    type: object
  Error_401:
    example:
      errors:
        - code: 20
          detail: Query unauthorized
          status: 401
          title: RESTRICTED
    properties:
      errors:
        items:
          $ref: "#/definitions/Issue"
        type: array
    required:
      - errors
  Error_500:
    example:
      errors:
        - code: 141
          status: 500
          title: SYSTEM ERROR HAS OCCURRED
    properties:
      errors:
        items:
          $ref: "#/definitions/Issue"
        type: array
    required:
      - errors
    type: object
  FlightDesignator:
    properties:
      carrierCode:
        description: 2 to 3-character IATA code of the carrier. e.g. 6X
        type: string
      flightNumber:
        description: 1 to 4-digit number of the flight e.g. 4537
        format: int64
        type: integer
      operationalSuffix:
        description: 1-letter operational suffix of the flight e.g. A
        type: string
  FlightPoint:
    properties:
      arrival:
        $ref: "#/definitions/Arrival"
        description: the arrival information if the flightPoint is an arrival for the flight
      departure:
        $ref: "#/definitions/Departure"
        description: the departure information if the flightPoint is a departure for the flight
      iataCode:
        description: 3-letter IATA code of the airport. e.g. CDG
        example: CDG
        type: string
  Gate:
    properties:
      mainGate:
        description: the main gate number
        example: 10A
        type: string
  Issue:
    properties:
      code:
        description: an application-specific error code
        format: int64
        type: integer
      detail:
        description: explanation of the error
        type: string
      source:
        description: an object containing references to the source of the error
        maxProperties: 1
        properties:
          example:
            description: a string indicating an example of the right value
            type: string
          parameter:
            description: a string indicating which URI query parameter caused the issue
            type: string
          pointer:
            description: a JSON Pointer [RFC6901] to the associated entity in the request document
            type: string
        title: Issue_Source
        type: object
      status:
        description: the HTTP status code applicable to this error
        type: integer
      title:
        description: a short summary of the error
        type: string
    type: object
  Leg:
    properties:
      aircraftEquipment:
        $ref: "#/definitions/AircraftEquipment"
      boardPointIataCode:
        description: 3-letter IATA code of the departure airport. e.g. LHR
        example: LHR
        pattern: "[a-zA-Z]{3}"
        type: string
      offPointIataCode:
        description: 3-letter IATA code of the arrival airport. e.g. BKK
        example: BKK
        pattern: "[a-zA-Z]{3}"
        type: string
      scheduledLegDuration:
        description: duration of the leg following standard [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations)
        example: PT14H50M
        type: string
  Partnership:
    properties:
      operatingFlight:
        $ref: "#/definitions/FlightDesignator"
  Segment:
    properties:
      boardPointIataCode:
        description: 3-letter IATA code of the departure airport. e.g. CDG
        example: LHR
        pattern: "[a-zA-Z]{3}"
        type: string
      offPointIataCode:
        description: 3-letter IATA code of the arrival airport. e.g. AMS
        example: BKK
        pattern: "[a-zA-Z]{3}"
        type: string
      partnership:
        $ref: "#/definitions/Partnership"
      scheduledSegmentDuration:
        description: duration of the segment following standard [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations)
        example: PT14H50M
        type: string
  Terminal:
    properties:
      code:
        description: the code of the terminal
        example: 1
        type: string
  Timing:
    properties:
      delays:
        description: delays that might be recorded on a timing
        items:
          $ref: "#/definitions/Delay"
        type: array
      qualifier:
        description: the qualifier of the timing. e.g. STD (stands for Schedule Time Departure)
        example: STD
        type: string
      value:
        example: 06:00:00
        format: date-time
        type: string
x-generatedAt: 2020-09-07T09:52:13.997Z
