# Open Fly agent guide

Open Fly can search published flights, list ACMI aircraft, pilot jobs and crew brokers, read a traveler's saved searches, missions and exception inbox, edit their route watches, triage inbox items and create or cancel missions with permission. `update_saved_search`, `create_mission`, `cancel_mission` and `update_inbox_item_state` write for travelers; each needs a `traveler:write` token (which also covers every `traveler:read` action, so one token can create a mission and read it back), `confirm: true` and an `idempotency_key`, and edits and cancellations also need the current `revision`. `update_opportunity_state` is the only operator write and needs an `operator:write` token. Missions never book: a qualifying fare stops at `waiting_for_authorization` with a checkout link for the traveler.

Base URL: https://openfly.fun (production) or https://dev.openfly.fun (development). Resolve relative links against the host serving this document.

## Quick start

Use the deployment's origin as `base`. Send the input object directly as JSON.

```sh
base=https://openfly.fun
curl -fsS "$base/api/v1/agent/actions/search_flights" \
  -H 'Content-Type: application/json' -d '{"origin":"LIS","limit":3}'
```

MCP uses stateless Streamable HTTP with JSON responses. This example uses the initialize handshake. Set `version` to the protocol version returned by initialize.

```sh
curl -fsS "$base/api/v1/mcp" \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'
version=2025-11-25
curl -fsS "$base/api/v1/mcp" \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H "MCP-Protocol-Version: $version" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -fsS "$base/api/v1/mcp" \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H "MCP-Protocol-Version: $version" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
curl -fsS "$base/api/v1/mcp" \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H "MCP-Protocol-Version: $version" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"search_flights","arguments":{"origin":"LIS","limit":3}}}'
```

## Discovery

- [Agent guide](/AGENTS.md)
- [Site overview](/llms.txt)
- [Full action schemas](/llms-full.txt)
- [OpenAPI](/openapi.json)
- [Versioned OpenAPI](/api/v1/openapi.json)
- [API docs](/api/v1/docs)
- [MCP](/api/v1/mcp)
- [Agent connections](/agents)
- [Action registry](/api/v1/agent/actions)
- [API and database health](/api/v1/health)
- [Release revision](/api/revision)

## Published inventory and route requests

The production flight list was empty on 25 November 2026. Read `GET /api/v1/flights` for current published inventory. Card payments are currently unavailable on production.

Travelers can submit a route to the review queue without signing in via `POST /api/v1/proposals` with `originCode` and `destCode`. Queue submissions have no alerts. For matching in-app alerts, use a traveler Bearer session to call `POST /api/v1/saved-searches/demands` with `origin`, `destination`, `departure` (YYYY-MM-DD), `trip: "oneway"` and `notify: true`. The same session can read requests and alerts at `GET /api/v1/saved-searches/demands` and `GET /api/v1/saved-searches/alerts`. A traveler-scoped agent token can read saved searches through `list_saved_searches`.

## Public REST reads

These endpoints require no authentication. See OpenAPI for native query parameters and response fields.

| Endpoint | Result |
| --- | --- |
| `GET /api/v1/flights` | List published flights |
| `GET /api/v1/flights/{id}` | Read a published flight |
| `GET /api/v1/acmi/aircraft` | List ACMI aircraft |
| `GET /api/v1/acmi/aircraft/{id}` | Read ACMI aircraft details |
| `GET /api/v1/jobs` | List published pilot jobs. Records with isExample=true are examples. |
| `GET /api/v1/jobs/{id}` | Read a published pilot job |
| `GET /api/v1/brokers` | List published crew brokers |
| `GET /api/v1/brokers/{slug}` | Read a crew broker and its published jobs |
| `GET /api/v1/companies` | List published company pages |
| `GET /api/v1/companies/{slug}` | Read a company page and its published jobs |
| `GET /api/v1/airports` | Read the airport catalogue |
| `GET /api/v1/airports/search` | Search the airport catalogue |
| `GET /api/v1/founders` | Read public Founders records and programme status |
| `GET /api/v1/operator-listings` | Find unclaimed operator or ACMI listings |

## Authorization

Public actions work anonymously. For saved searches and route watches, sign in at [Agents](/agents). Under **Connections**, name a token, choose the traveler scope and a lifetime of 1 to 365 days (default 90), then create it. Copy the secret when it appears. Pass it as `Authorization: Bearer mcp_…` in REST or MCP requests. Revoke access from the same page.

| Scope | Grants |
| --- | --- |
| `public:read` | Public tools |
| `traveler:read` | List saved searches for the token owner |
| `traveler:write` | Update saved route watch for the token owner |
| `traveler:read` | List missions for the token owner |
| `traveler:read` | Get mission for the token owner |
| `traveler:write` | Create mission for the token owner |
| `traveler:write` | Cancel mission for the token owner |
| `operator:read` | List operator opportunities for the token owner |
| `operator:write` | Update opportunity state for the token owner |
| `traveler:read` | List inbox items for the token owner |
| `traveler:write` | Update inbox item state for the token owner |

An invalid, expired or revoked token returns HTTP 401 `invalid_token`. For a scoped action, missing credentials return REST 401 `auth_required` and a token without the required scope returns REST 403 `insufficient_scope`. MCP returns those two scope errors, and every validation or business-rule error, as tool results with HTTP 200 and `isError: true`: always check `isError`, not only the HTTP status.

## Actions

| Action | Scope | Related REST read | Description |
| --- | --- | --- | --- |
| `search_flights` | public | `GET /api/v1/flights` | Search published passenger flights by route, date window and price. |
| `quote_price` | public | `POST /api/v1/pricing/quote` | Quote a published passenger flight using public pricing. |
| `list_acmi_aircraft` | public | `GET /api/v1/acmi/aircraft` | List active ACMI aircraft with pricing terms and maintenance status. |
| `list_jobs` | public | `GET /api/v1/jobs` | List published pilot jobs by keyword, rank and page size. |
| `list_brokers` | public | `GET /api/v1/brokers` | List published crew brokers in the public directory. |
| `list_saved_searches` | traveler:read | `GET /api/v1/saved-searches` | List the signed-in traveler's saved flight searches. |
| `update_saved_search` | traveler:write | `PATCH /api/v1/route-watches/{id}` | Replace the confirmed criteria of a route watch owned by the authenticated traveler. Use the watch ID and revision from GET /api/v1/route-watches. |
| `list_missions` | traveler:read | `GET /api/v1/missions` | List the signed-in traveler's missions, newest first, with state, outcome and next action. Results are research or offers; no booking is ever made. |
| `get_mission` | traveler:read | `GET /api/v1/missions/{id}` | Read one owned mission with its steps, linked records, events, transition history and result source and freshness. |
| `create_mission` | traveler:write | `POST /api/v1/missions` | Create a mission from confirmed structured parameters: trip (route, date, passengers, budget), recurring_trip (2-12 one-way departures) or aircraft_sourcing (ACMI shortlist). The worker searches and, with a watch.create grant, watches for fares. It stops at waiting_for_authorization with an offer and checkout link and never books. |
| `cancel_mission` | traveler:write | `POST /api/v1/missions/{id}/control` | Cancel an owned mission at its current revision. Linked route watches stay in the account. Cancelling an already cancelled mission returns it unchanged. |
| `list_operator_opportunities` | operator:read | `GET /api/v1/operator/opportunities` | List the signed-in operator's Supply Autopilot inbox: demand pools that fit its fleet, ACMI requests, open availability windows and stale calendars. Items are leads to review, not certified eligibility; any price shown is an estimate, never a confirmed quote. |
| `update_opportunity_state` | operator:write | `POST /api/v1/operator/opportunities/state` | Mark one item in the signed-in operator's Supply Autopilot inbox as open, dismissed, snoozed (1, 3 or 7 days) or done. Use the key from list_operator_opportunities. This only triages the inbox; it never sends a quote or changes availability. |
| `list_inbox_items` | traveler:read | `GET /api/v1/me/inbox` | List the signed-in traveler's exception inbox: trip changes, refunds, search and route-watch matches, demand-pool quotes and missions that need them. Items are derived from existing records; view active returns open items, all also returns snoozed, done and dismissed ones. |
| `update_inbox_item_state` | traveler:write | `POST /api/v1/me/inbox/state` | Mark one item in the signed-in traveler's exception inbox as open, done, snoozed (1 to 720 hours) or dismissed. Use the key from list_inbox_items; the key carries the item's version, so a key replaced by a newer event is refused as superseded. This only triages the inbox; it never books, cancels or changes the underlying trip, watch, pool or mission. |

Use the action schemas for parameters and results on the action URLs. REST returns each action's result directly. MCP returns the same result as `structuredContent` and JSON text. An empty list is a successful read.

## Limits and verification

REST executions allow 60 requests per minute per IP. MCP allows 120 per minute per IP for anonymous requests, or per token for authenticated requests. Check `ok` in the result and inspect the returned records. Verify the release with `GET /api/revision` and `GET /api/v1/health` on the same host.
