APIFlights

Create a flight

POST
/api/v1/flights

Authorization

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

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

Flight created.

application/json
  1. response
data*
Example Request
curl -X POST 'https://your-instance.example/api/v1/flights' \  -H 'Content-Type: application/json' \  -d '{  "date": "2019-08-24",  "fromId": 1,  "toId": 1,  "passengers": [    {}  ]}'
Example Response
{  "data": {    "id": "string"  }}