Gaggle Logo
Gaggle Developers

Permissions and plans

Two things decide what you receive for a pilot: what the pilot allows (permissions) and their Gaggle plan (detail). Both are checked on every request, so a change applies on the very next call.

What the pilot controls

For each connected app the pilot sees your name and logo, and chooses:

  • Scopes. Each scope you asked for is a switch, on by default. The pilot can turn any off except profile, and turn it back on later, without reconnecting.
  • Sharing levels. Each flight in Gaggle has a sharing level: everyone, groups, friends or private. The pilot chooses which levels each app sees, by default everyone, groups and friends (the list can be narrower, or empty). Imported flights are private by default in Gaggle, so they are shared only when private is included. Manual log entries have no sharing level and are always visible.
  • Disconnect. The pilot can disconnect your app at any time.

Some things are never shared with anyone: flights recorded under an event organiser’s control, and these parts of the log on any plan: tasks, notes, maximum altitude, take-off height, scores, achievements and images. Manual log entries have no sharing setting and are always included.

A missing scope answers 403 with the scope that is not enabled:

{ "error": "insufficient_scope", "scope": "tracks" }

You can also only ask for the scopes your registration allows. Asking for another one is refused with invalid_scope.

Always read /v1/me, not the token

The scope on your access token is the upper bound of what you asked for, and it never changes. The pilot’s switches and plan do change. To know what you can use:

  1. Call GET /v1/me after connecting. Use scopes, plan, historyFrom and flightSharing.
  2. Call it again whenever you receive a connection.updated webhook (the pilot changed a switch, or the plan changed), and re-sync the pilot’s flights, because the history window and the fields may have changed.

Never decide what to request from the token’s scope. Requesting something that is switched off just returns 403.

What each plan returns

Every scope works on every plan. The plan sets how far back you can read and how much detail comes back.

History window

FreeFrequent FlyerAdventurer
Flights, flight detail and tracksNew flights onlyLast 30 daysWhole logbook
StatsWhole logbookWhole logbookWhole logbook

Free has no history. You see only flights that first reached Gaggle after the pilot connected your app, whatever their flight date. A manual entry the pilot adds later counts as new; the flights already in the logbook never do. Frequent Flyer’s window is by flight date, and Adventurer has no window.

historyFrom in /v1/me is where the window starts: 30 days back (the start of a UTC day, so it moves forward once a day), or (Free) the exact moment the pilot connected. On Adventurer it is null: there is no window, you see the whole logbook. A flight outside the window answers 404 and does not appear in the list. Webhooks follow the same windows.

Flight fields

id, source (recording, import or manual), hasTrack and updatedAt are always present.

FieldFreeFrequent FlyerAdventurer
date (take-off time, UTC), durationMinutesYesYesYes
site (take-off site name)YesYesYes
aircraft (name, engineName)YesYesYes
takeOffCoordinates (lat, lng)YesYesYes
flightTypeYesYesYes
distanceKmYesYes
weatherYes

Fields your pilot’s plan does not include are left out of the JSON. Treat every optional field as optional.

distanceKm is rounded to 0.1 km. Weather units: temperature in °C (to 0.1), humidity in percent, pressure in hPa, visibility in metres, windSpeed and gustSpeed in metres per second, and windDirection in degrees (where the wind comes from). Fields the source did not provide are left out, and flights entered by hand carry wind only.

Stats

FreeFrequent FlyerAdventurer
Lifetime flights and airtimeYesYesYes
Lifetime distanceYesYes
Per year (flights, airtime and distance)YesYes
Per month, and per aircraftYes

Tracks

Tracks are the same on every plan. A track has every recorded point, and each point has time, latitude, longitude and altitude, as recorded on the device (or in the imported file), not smoothed or corrected. The tracks follow the same history window as flights. Providers can work out speed, heading, climb rate and similar values from the points.

Stats details

Stats are counted from the pilot’s whole logbook, but only flights at the sharing levels the pilot allows you to see count (manual entries always do). years come newest first, each year’s months are in calendar order and list only months with flights, and distances are rounded to 0.1 km. aircraft lists each aircraft by number of flights, most first.

When the plan changes

If a pilot upgrades or downgrades, the new plan applies on your next request and Gaggle sends you a connection.updated webhook with the new plan. Re-read /v1/me and re-sync flights: a downgrade shortens the history window and removes fields (distance, weather) and stats detail, an upgrade extends the window and adds them.

Showing pilots what they get

Pilots are told on the consent screen what their plan gives your app, and are offered an upgrade there. Pilots can read how connected apps work in the help center: Connected apps. It helps to say in your own product what you do with each plan, so pilots know why a richer plan can be worth it.