APIFlights
Replace a flight
PUT
bearerAuth flight.update.ownheader
AuthorizationBearer <API key or OAuth 2.1 access token>Send Authorization: Bearer <credential>. Create API keys in AirTrail Security settings. OAuth clients use authorization code with PKCE S256 and a resource identifier matching /api/v1.
Scope: flight.update.own
id*integerFlight ID.
Range
1 <= valueapplication/json- body
date*stringFormat
datedatePrecision?stringDefault
"day"Value in
"day""month""year"departure?|Format
date-timearrival?|Format
date-timedepartureScheduled?|Format
date-timearrivalScheduled?|Format
date-timetakeoffScheduled?|Format
date-timetakeoffActual?|Format
date-timelandingScheduled?|Format
date-timelandingActual?|Format
date-timeduration?|Range
0 <= valuedepartureTerminal?|Length
length <= 500departureGate?|Length
length <= 500arrivalTerminal?|Length
length <= 500arrivalGate?|Length
length <= 500flightNumber?|Length
length <= 500aircraftReg?|Length
length <= 500note?|Length
length <= 10000fromId*integerRange
1 <= valuetoId*integerRange
1 <= valueaircraftId?|Range
1 <= valueairlineId?|Range
1 <= valuepassengers*array<>Items
1 <= itemstrack?|nullcustomFields?Updated flight.
application/json- response
data*A stored flight, or null field, joined to its reference data.
curl -X PUT 'https://your-instance.example/api/v1/flights/1' \ -H 'Content-Type: application/json' \ -d '{ "date": "2019-08-24", "fromId": 1, "toId": 1, "passengers": [ {} ]}'Example Response
{ "data": { "id": 0, "date": "2019-08-24", "datePrecision": "day", "departure": "2019-08-24T14:15:22Z", "arrival": "2019-08-24T14:15:22Z", "departureScheduled": "2019-08-24T14:15:22Z", "arrivalScheduled": "2019-08-24T14:15:22Z", "takeoffScheduled": "2019-08-24T14:15:22Z", "takeoffActual": "2019-08-24T14:15:22Z", "landingScheduled": "2019-08-24T14:15:22Z", "landingActual": "2019-08-24T14:15:22Z", "duration": 0, "departureTerminal": "string", "departureGate": "string", "arrivalTerminal": "string", "arrivalGate": "string", "flightNumber": "string", "aircraftReg": "string", "note": "string", "from": { "id": 0, "icao": "string", "iata": "string", "name": "string", "municipality": "string", "latitude": 0, "longitude": 0, "timezone": "string", "type": "small_airport", "continent": "AF", "country": "string" }, "to": { "id": 0, "icao": "string", "iata": "string", "name": "string", "municipality": "string", "latitude": 0, "longitude": 0, "timezone": "string", "type": "small_airport", "continent": "AF", "country": "string" }, "airline": { "id": 0, "name": "string", "icao": "string", "iata": "string", "iconPath": "string" }, "aircraft": { "id": 0, "name": "string", "icao": "string" }, "passengers": [ { "id": 0, "user": { "id": "string", "username": "string", "displayName": "string" }, "guestName": "string", "seat": "window", "seatNumber": "string", "seatClass": "economy", "flightReason": "leisure" } ], "track": { "pointCount": 0, "updatedAt": "2019-08-24T14:15:22Z", "sourceFormat": "string", "sourceName": "string" } }}