{"openapi":"3.1.0","info":{"title":"Coreflux LoT Templates API","version":"1.0.0","description":"Public read API for the Coreflux LoT template library. Search published notebooks and read one template, including its LoT Notebook cells. No API key is required. Errors use HTTP status codes and a JSON body { error: { code, message, hint } }."},"servers":[{"url":"https://templates.coreflux.org"}],"tags":[{"name":"templates","description":"Published LoT Notebook templates."},{"name":"discovery","description":"Documents that describe this API."}],"paths":{"/api/templates":{"get":{"operationId":"listTemplates","tags":["templates"],"summary":"Search or list published templates","description":"When q is set, runs the same hybrid search as the website. When q is omitted, returns the most recently published templates. Results omit the full markdown body; call getTemplate for notebook cells.","parameters":[{"name":"q","in":"query","required":false,"description":"Search text. Matches titles, descriptions, tags, routes, and template content.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of templates to return. Integer from 1 to 30. Default 20.","schema":{"type":"integer","minimum":1,"maximum":30,"default":20}},{"name":"category_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Only templates in this category."},{"name":"difficulty","in":"query","required":false,"schema":{"type":"string","enum":["beginner","intermediate","advanced"]},"description":"Only templates at this difficulty."},{"name":"tag_ids","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated tag ids. Applied only when q is set. A template must match one of them."},{"name":"route_ids","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated route ids. Applied only when q is set. A template must use one of them."},{"name":"broker_version_ids","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated broker version ids. Applied only when q is set."}],"responses":{"200":{"description":"Matching published templates.","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","required":["id","title","short_description"],"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","nullable":true},"title":{"type":"string"},"short_description":{"type":"string"},"difficulty":{"type":"string","enum":["beginner","intermediate","advanced"]},"url":{"type":"string","format":"uri"},"category":{"type":"object","nullable":true,"additionalProperties":true},"tags":{"type":"array","items":{"type":"object","additionalProperties":true}},"routes":{"type":"array","items":{"type":"object","additionalProperties":true}},"broker_version":{"type":"object","nullable":true,"additionalProperties":true}}}}}}}}},"400":{"description":"A query parameter is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"hint":{"type":"string","description":"What the caller should do next."}}}}}}}},"500":{"description":"Search failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"hint":{"type":"string","description":"What the caller should do next."}}}}}}}}}}},"/api/templates/{idOrSlug}":{"get":{"operationId":"getTemplate","tags":["templates"],"summary":"Read one published template","description":"Returns the public template fields and the latest LoT Notebook cells for each filename. Drafts and hidden templates respond as not found.","parameters":[{"name":"idOrSlug","in":"path","required":true,"description":"Template UUID or public slug.","schema":{"type":"string"}}],"responses":{"200":{"description":"The published template.","content":{"application/json":{"schema":{"type":"object","required":["template"],"properties":{"template":{"type":"object","required":["id","title","url","notebooks"],"properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"title":{"type":"string"},"short_description":{"type":"string"},"content":{"type":"string","description":"Template markdown body."},"difficulty":{"type":"string"},"url":{"type":"string","format":"uri"},"category":{"type":"object","nullable":true,"additionalProperties":true},"tags":{"type":"array","items":{"type":"object","additionalProperties":true}},"routes":{"type":"array","items":{"type":"object","additionalProperties":true}},"notebooks":{"type":"array","items":{"type":"object","required":["filename","cells"],"properties":{"filename":{"type":"string"},"version":{"type":"integer"},"is_primary":{"type":"boolean"},"cells":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}}}},"404":{"description":"No published template matches this id or slug.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"hint":{"type":"string","description":"What the caller should do next."}}}}}}}},"500":{"description":"The template could not be loaded.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"hint":{"type":"string","description":"What the caller should do next."}}}}}}}}}}},"/api/search":{"get":{"operationId":"searchTemplates","tags":["templates"],"summary":"Search published templates","description":"Same hybrid search as the website search box. Requires q. Prefer listTemplates when you also want the latest templates with an empty query.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"Search text."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":30,"default":20},"description":"Maximum results. Integer from 1 to 30."}],"responses":{"200":{"description":"Search results, including the template markdown content field.","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"A query parameter is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"hint":{"type":"string","description":"What the caller should do next."}}}}}}}},"500":{"description":"Search failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"hint":{"type":"string","description":"What the caller should do next."}}}}}}}}}},"post":{"operationId":"searchTemplatesPost","tags":["templates"],"summary":"Search published templates with a JSON body","description":"Body is { query, limit?, filters?: { category_id, difficulty, tag_ids, route_ids, broker_version_ids } }. Used by the website. Agents can use GET /api/templates instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":30},"filters":{"type":"object","properties":{"category_id":{"type":"string","nullable":true},"difficulty":{"type":"string","nullable":true},"tag_ids":{"type":"array","items":{"type":"string"},"nullable":true},"route_ids":{"type":"array","items":{"type":"string"},"nullable":true},"broker_version_ids":{"type":"array","items":{"type":"string"},"nullable":true}}}}}}}},"responses":{"200":{"description":"Search results.","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"500":{"description":"Search failed. The error field stays a string for the website; code, message, and hint are also set.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/openapi.json":{"get":{"operationId":"getOpenApiSpec","tags":["discovery"],"summary":"This OpenAPI document","description":"Machine-readable description of the public template API.","responses":{"200":{"description":"OpenAPI 3.1 JSON.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}}}}