{
  "openapi": "3.1.0",
  "info": {
    "title": "LINC Innovations API",
    "version": "1.0.0",
    "description": "Public API specification for LINC Innovations public endpoints, including DawnCup event leaderboards, contact form, app downloads, and blog feeds.",
    "contact": {
      "name": "LINC Innovations",
      "email": "hello@lincinnovations.com",
      "url": "https://lincinnovations.com"
    }
  },
  "servers": [
    {
      "url": "https://lincinnovations.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "summary": "Submit Contact or Audit Request",
        "description": "Submits a Device Truth Audit inquiry or general contact form message.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message received successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/dawncup/leaderboard": {
      "get": {
        "summary": "Get DawnCup Workout Leaderboard",
        "description": "Returns fitness leaderboard data and rankings for a given workout event or join code.",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "Short join code (e.g. DAWN)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "description": "Event ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful leaderboard retrieval",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "event": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "join_code": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rank": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "duration_ms": {
                            "type": "number"
                          },
                          "at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "submissions": {
                      "type": "integer"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Event or code not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/feed.json": {
      "get": {
        "summary": "JSON Feed Blog Feed",
        "description": "Returns the JSON Feed (v1.1) of all published engineering blog posts.",
        "responses": {
          "200": {
            "description": "JSON Feed v1.1 document",
            "content": {
              "application/feed+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "home_page_url": {
                      "type": "string"
                    },
                    "feed_url": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "content_html": {
                            "type": "string"
                          },
                          "date_published": {
                            "type": "string"
                          },
                          "_slug": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/feed.xml": {
      "get": {
        "summary": "RSS 2.0 Blog Feed",
        "description": "Returns the RSS 2.0 XML feed of all published engineering blog posts.",
        "responses": {
          "200": {
            "description": "RSS 2.0 XML feed",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/download/precisionlevel": {
      "get": {
        "summary": "Download LINC Application Binary",
        "description": "Redirects to the latest release binary for PrecisionLevel.",
        "responses": {
          "302": {
            "description": "Redirecting to binary download URL"
          },
          "307": {
            "description": "Temporary redirect to binary download URL"
          }
        }
      }
    }
  }
}
