A leg represents a single flight. A leg typically has at least one pre-flight risk assessment run for it, but can also be used to group multiple risk assessments representing pre-flight, in-flight, and post-flight states.
HTTP PUT Service Accounts
Adds or updates a leg. Existence is determined by the legId
.
Field | Type | Constraints | Detail | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
legId | Mapped ID | Required | This value should be unique independent of tripId . Other APIs will use this ID and it must stand on its own. |
||||||||||||||||||||
tripId | Mapped ID | Required |
If the legId is not found in FlightRisk, a new leg will be created and added to the trip with this tripId .
If the leg exists, but a tripId is provided for a different trip, the leg will be moved to that trip.
|
||||||||||||||||||||
tailId | Mapped ID | Required | |||||||||||||||||||||
rulesetId | Integer | Required | This is FlightRisk's ID for the ruleset. A list of available rulesets should be retrieved from the Rulesets API. | ||||||||||||||||||||
specialCircumstanceIds | Integer Array | An array of special circumstance IDs; candidate IDs are obtained from rulesets provided by the Rulesets API. | |||||||||||||||||||||
legType | String 50 | A type label to associate with the leg. Some systems have labels to identify different operations: revenue flight, repositioning flight, maintenance flight, etc. Sending this data allows FlightRisk to analyze the different operations. | |||||||||||||||||||||
base | String 50 | A base label to associate with the leg. Some customers have multiple bases associated with their operations. Specifying the base will allow the customer to filter and better organize the schedule information in FlightRisk. | |||||||||||||||||||||
flightType | String | Required |
Accepted Values
|
||||||||||||||||||||
notes | String 500 | ||||||||||||||||||||||
passengerCount | Integer | ||||||||||||||||||||||
airfields | Array |
|
|||||||||||||||||||||
crew | Array |
|
var payload = { legId: "callers_leg_ID_12345", tripId: "callers_trip_ID_12345", tailId: "callers_tail_ID_12345", rulesetId: 5, legType: "sample_type", base: "sample_base", flightType: "ifr", notes: "notes about leg", passengerCount: 10, airfields: [{ code: "kbos", timeOfInterest: "2019-05-23T16:00:00.000Z", designation: "departure" }, { code: "kjfk", timeOfInterest: "2019-05-23T19:30:00.000Z", designation: "arrival" }], crew: [{ accountId: "callers_account_ID_1", position: "pilotInCommand" }, { accountId: "callers_account_ID_2", position: "secondInCommand" }] };
HTTP Status | Data |
---|---|
200 | |
201 |
HTTP POST Service Accounts
Marks a leg as taken off and specifies the actual takeoff time and departure location. FlightRisk may provide inflight risk analysis for legs that have been marked as taken off but haven’t landed.
Field | Type | Constraints | Details |
---|---|---|---|
legId | Mapped ID | Required | |
code | Airfield Code | Required | |
timeOfInterest | Date | Required |
HTTP Status | Data |
---|---|
200 |
HTTP POST Service Accounts
Marks the leg as having landed and specifies the actual landing time and arrival location. FlightRisk may provide post-flight risk analysis using the actual takeoff and landing info.
The leg must have been previously marked as taken off.
Field | Type | Constraints | Details |
---|---|---|---|
legId | Mapped ID | Required | |
code | Airfield Code | Required | |
timeOfInterest | Date | Required |
HTTP Status | Data |
---|---|
200 |
HTTP DELETE Service Accounts
Deletes a leg and any risk assessments belonging to it.
Field | Type | Constraints | Details |
---|---|---|---|
legId | Mapped ID | Required |
HTTP Status | Data |
---|---|
200 |
API Version 14.1.9203.25168
Copyright ©2008-2025 Polaris Aero, LLC.