APIFlights

Replace a flight

PUT
/api/v1/flights/{id}

Authorization

bearerAuth flight.update.own
headerAuthorizationBearer <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

Path Parameters

id*integer

Flight ID.

Range1 <= value

Request Body

application/json
  1. body
date*string
Formatdate
datePrecision?string
Default"day"
Value in"day""month""year"
departure?|
Formatdate-time
arrival?|
Formatdate-time
departureScheduled?|
Formatdate-time
arrivalScheduled?|
Formatdate-time
takeoffScheduled?|
Formatdate-time
takeoffActual?|
Formatdate-time
landingScheduled?|
Formatdate-time
landingActual?|
Formatdate-time
duration?|
Range0 <= value
departureTerminal?|
Lengthlength <= 500
departureGate?|
Lengthlength <= 500
arrivalTerminal?|
Lengthlength <= 500
arrivalGate?|
Lengthlength <= 500
flightNumber?|
Lengthlength <= 500
aircraftReg?|
Lengthlength <= 500
note?|
Lengthlength <= 10000
fromId*integer
Range1 <= value
toId*integer
Range1 <= value
aircraftId?|
Range1 <= value
airlineId?|
Range1 <= value
passengers*array<>
Items1 <= items
track?|null
customFields?

Response Body

Updated flight.

application/json
  1. response
data*

A stored flight, or null field, joined to its reference data.

Example Request
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"    }  }}