{"openapi":"3.1.0","info":{"title":"KWire Knowledge API","version":"1.0.0","description":"Source-backed knowledge for KEM Next CI projects. Every fact and claim carries its sources. Read-only; returns published knowledge only."},"servers":[{"url":"https://kwire.org/api/v1"}],"security":[{"bearer":[]}],"paths":{"/search":{"get":{"operationId":"search","summary":"Search knowledge","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25,"default":10}}],"responses":{"200":{"description":"Ranked results","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"query":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/EntitySummary"}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scope":"knowledge:read"}},"/entities/{slug}":{"get":{"operationId":"getEntity","summary":"Get an entity with facts, claims, sources, relationships, official accounts and news","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The entity","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Entity"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scope":"knowledge:read"}},"/dimensions/{dimension}":{"get":{"operationId":"listDimension","summary":"List entities in a knowledge dimension","parameters":[{"name":"dimension","in":"path","required":true,"schema":{"type":"string","enum":["codex","graph","intelligence","timeline","verify","collective","atlas","cosmos","frontier"]}}],"responses":{"200":{"description":"Entities","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"dimension":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/EntitySummary"}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scope":"knowledge:read"}},"/people":{"get":{"operationId":"listPeople","summary":"List people profiles","parameters":[{"name":"sector","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"People","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/EntitySummary"}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scope":"knowledge:read"}},"/answer":{"post":{"operationId":"answer","summary":"Ask a source-grounded question","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string","minLength":3,"maxLength":500}}}}}},"responses":{"200":{"description":"Answer with citations and stated uncertainty","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Answer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scope":"intelligence:query"}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key `kw_live_…` issued per CI project."}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}}},"schemas":{"Meta":{"type":"object","properties":{"requestId":{"type":"string"},"source":{"type":"string"},"attribution":{"type":"string"}}},"Source":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"},"publisher":{"type":"string"},"publisherType":{"type":"string"},"tier":{"type":"integer","description":"1 primary/official, 2 institutional, 3 reputable secondary"}}},"EntitySummary":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"subtitle":{"type":"string"},"sector":{"type":["string","null"]},"summary":{"type":"string"},"dimensions":{"type":"array","items":{"type":"string"}},"url":{"type":"string","format":"uri"}}},"Entity":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"subtitle":{"type":"string"},"summary":{"type":"string"},"url":{"type":"string"},"date":{"type":["object","null"],"properties":{"value":{"type":"string","format":"date"},"precision":{"type":"string","enum":["day","month","year"]},"basis":{"type":["string","null"]}}},"person":{"type":["object","null"],"properties":{"fictional":{"type":"boolean"},"living":{"type":["boolean","null"]},"website":{"type":["object","null"]},"remembranceFlowers":{"type":["integer","null"]}}},"facts":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":"string"},"source":{"$ref":"#/components/schemas/Source"}}}},"claims":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["documented","disputed","opinion","promotional","hypothesis"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/Source"}}}}},"relationships":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"source":{"$ref":"#/components/schemas/Source"}}}},"socialAccounts":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"handle":{"type":"string"},"url":{"type":"string"},"verification":{"type":"string"},"proofUrl":{"type":"string"}}}},"news":{"type":"array","items":{"type":"object","properties":{"outlet":{"type":"string"},"headline":{"type":"string"},"url":{"type":"string"},"publishedAt":{"type":"string","format":"date"}}}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/Source"}}}},"Answer":{"type":"object","properties":{"question":{"type":"string"},"answer":{"type":"string"},"provider":{"type":"string"},"uncertainty":{"type":"string"},"citations":{"type":"array","items":{"type":"object"}},"related":{"type":"array","items":{"$ref":"#/components/schemas/EntitySummary"}}}}}}}