Create or update a flight
Deprecated
Deprecated: This endpoint will be removed in the next major AirTrail release. Migrate to POST /api/v1/flights for new flights or PUT /api/v1/flights/{id} for updates. Create a new flight or update an existing one. Creating a flight for the API-key user requires flight.create.own; creating one for other users requires flight.create.any. Updating follows the equivalent flight.update.* permissions. On an existing flight, adding, removing, or changing passengers requires the matching flight.passengers.manage.* permission.
bearerAuthAuthorizationBearer <token>Go to Settings -> Security and create a new API key. Use the generated key as the bearer token.
application/json- body
from*stringThe departure airport code (ICAO or IATA).
to*stringThe arrival airport code (ICAO or IATA).
departure*stringThe departure date anchor. Accepts either a date-only string (YYYY-MM-DD) or a full ISO 8601 datetime. For partial dates, send January 1st for year-only flights and the first day of the month for month-only flights.
datePrecision?stringHow precise the canonical flight date anchor is. Partial dates apply only to the departure-side anchor.
"day""day""month""year"departureTime?stringThe departure time in local airport time. 24- and 12-hour formats are supported.
arrival?|The arrival date or datetime. Partial-date flights do not support a separate arrival anchor, so omit this or send null unless datePrecision is day.
arrivalTime?stringThe arrival time in local airport time. 24- and 12-hour formats are supported.
passengers*array<>The passengers on the flight.
1 <= itemsairline?stringThe ICAO code of the airline.
flightNumber?stringThe flight number.
aircraft?stringThe ICAO code of the aircraft.
aircraftReg?stringThe registration of the aircraft.
note?stringAdditional notes about the flight.
customFields?Custom field values keyed by custom field key. Values must match the configured field type.
Flight updated successfully
application/json- response
success?booleancurl -X POST 'https://your-instance.com/api/flight/save' \ -H 'Content-Type: application/json' \ -d '{ "from": "string", "to": "string", "departure": "string", "passengers": [ {} ]}'{ "success": true}Get flight details GET
**Deprecated:** This endpoint will be removed in the next major AirTrail release. Migrate to `GET /api/v1/flights/{id}`. Get details of a specific flight by ID. A passenger requires `flight.read.own`; access to any flight requires `flight.read.any`.
Delete a flight POST
**Deprecated:** This endpoint will be removed in the next major AirTrail release. Migrate to `DELETE /api/v1/flights/{id}`. Delete a flight by ID. A passenger requires `flight.delete.own`; deleting any flight requires `flight.delete.any`.
