APIFlight

Create or update a flight

Deprecated

POST
/flight/save

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.

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
from*string

The departure airport code (ICAO or IATA).

to*string

The arrival airport code (ICAO or IATA).

departure*string

The 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?string

How precise the canonical flight date anchor is. Partial dates apply only to the departure-side anchor.

Default"day"
Value in"day""month""year"
departureTime?string

The 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?string

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

passengers*array<>

The passengers on the flight.

Items1 <= items
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.

note?string

Additional notes about the flight.

customFields?

Custom field values keyed by custom field key. Values must match the configured field type.

Response Body

Flight updated successfully

application/json
  1. response
success?boolean
Example Request
curl -X POST 'https://your-instance.com/api/flight/save' \  -H 'Content-Type: application/json' \  -d '{  "from": "string",  "to": "string",  "departure": "string",  "passengers": [    {}  ]}'
Example Response
{  "success": true}