{
  "openapi": "3.0.3",
  "info": {
    "title": "MapForHuman Seattle Developer Pilot",
    "version": "1.6.5",
    "description": "Email-verified 15-day pilot: prepared Seattle geography, available Metro live data, and bounded route/search queries within 50 statute miles of central Seattle. Server-side keys only. No live road-traffic or background navigation guarantee."
  },
  "servers": [
    {
      "url": "https://cfhmap-launch.azurewebsites.net"
    }
  ],
  "security": [
    {
      "pilotKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "pilotKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Private mfh_pilot_ key shown once in the portal; expires at the original account trial end."
      }
    }
  },
  "paths": {
    "/api/v1/catalog": {
      "get": {
        "operationId": "getPilotCatalog",
        "summary": "Resources, attribution and allowances",
        "responses": {
          "200": {
            "description": "Pilot catalog"
          },
          "401": {
            "description": "Invalid, revoked or expired key"
          },
          "429": {
            "description": "Shared pilot allowance reached"
          }
        }
      }
    },
    "/api/v1/maps/seattle": {
      "get": {
        "operationId": "getSeattleMap",
        "summary": "Prepared Seattle source-attributed GeoJSON",
        "responses": {
          "200": {
            "description": "GeoJSON FeatureCollection with attribution",
            "content": {
              "application/geo+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, revoked or expired key"
          },
          "429": {
            "description": "Shared pilot allowance reached"
          }
        }
      }
    },
    "/api/v1/transit": {
      "get": {
        "operationId": "getSeattleTransit",
        "summary": "Available Metro vehicles, predictions and alerts, including freshness and attribution",
        "responses": {
          "200": {
            "description": "Scoped transit data; inspect freshness and availability fields"
          },
          "401": {
            "description": "Invalid, revoked or expired key"
          },
          "429": {
            "description": "Shared pilot allowance reached"
          },
          "503": {
            "description": "Transit metadata unavailable"
          }
        }
      }
    },
    "/api/v1/directions": {
      "post": {
        "summary": "Calculate a walking, cycling, driving or supported transit journey",
        "security": [
          {
            "pilotKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "from",
                  "to",
                  "mode"
                ],
                "properties": {
                  "from": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 2,
                    "maxItems": 2,
                    "description": "[longitude, latitude] in WGS84; within 50 miles of [-122.3321,47.6062]."
                  },
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 2,
                    "maxItems": 2,
                    "description": "[longitude, latitude] in WGS84; within 50 miles of [-122.3321,47.6062]."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "walk",
                      "bike",
                      "drive",
                      "transit"
                    ]
                  },
                  "departAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Transit only, now through 14 days ahead."
                  },
                  "avoidFerries": {
                    "type": "boolean"
                  },
                  "avoidTolls": {
                    "type": "boolean"
                  },
                  "avoidHighways": {
                    "type": "boolean"
                  },
                  "bikePreference": {
                    "type": "string",
                    "enum": [
                      "lanes",
                      "direct"
                    ],
                    "default": "lanes",
                    "description": "Bike mode only. Prefer mapped bike lanes and bike-permitted paths, or allow more direct street routing. Roads can remain necessary. No safety, surface or closure guarantee."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Source-attributed response; instructions and geometry for directions."
          },
          "400": {
            "description": "Invalid input."
          },
          "401": {
            "description": "Invalid, expired or revoked key."
          },
          "422": {
            "description": "Outside the service area or no connected journey found."
          },
          "429": {
            "description": "Pilot/routing allowance or capacity reached."
          },
          "503": {
            "description": "Engine or source unavailable; never a fabricated route."
          }
        }
      }
    },
    "/api/v1/search": {
      "post": {
        "summary": "Search the prepared OSM place/address index",
        "security": [
          {
            "pilotKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "q"
                ],
                "properties": {
                  "q": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Source-attributed response; instructions and geometry for directions."
          },
          "400": {
            "description": "Invalid input."
          },
          "401": {
            "description": "Invalid, expired or revoked key."
          },
          "422": {
            "description": "Outside the service area or no connected journey found."
          },
          "429": {
            "description": "Pilot/routing allowance or capacity reached."
          },
          "503": {
            "description": "Engine or source unavailable; never a fabricated route."
          }
        }
      }
    },
    "/api/v1/reverse": {
      "post": {
        "summary": "Find the nearest mapped place/address within 200 m; approximate and not an entrance lookup",
        "security": [
          {
            "pilotKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "coordinates"
                ],
                "properties": {
                  "coordinates": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 2,
                    "maxItems": 2,
                    "description": "[longitude, latitude] in WGS84; within 50 miles of [-122.3321,47.6062]."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Source-attributed response; instructions and geometry for directions."
          },
          "400": {
            "description": "Invalid input."
          },
          "401": {
            "description": "Invalid, expired or revoked key."
          },
          "422": {
            "description": "Outside the service area or no connected journey found."
          },
          "429": {
            "description": "Pilot/routing allowance or capacity reached."
          },
          "503": {
            "description": "Engine or source unavailable; never a fabricated route."
          }
        }
      }
    }
  }
}
