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
AuthorizationBearer <token>

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

In: header

fromstring

The ICAO code of the departure airport.

tostring

The ICAO code of the arrival airport.

departurestring

The departure date, in ISO 8601 format.

Formatdate-time
departureTime?string

The departure time in local airport time. 24- and 12-hour formats are supported.

arrival?string

The arrival date, in ISO 8601 format.

Formatdate-time
arrivalTime?string

The arrival time in local airport time. 24- and 12-hour formats are supported.

seatsarray<object>

The seats on the flight. Each seat must have either a userId or a guestName, and at least one seat must have a userId.

airline?string

The ICAO code of the airline.

flightNumber?string

The flight number.

aircraft?string

The ICAO code of the aircraft.

aircraftReg?string

The registration of the aircraft.

flightReason?string

The reason for the flight.

Value in"leisure" | "business" | "crew" | "other"
notes?string

Additional notes about the flight.

Partial updates are not supported. All fields must be provided.

idnumber

The ID of the flight to update.

fromstring

The ICAO code of the departure airport.

tostring

The ICAO code of the arrival airport.

departurestring

The departure date, in ISO 8601 format.

Formatdate-time
departureTime?string

The departure time in local airport time. 24- and 12-hour formats are supported.

arrival?string

The arrival date, in ISO 8601 format.

Formatdate-time
arrivalTime?string

The arrival time in local airport time. 24- and 12-hour formats are supported.

seatsarray<object>

The seats on the flight. Each seat must have either a userId or a guestName, and at least one seat must have a userId.

airline?string

The ICAO code of the airline.

flightNumber?string

The flight number.

aircraft?string

The ICAO code of the aircraft.

aircraftReg?string

The registration of the aircraft.

flightReason?string

The reason for the flight.

Value in"leisure" | "business" | "crew" | "other"
notes?string

Additional notes about the flight.

Response Body

curl -X POST "https://your-instance.com/api/flight/save" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "KJFK",
    "to": "EGLL",
    "departure": "2022-01-01T00:00:00Z",
    "seats": [
      {}
    ]
  }'
{
  "success": true
}
{
  "success": true,
  "id": 1
}
{
  "success": false,
  "errors": [
    "string"
  ]
}
{
  "success": "false",
  "message": "Unauthorized"
}
{
  "success": "false",
  "message": "Forbidden"
}
{
  "success": "false",
  "message": "string"
}
Edit on GitHub

Last updated on