{"openapi":"3.0.3","info":{"title":"TrendPulse API","version":"1.0.0","description":"Local-first IT-news OSINT aggregator: trends, AI reviews, community likes, a read checker and a news-push intake."},"servers":[{"url":"/"}],"tags":[{"name":"meta"},{"name":"news"},{"name":"auth"},{"name":"community"},{"name":"admin"}],"paths":{"/api/health":{"get":{"tags":["meta"],"summary":"Health + build id + totals","responses":{"200":{"description":"OK"}}}},"/api/news":{"get":{"tags":["news"],"summary":"Browse the news archive with filters","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"theme","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer"}},{"name":"minRating","in":"query","schema":{"type":"integer","minimum":1,"maximum":10}},{"name":"rated","in":"query","schema":{"type":"string","enum":["only","none"]}},{"name":"read","in":"query","schema":{"type":"string","enum":["read","unread"],"description":"Read checker filter (needs a Bearer token)."}},{"name":"sort","in":"query","schema":{"type":"string","enum":["heat","rating","likes","score","engagement","new","old"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":25}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Matching items + aggregate stats"}}}},"/api/news/push":{"post":{"tags":["news"],"summary":"Push a news item (url, description, rating)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushNewsRequest"}}}},"responses":{"200":{"description":"Item updated (same url already stored)"},"201":{"description":"Item created"},"400":{"description":"Validation error"}}}},"/api/news/push/schema":{"get":{"tags":["news"],"summary":"JSON Schema of the push request","responses":{"200":{"description":"JSON Schema"}}}},"/api/auth/register":{"post":{"tags":["auth"],"summary":"Create an account and return a token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["nickname"],"properties":{"nickname":{"type":"string","minLength":2,"maxLength":24}}}}}},"responses":{"201":{"description":"Account created"},"400":{"description":"Invalid nickname"},"409":{"description":"Nickname taken"}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Log in with a personal token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","minLength":20}}}}}},"responses":{"200":{"description":"Logged in"},"401":{"description":"Invalid token"}}}},"/api/me":{"get":{"tags":["auth"],"summary":"Current user profile","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Profile"},"401":{"description":"Unauthorized"}}}},"/api/reads/item":{"post":{"tags":["community"],"summary":"Toggle (or set) the read flag of an item","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itemId"],"properties":{"itemId":{"type":"string"},"read":{"type":"boolean"}}}}}},"responses":{"200":{"description":"New read state"},"401":{"description":"Unauthorized"}}}},"/api/logs":{"get":{"tags":["admin"],"summary":"Unified activity log (auth + LLM/ops)","security":[{"adminToken":[]}],"responses":{"200":{"description":"Events"},"401":{"description":"Unauthorized"}}}},"/api/llm/run":{"post":{"tags":["admin"],"summary":"Trigger an AI review run","security":[{"adminToken":[]}],"responses":{"200":{"description":"Run summary"}}}}},"components":{"schemas":{"PushNewsRequest":{"type":"object","required":["url","description","rating"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"Canonical http(s) URL of the story; also used as the item id (sha1)."},"description":{"type":"string","minLength":3,"maxLength":2000,"description":"Short description / excerpt, stored as the AI summary."},"rating":{"type":"number","minimum":1,"maximum":10,"description":"Significance rating (1-10); stored as the review rating."},"title":{"type":"string","maxLength":400,"description":"Optional headline. Defaults to the description."},"author":{"type":"string","maxLength":120,"description":"Optional attribution."},"verdict":{"type":"string","maxLength":40,"description":"Optional short verdict, e.g. 'Interesting'."},"publishedAt":{"type":"integer","description":"Optional epoch-ms publish time; defaults to now."}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"User token from /api/auth/register or /api/auth/login"},"adminToken":{"type":"apiKey","in":"header","name":"X-Admin-Token","description":"Token printed in the server console on boot"}}}}