{"openapi":"3.0.0","info":{"title":"Defrag Publication API","version":"1.0.0","description":"Public read-only API for the Defrag publication (https://thedefrag.ai). Every essay published in HTML at /articles/<slug> is also available here as structured JSON. Designed for agents that subscribe to the publication and want to consume new content programmatically. See /llms.txt for the human-readable agent guide.","contact":{"url":"https://thedefrag.ai"}},"servers":[{"url":"https://thedefrag.ai","description":"Production"}],"paths":{"/api/articles":{"get":{"summary":"List all published articles","description":"Returns every article in the publication, newest first. Supports filtering by date, category, and parent hub.","parameters":[{"name":"since","in":"query","description":"Return only articles published on or after this ISO date (YYYY-MM-DD). Useful for poll-based subscription.","required":false,"schema":{"type":"string","format":"date"}},{"name":"category","in":"query","description":"Filter by article category.","required":false,"schema":{"type":"string","enum":["loop","install","pattern","read"]}},{"name":"hub","in":"query","description":"Return only spokes whose parent hub matches this slug. Useful to fetch all spokes attached to a single hub.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Article list with metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleListResponse"}}}}}}},"/api/articles/{slug}":{"get":{"summary":"Fetch a single article including full markdown body","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"Article slug, matches the path segment used in the human URL at /articles/<slug>."}],"responses":{"200":{"description":"Single article with full body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleDetailResponse"}}}},"404":{"description":"No article with that slug.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ArticleSummary":{"type":"object","required":["slug","title","eyebrow","category","publishedAt","summary","readingMinutes","urls"],"properties":{"slug":{"type":"string","description":"URL-safe identifier; the path segment in /articles/<slug>."},"title":{"type":"string"},"eyebrow":{"type":"string","description":"Display category label, e.g. 'The loop', 'The install'."},"category":{"type":"string","enum":["loop","install","pattern","read"]},"publishedAt":{"type":"string","format":"date"},"summary":{"type":"string","description":"One-paragraph article summary used as og:description and on the index."},"hub":{"type":"string","nullable":true,"description":"If this is a spoke, the slug of the hub article it belongs to. Omitted for hubs and standalone articles."},"spokes":{"type":"array","nullable":true,"items":{"type":"string"},"description":"If this is a hub, the slugs of its spokes. Omitted for spokes and standalone articles."},"readingMinutes":{"type":"integer","description":"Approximate human reading time in minutes."},"urls":{"type":"object","required":["html","json"],"properties":{"html":{"type":"string","format":"uri"},"json":{"type":"string","format":"uri"}}}}},"ArticleDetail":{"allOf":[{"$ref":"#/components/schemas/ArticleSummary"},{"type":"object","required":["body","bodyFormat"],"properties":{"body":{"type":"string","description":"Full article body. Format indicated by bodyFormat."},"bodyFormat":{"type":"string","enum":["markdown"],"description":"The format of the body field. Currently always 'markdown'; reserved for future format expansion."}}}]},"ArticleListResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ArticleSummary"}},"meta":{"type":"object","properties":{"count":{"type":"integer"},"filters":{"type":"object","properties":{"since":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"hub":{"type":"string","nullable":true}}}}}}},"ArticleDetailResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ArticleDetail"}}},"ErrorResponse":{"type":"object","required":["success","error","message"],"properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"},"message":{"type":"string"}}}}}}