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, and aggregate statistics, 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 six.

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. The API uses limit-and-offset pagination, so an integration that needs a large list should page carefully and respect the offset ceiling. The limit and offset parameters do not change the shape of airline or statistics, which are single objects.

Response envelopes

A single object

airline and statistics return:

A paginated list

pilots, flights, fleet, and schedules return:
total is the total number of records available for that airline under the resource’s filters, not the number returned on the current page. Dates and timestamps are ISO 8601 values in UTC. A value can be null when FlyHub has no value to report. 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: The public record does not expose private identifiers for bookings, results, pilots, or aircraft.

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.

Rate limits and safe retries

The public API may temporarily limit requests. Do not hard-code a numeric allowance: use the response headers and the status code to decide when to retry. 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.

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. 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 offset + data.length < pagination.total. 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;
  • 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.