{
  "openapi": "3.1.0",
  "info": {
    "title": "Fare Scout Connector API",
    "version": "1.2.0",
    "description": "Track flight prices (exact dates, flexible date ranges, multi-city) and combined train/bus/ferry trip costs. Supports both standard OAuth 2.1 (MCP Streamable HTTP) and Bearer API keys."
  },
  "servers": [
    {
      "url": "https://vjennaakdmwsmlrucioj.supabase.co/functions/v1/fare-scout-connector",
      "description": "Fare Scout Production Connector"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "OAuth 2.1 access token or Fare Scout Connector API key (fs_...)."
      }
    }
  },
  "paths": {
    "/routes": {
      "get": {
        "operationId": "listRoutes",
        "summary": "List all tracked routes with live prices and booking links",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "createRoute",
        "summary": "Add a new flight route to track",
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/deals": {
      "get": {
        "operationId": "getDeals",
        "summary": "Get routes currently at or below their alert target",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/routes/{id}": {
      "patch": {
        "operationId": "updateRoute",
        "summary": "Partially update a tracked route by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      },
      "delete": {
        "operationId": "deleteRoute",
        "summary": "Remove a tracked route by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/routes/{id}/history": {
      "get": {
        "operationId": "getPriceHistory",
        "summary": "Get chronological price history for a tracked route",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/trending": {
      "get": {
        "operationId": "getTrendingFares",
        "summary": "Get recent anonymous trending flight fares",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}