APIFlight

Create or update a flight

Create a new flight or update an existing one. If the `id` field is present, the flight will be updated. Otherwise, a new flight will be created.

POST
/flight/save

Authorization

Authorization
Required
Bearer <token>

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

In: header

Request Body

application/jsonRequired

body
Required
Create | Update

curl -X POST "https://example.com/api/flight/save" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "KJFK",
    "to": "EGLL",
    "departure": "2022-01-01T00:00:00Z",
    "departureTime": "11:30",
    "arrival": "2022-01-01T00:00:00Z",
    "arrivalTime": "15:30",
    "seats": [
      {
        "userId": "<USER_ID>",
        "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."
  }'

Flight saved successfully

{
  "success": true
}

Edit on GitHub

Last updated on