{"openapi":"3.1.0","info":{"title":"Kern (joinkern) Public API","version":"1.0.0","description":"Read-only Kern product information and published knowledge. No API key required. Personal account and health data are not exposed.","contact":{"name":"Kern support","email":"support@joinkern.com","url":"https://www.joinkern.com/contact"}},"servers":[{"url":"https://www.joinkern.com"}],"externalDocs":{"description":"Kern developer documentation and MCP instructions","url":"https://www.joinkern.com/docs"},"security":[],"paths":{"/api":{"get":{"operationId":"discoverKernPublicApi","summary":"Discover the public API","description":"Return the public API version and links to endpoints, developer documentation, OpenAPI, and MCP.","responses":{"200":{"description":"API discovery links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Discovery"}}}},"405":{"description":"Use GET for this read-only endpoint.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/site":{"get":{"operationId":"getKernSiteInfo","summary":"Read Kern product information","description":"Return features, integrations, use cases, beta availability, download and support links. Does not read account data.","responses":{"200":{"description":"Public Kern information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteInfo"}}}},"405":{"description":"Use GET for this read-only endpoint.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/knowledge":{"get":{"operationId":"searchKernKnowledge","summary":"Search published knowledge articles","description":"List or search published articles by title, description, excerpt, and tags. All search terms must match. Results are paginated and exclude drafts.","parameters":[{"name":"q","in":"query","required":false,"description":"Case-insensitive search terms. Omit to list articles.","schema":{"type":"string","maxLength":120}},{"name":"category","in":"query","required":false,"description":"Filter by a knowledge category.","schema":{"type":"string","enum":["sleep","recovery","training","nutrition","health","running","cycling"]}},{"name":"limit","in":"query","required":false,"description":"Maximum number of results on this page.","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"offset","in":"query","required":false,"description":"Number of matching articles to skip.","schema":{"type":"integer","minimum":0,"maximum":10000,"default":0}}],"responses":{"200":{"description":"A page of published article summaries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgePage"}}}},"400":{"description":"Invalid search or pagination parameters.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"Use GET for this read-only endpoint.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Knowledge is temporarily unavailable; retry later.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/knowledge/{category}/{slug}":{"get":{"operationId":"getKernKnowledgeArticle","summary":"Read a published article","description":"Read one published article with its Markdown body, metadata, and canonical URL. Does not expose draft articles or source file paths.","parameters":[{"name":"category","in":"path","required":true,"description":"The article category returned by search.","schema":{"type":"string","enum":["sleep","recovery","training","nutrition","health","running","cycling"]}},{"name":"slug","in":"path","required":true,"description":"The article slug returned by search.","schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[a-z0-9-]+$"}}],"responses":{"200":{"description":"The published article and its content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeArticle"}}}},"404":{"description":"No published article matches this category and slug.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"Use GET for this read-only endpoint.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The article is temporarily unavailable; retry later.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"schemas":{"Problem":{"type":"object","required":["type","title","status","code","detail","resolution","documentation"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string"},"detail":{"type":"string"},"resolution":{"type":"string"},"documentation":{"type":"string","format":"uri"}}},"Discovery":{"type":"object","required":["name","version","description","documentation","openapi","mcp","endpoints"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"documentation":{"type":"string","format":"uri"},"openapi":{"type":"string","format":"uri"},"mcp":{"type":"string","format":"uri"},"endpoints":{"type":"array","items":{"type":"string","format":"uri"}}}},"SiteInfo":{"type":"object","required":["name","description","url","supportEmail","downloadUrl","availability","useCases","features","integrations","resources","access"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"url":{"type":"string","format":"uri"},"supportEmail":{"type":"string","format":"email"},"downloadUrl":{"type":"string","format":"uri"},"availability":{"type":"string"},"useCases":{"type":"array","items":{"type":"string"}},"access":{"type":"string"},"integrations":{"type":"array","items":{"type":"string"}},"features":{"type":"array","items":{"type":"object","required":["name","description"],"properties":{"name":{"type":"string"},"description":{"type":"string"}}}},"resources":{"type":"array","items":{"type":"object","required":["name","url"],"properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"}}}}}},"KnowledgeSummary":{"type":"object","required":["title","slug","category","description","excerpt","tags","updatedAt","readingTime","url"],"properties":{"title":{"type":"string"},"slug":{"type":"string"},"category":{"type":"string","enum":["sleep","recovery","training","nutrition","health","running","cycling"]},"description":{"type":"string"},"excerpt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"updatedAt":{"type":"string","format":"date"},"readingTime":{"type":"string"},"url":{"type":"string","format":"uri"}}},"KnowledgeArticle":{"type":"object","required":["title","slug","category","description","excerpt","tags","updatedAt","readingTime","url","markdown"],"properties":{"title":{"type":"string"},"slug":{"type":"string"},"category":{"type":"string","enum":["sleep","recovery","training","nutrition","health","running","cycling"]},"description":{"type":"string"},"excerpt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"updatedAt":{"type":"string","format":"date"},"readingTime":{"type":"string"},"url":{"type":"string","format":"uri"},"markdown":{"type":"string"}}},"KnowledgePage":{"type":"object","required":["items","total","limit","offset"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeSummary"},"maxItems":50},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":50},"offset":{"type":"integer","minimum":0}}}}}}