{
  "openapi": "3.1.0",
  "info": {
    "title": "TrackDayFun REST & Machine Discovery API",
    "description": "Machine-readable REST API and discovery endpoints for TrackDayFun (TrackDayExperience LLC). Provides access to high-bank passenger hot-lap programs, supercar fleet telemetry, video syndication engine, brand assets, AI concierge, and 17-pillar sovereign foundation.",
    "version": "2.1.0",
    "contact": {
      "name": "TrackDayExperience LLC",
      "url": "https://trackdayfun.com",
      "email": "info@trackdayfun.com"
    },
    "license": {
      "name": "Proprietary: TrackDayExperience LLC",
      "url": "https://trackdayfun.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://trackdayfun.com",
      "description": "Production Server (APPS1 Sovereign Docker Cluster)"
    }
  ],
  "paths": {
    "/api/foundation": {
      "get": {
        "summary": "Fetch Sovereign Foundation Manifest",
        "description": "Returns site metadata, 17-pillar compliance status, legal entity data, and enabled MOD-* module registry.",
        "operationId": "getFoundation",
        "responses": {
          "200": {
            "description": "Sovereign foundation manifest successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": { "type": "string" },
                    "standardId": { "type": "string" },
                    "siteKey": { "type": "string" },
                    "domain": { "type": "string" },
                    "displayName": { "type": "string" },
                    "legalName": { "type": "string" },
                    "division": { "type": "string" },
                    "contact": { "type": "object" },
                    "compliance": { "type": "object" },
                    "features": { "type": "object" },
                    "enabledModules": {
                      "type": "array",
                      "items": { "type": "string" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mod/telemetry-garage": {
      "get": {
        "summary": "Fetch Telemetry Garage & Supercar Fleet Data",
        "description": "Returns the 8 track-prepared fleet builds, 12 paddock exotics, circuit physics (Daytona 31° & Sebring 17-turn), 908-photo gallery stats, 18 onboard video metadata, and driver rosters.",
        "operationId": "getTelemetryGarage",
        "responses": {
          "200": {
            "description": "Telemetry garage dataset successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "module": { "type": "string" },
                    "siteKey": { "type": "string" },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "fleetBuildsCount": { "type": "integer" },
                        "exoticPaddockCount": { "type": "integer" },
                        "circuitsCount": { "type": "integer" },
                        "videoVaultCount": { "type": "integer" },
                        "driversCount": { "type": "integer" },
                        "galleryPhotosCount": { "type": "integer" },
                        "topSpeed": { "type": "string" },
                        "maxBanking": { "type": "string" }
                      }
                    },
                    "fleetBuilds": { "type": "array", "items": { "type": "object" } },
                    "exoticPaddockCars": { "type": "array", "items": { "type": "object" } },
                    "circuits": { "type": "array", "items": { "type": "object" } },
                    "onboardVideos": { "type": "array", "items": { "type": "object" } },
                    "proDrivers": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mod/video-channel-engine": {
      "get": {
        "summary": "Fetch Unified Video Channel Engine",
        "description": "Returns 4-platform video distribution configuration across YouTube (@trackdaysarefun), HPDE.tv FAST linear broadcast, TikTok, and Vimeo, including master upload manifests.",
        "operationId": "getVideoChannelEngine",
        "responses": {
          "200": {
            "description": "Video channel engine configuration successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "module": { "type": "string" },
                    "standard": { "type": "string" },
                    "youtubeEngine": { "type": "object" },
                    "networkChannelLinking": { "type": "object" },
                    "driverShowcaseEngine": { "type": "object" },
                    "vaultVideosCount": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mod/brand-social-studio": {
      "get": {
        "summary": "Fetch Brand Identity Lab & Social Studio Manifest",
        "description": "Returns Concept 3 vector SVG logos, 8 calibrated 2560x1440 YouTube banners with 1546x423 safe zones, 6 circular avatars, and multi-channel social kit.",
        "operationId": "getBrandSocialStudio",
        "responses": {
          "200": {
            "description": "Brand and social studio manifest successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "module": { "type": "string" },
                    "catalogUrl": { "type": "string" },
                    "activeLogo": { "type": "string" },
                    "svgLogoPath": { "type": "string" },
                    "youtubeSafeZone": { "type": "string" },
                    "primaryYouTube": { "type": "string" },
                    "primaryTikTok": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mod/site-tree": {
      "get": {
        "summary": "Fetch Hierarchical Site Page Tree",
        "description": "Returns the complete hierarchical site structure, route definitions, metadata, and 301 legacy WordPress redirect rules.",
        "operationId": "getSiteTree",
        "responses": {
          "200": {
            "description": "Site page tree and navigation graph successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "routes": { "type": "array", "items": { "type": "object" } },
                    "legacyRedirects": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Query or Filter Site Tree",
        "description": "Filter site tree nodes by module, access level, or search query.",
        "operationId": "querySiteTree",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": { "type": "string" },
                  "module": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Filtered tree result successfully returned",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/api/concierge/chat": {
      "post": {
        "summary": "Interact with Nitro Track Co-Pilot",
        "description": "Interactive conversational AI concierge endpoint for passenger hot-lap booking guidance, telemetry queries, and circuit FAQ.",
        "operationId": "chatConcierge",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["message"],
                "properties": {
                  "message": { "type": "string", "description": "User question or inquiry" },
                  "history": { "type": "array", "items": { "type": "object" } },
                  "context": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Concierge response successfully generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reply": { "type": "string" },
                    "suggestions": { "type": "array", "items": { "type": "string" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/deep-help": {
      "get": {
        "summary": "Retrieve Deep Help Knowledgebase Articles",
        "description": "Fetch structured help articles on Snell SA2020/SA2025 helmets, high-bank physical dynamics, passenger attire, and booking requirements.",
        "operationId": "getDeepHelp",
        "responses": {
          "200": {
            "description": "Deep help knowledgebase successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "categories": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Search Deep Help Knowledgebase",
        "description": "Semantic or keyword search across passenger hot-lap documentation and track day procedures.",
        "operationId": "searchDeepHelp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["query"],
                "properties": {
                  "query": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search results successfully returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "results": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/photo-triage": {
      "post": {
        "summary": "Submit Passenger Helmet or Vehicle Photos for Triage",
        "description": "Upload guest helmet certification photos (Snell SA2020 / SA2025 label) or paddock photos for pre-scrutineering validation.",
        "operationId": "submitPhotoTriage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email", "photos"],
                "properties": {
                  "name": { "type": "string" },
                  "email": { "type": "string" },
                  "phone": { "type": "string" },
                  "notes": { "type": "string" },
                  "photos": {
                    "type": "array",
                    "items": { "type": "string", "description": "Base64 or image URL" }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Photo triage submission successfully received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "message": { "type": "string" },
                    "triageId": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "Fetch Concise LLM System Prompt & Manifest",
        "description": "Plain-text markdown document structured according to the llms.txt standard for AI search engines, Gemini, ChatGPT, and Claude.",
        "operationId": "getLlmsTxt",
        "responses": {
          "200": {
            "description": "Concise LLM summary manifest successfully returned",
            "content": {
              "text/plain": {
                "schema": { "type": "string" }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "summary": "Fetch Comprehensive LLM Reference Manual",
        "description": "Full-depth technical reference manual covering complete vehicle dynos, circuit engineering, telemetry pipelines, and safety standards.",
        "operationId": "getLlmsFullTxt",
        "responses": {
          "200": {
            "description": "Comprehensive LLM reference manual successfully returned",
            "content": {
              "text/plain": {
                "schema": { "type": "string" }
              }
            }
          }
        }
      }
    },
    "/specs.json": {
      "get": {
        "summary": "Fetch Structured Machine Specifications",
        "description": "JSON document detailing 8 fleet builds, 12 paddock cars, circuit metrics, video manifests, and network integrations.",
        "operationId": "getSpecsJson",
        "responses": {
          "200": {
            "description": "Structured specifications JSON successfully returned",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    }
  }
}
