Skip to main content

Virtual Airlines API Reference

This page is for airline owners, managers, and people building an airline website, dashboard, roster page, or private tool. The Virtual Airlines API lets an approved integration read selected information about one airline. It is deliberately read-only: it can show an airline profile, pilots, flights, fleet, schedules, aggregate statistics, insights, pilot rankings, and (only if the owner opts in) a finance report, but it cannot book flights, change ticket prices, move aircraft, manage people, edit routes, or spend FH$. The API is designed to be understandable and safe to integrate. Every API key belongs to exactly one airline, every key has explicit read-only scopes, list results are paginated, and responses contain only the identifiers needed by an integration. The endpoint links below open interactive request examples and response-field references. Use a key with only the scopes your integration needs, and never paste credentials into a public page.

Start here

  1. The airline owner opens Manage airline → Ownership → Integrations.
  2. Create an API key with a descriptive name, the smallest set of scopes the integration needs, and an optional expiry.
  3. Copy the secret immediately. FlyHub displays it only once.
  4. Store it on your website or service server. Never put it in browser JavaScript, a public repository, an embed, or a Discord message.
  5. Call the public endpoint with the key in the Authorization header.
The public API base is:
The resource endpoint is:
Example:
The ${FHVA_API_KEY} variable should exist only in the server environment of your integration. A browser-facing page should call your server, and your server should call FlyHub.

Read-only by design

The public integration is read-only. Use FlyHub’s own screens for bookings, finance, fleet, people, route editing, and other actions that change airline state. Do not build a third-party integration around private screens or undocumented requests.

Authentication

Send the key as a bearer credential:
FlyHub API keys start with fhva_live_. Treat the complete value as a secret. The secret is returned only in the successful response that creates the key. If it is lost, create a replacement key and revoke the old one. The airline is derived from the key. There is no airlineId query parameter, and a caller cannot use a key issued to one airline to read another airline.

Authentication outcomes

The airline attached to a key must also be in an operating state accepted by the public API. Permanently closed or otherwise unavailable airlines cannot be read through an active integration key.

Scopes

Give a key only the scopes it needs. Scopes cannot write to the airline. The available scope names are shown in the Ownership integration screen. A key may contain one or more scopes, up to all seven. No key gets finance:read unless an owner ticks it when creating the key.

Common request parameters

The list resources accept the same two query parameters: Example:
Invalid or missing numeric parameters fall back to their defaults instead of returning a validation error. A limit of 0 is treated as 1. Values above the maximum are capped. flights also accepts a cursor (see Paging and syncing flights), which has no offset ceiling. Use it for logbooks larger than a few thousand entries. The limit and offset parameters do not change the shape of airline, statistics, or insights, which are single objects.

Response envelopes

A single object

airline and statistics return:

A paginated list

pilots, flights, fleet, schedules, and leaderboard return:
flights/live returns the list envelope without pagination. total is the total number of records available for that airline under the resource’s filters, not the number returned on the current page. It is null on cursor pages of flights and on leaderboard. hasMore says whether another page exists. flights also returns nextCursor. Dates and timestamps are ISO 8601 values in UTC. A value can be null when FlyHub has no value to report. API version 2026-10-24 added fields to pilots and flights and the flights/live endpoint. Version 2026-10-25 added insights, leaderboard, finance, flight cursors and filters, createdAt on flights, hasMore/nextCursor in pagination, and ETag revalidation; existing fields did not change. Treat unknown fields as forward-compatible: ignore fields you do not recognize rather than failing the whole response.

Error envelope

Public API errors use this shape:
The supported public error codes are unauthorized, forbidden, not_found, rate_limited, and service_unavailable.

Public API endpoints

There are no public POST, PATCH, or DELETE endpoints under /api/v1/va. A POST to a public resource is not a way to book a flight or update an airline.

Endpoint references

GET /api/v1/va/airline

Returns the identity and high-level status of the airline attached to the key. It is not paginated.
Example response:
pilotCount counts active airline memberships. fleetCount excludes aircraft whose operational status is retired and uses the same airline-group scope as the fleet endpoint.

GET /api/v1/va/pilots

Returns the airline’s active roster. Suspended, rejected, left, and removed memberships are not returned.
Each item contains: The list is ordered by joinedAt from oldest to newest. User IDs are intentionally omitted. Use a display name plus the airline context for presentation, not as a guaranteed permanent identifier.

GET /api/v1/va/flights

Returns the airline’s public logbook activity, newest first. The result is a record of airline flight entries, not a command to start or book a flight. Always inspect status: a row can describe a successful, cancelled, rejected, or otherwise closed result.
A flagship airline’s API key also includes flights flown for all non-closed subsidiaries in its own group. A subsidiary’s API key returns only that subsidiary’s flights; an independent airline’s key returns only its own flights. Use airlineIcao to tell operators apart. Each item contains: Rejected rows stay in the list so an airline website can show them. The pilot, landing, load, network, and simulator fields are null on rejected and corrected rows, and any of them can be null on a completed row when FlyHub did not record the value. Add status to show only one kind of row, for example ?status=completed. Accepted values are completed, diverted, rejected, and corrected; an unknown value is ignored. More filters, which can be combined: An invalid timestamp, registration, or cursor is ignored rather than rejected.

Paging and syncing flights

offset stops at 10,000 and every offset page counts the whole logbook. For anything larger than a homepage, use the cursor:
  1. Request GET /flights?limit=100. The response contains pagination.nextCursor when hasMore is true.
  2. Request GET /flights?limit=100&cursor=<nextCursor> until hasMore is false.
Cursor pages skip the exact count, so total is null on them. A cursor is opaque: store it as a string and do not build or edit one. To keep a local copy of the logbook up to date, sync oldest-first:
  1. Run the first sync with order=asc&limit=100, following nextCursor until hasMore is false.
  2. Save the last nextCursor. With order=asc it is returned on every page, even an empty one.
  3. On each refresh, request order=asc&limit=100&cursor=<saved> and save the new nextCursor. You receive only entries recorded since the last refresh.
Logbook entries are append-only, so this sync sees every new entry exactly once. In rare cases a FlyHub administrator corrects an existing entry; re-run a full sync once a day if your site must reflect those corrections. The public record does not expose private identifiers for bookings, results, pilots, or aircraft, or pilots’ email addresses or network IDs. avatarUrl is always an unsigned public URL.

GET /api/v1/va/flights/live

Returns the flights in progress right now: what an airline homepage shows in a “flying now” table. It uses the flights:read scope and the same group scope as flights. The list is newest first, capped at 100, and not paginated.
Each item contains: The live list does not include positions, altitudes, or speeds; use the public live map embed for a map. An online flight disappears after ten minutes without tracker updates. An offline-tracked flight appears only when the pilot shares it on the live map. Each request costs at most 5 rows of the hourly row budget (fewer when fewer flights are in progress). Results are cached for about 30 seconds, so polling faster than that returns the same data; once a minute is plenty for a homepage.

GET /api/v1/va/fleet

Returns non-retired aircraft associated with the airline, ordered by registration. A flagship airline’s API key also includes aircraft from all non-closed subsidiaries in its own group. A subsidiary’s API key returns only that subsidiary’s fleet; an independent airline’s key returns only its own fleet. Pagination and its total apply to the combined fleet.
Each item contains: Retired aircraft are excluded. The public API does not provide a fleet-management action.

GET /api/v1/va/schedules

Returns schedules whose template status is active or suspended, ordered by flight number. Archived or other non-public schedule states are not included.
Group scope works like the flights endpoint: a flagship key includes the schedules of its non-closed subsidiaries, and airlineIcao names the operating airline. Each item contains:

Reading operatingDaysMask

The mask uses Monday-first bits: For example, 31 (1 + 2 + 4 + 8 + 16) means Monday through Friday. Operating-day checks in Virtual Airlines use UTC, so convert a timestamp to UTC before deciding whether a schedule operates.

GET /api/v1/va/statistics

Returns one aggregate object. It is deliberately summary-only and has no pagination. A flagship airline’s API key aggregates flights, hours, fleet, schedules, contribution and reliability across all non-closed subsidiaries in its own group, matching the flights, fleet and schedules endpoints. activePilots counts the shared group roster. A subsidiary or independent airline key returns only its own totals.
Current fields: Statistics are aggregate values, not a replacement for the paginated resource records. For example, use pilots when you need the roster and fleet when you need individual aircraft.

GET /api/v1/va/insights

Returns everything an airline website usually computes from the full logbook (totals, charts, and top lists) as one object. It uses the statistics:read scope, the same group scope as flights, and counts only completed and diverted flights that count for statistics. Each request costs 20 rows, whatever the size of the airline. Results refresh about once a minute.
period is all (default), month (the current UTC calendar month), 7d, 30d, 90d, or 365d.

GET /api/v1/va/leaderboard

Ranks pilots over a period. It uses the pilots:read scope and the same group scope as flights. Results refresh about once a minute.
score and landing only rank pilots with at least three flights in the period. Each item contains position, pilot ({ displayName, avatarUrl }), flights, blockHours, distanceNm, averageScore, averageLandingRateFpm, bestLandingRateFpm, and lastFlightAt. Pilots who flew for the airline and have since left can appear in a ranking that covers their flights.

GET /api/v1/va/finance

A public finance report, like an investor update: what the airline earned, what it spent, and what it kept. Use it to show your community how the airline is performing. It needs the opt-in finance:read scope, uses the same group scope as statistics (a flagship key covers the whole group), and costs 20 rows. Results refresh about once a minute.
period is 30d (default), 7d, 90d, 365d, month (the current UTC calendar month to date), or all. All amounts are FH$. The report counts revenue and costs only. Launch capital, group capital transfers, and restructuring support change cash but are not performance, so they are left out of summary and appear only in cashBalance.

Rate limits and safe retries

Every key has two allowances:
  • a request rate per key and IP address, counted per minute;
  • an hourly row budget, counted in rows.
A list costs the rows it actually returns, so ?limit=100 on a 23-pilot roster costs 23. airline costs 1 row, statistics 10, insights and finance 20, and flights/live at most 5. All keys of one airline also share an airline-wide hourly ceiling, so creating more keys does not multiply the allowance. The exact allowance can change as the service evolves. Treat X-RateLimit-* values as authoritative for the current response and keep retry attempts bounded. A 503 means the service is temporarily unavailable; retry later with backoff.

Refreshing without paying again

Store the ETag of each response with its body. On the next refresh, send it back:
If nothing changed, FlyHub answers 304 Not Modified with an empty body and charges one row. Keep showing your stored copy. The request still needs a valid key and still counts toward the request rate.

A polite polling pattern

For a dashboard, fetch only the resources it actually displays, use the smallest useful limit, and refresh on a human scale rather than every few seconds. Prefer insights and leaderboard to downloading the logbook, use cursors and since for the logbook itself, and send If-None-Match on every refresh. On 429, pause until Retry-After; on 503, retry with exponential backoff. Do not run several identical requests in parallel.

Example integration client

The following example keeps the key on a server and handles the common response shapes:
For a list, continue while pagination.hasMore is true, passing nextCursor as cursor for flights and increasing offset for the other resources. Stop on a repeated response or an error; never retry a failed page indefinitely.

Managing access

Airline owners manage website connections from Manage airline → Ownership → Integrations. The screen lets an owner create a read-only key, choose its scopes and expiry, copy the secret once, and revoke it later. Keep the secret on your integration server. If it is lost, create a replacement key, update and verify your integration, then revoke the old key. The public API does not include endpoints for managing keys; use the Ownership screen for those actions.

What the public API does not do

The public API does not provide:
  • flight booking, cancellation, dispatch, or completion;
  • ticket-price changes or market/economy commands;
  • pilot applications, role changes, suspensions, or removals;
  • fleet leasing, transfers, positioning, configuration, or maintenance;
  • route and schedule editing;
  • FH$ transfers, settlement changes, or billing controls;
  • ownership changes or airline retirement;
  • generic custom webhooks, event replay, delivery history, or a webhook signature endpoint.
Use FlyHub’s own screens for those actions. The next page, Virtual Airlines Webhooks, documents the supported Discord notification integration.

Integration checklist

Before giving an integration to your pilots:
  • keep the API secret server-side;
  • request only the scopes the page needs;
  • handle 401, 403, 404, 429, and 503 explicitly;
  • honor Retry-After and the reset headers;
  • paginate instead of requesting large repeated pages, and use cursors for the logbook;
  • send If-None-Match when refreshing data you already have;
  • treat timestamps as UTC;
  • ignore fields added in a later API version;
  • do not assume a display name, flight number, or registration is a permanent identifier;
  • rotate credentials by create → deploy → verify → revoke;
  • remove the old key from logs, source control, CI output, and screenshots.