APIFlight

List flights

List flights visible to the authenticated API key. Regular users can only list their own flights. Admins and owners can also request a specific user's flights or all flights.

GET
/flight/list
AuthorizationBearer <token>

Go to Settings -> Security and create a new API key. Use the generated key as the bearer token.

In: header

Query Parameters

scope?string

Which flights to return. mine is the default. user and all require an admin or owner API key.

Default"mine"
Value in"mine" | "user" | "all"
userId?string

The user ID whose flights should be returned when scope=user.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://your-instance.com/api/flight/list"
{
  "flights": [
    {
      "id": 1,
      "from": {
        "id": 42,
        "icao": "KJFK",
        "iata": "JFK",
        "name": "John F Kennedy International Airport",
        "lat": 40.639447,
        "lon": -73.779317,
        "type": "large_airport",
        "continent": "NA",
        "country": "US",
        "tz": "America/New_York"
      },
      "to": {
        "id": 42,
        "icao": "KJFK",
        "iata": "JFK",
        "name": "John F Kennedy International Airport",
        "lat": 40.639447,
        "lon": -73.779317,
        "type": "large_airport",
        "continent": "NA",
        "country": "US",
        "tz": "America/New_York"
      },
      "departure": "2021-09-01T23:00:00.000+00:00",
      "arrival": "2021-09-02T10:00:00.000+00:00",
      "date": "2021-09-02",
      "datePrecision": "day",
      "seats": [
        {
          "userId": "user1",
          "guestName": null,
          "seat": "aisle",
          "seatNumber": "1A",
          "seatClass": "economy"
        }
      ],
      "airline": "BAW",
      "flightNumber": "BA178",
      "aircraft": "A388",
      "aircraftReg": "G-VIIL",
      "flightReason": "leisure",
      "notes": "This is a test flight."
    }
  ]
}
{
  "success": false,
  "message": "Invalid scope"
}
{
  "success": "false",
  "message": "Unauthorized"
}
{
  "success": "false",
  "message": "Forbidden"
}
{
  "success": "false",
  "message": "string"
}
Edit on GitHub

Last updated on