{"openapi":"3.1.0","info":{"title":"CollectSEA API","version":"2026.10.17-seo-visuals","description":"Match a proposed design or existing software or AI app to documented real-world failures and get source-linked precedents, failure patterns and safeguards. Public, read-only, no API key. Identify automated clients with an X-CollectSEA-Client header.","contact":{"url":"https://collectsea.com/about#contact"},"license":{"name":"Data: CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"}},"servers":[{"url":"https://collectsea.com"}],"externalDocs":{"url":"https://collectsea.com/docs"},"paths":{"/api/app-context":{"post":{"operationId":"importAppContext","summary":"Import selected context from a public GitHub repository","description":"Reads a bounded selection of docs, config and source at one revision. Returns files for inspection and submission to /api/analyze. Never executes code. Limited to 6 imports per minute per IP; GitHub quotas also apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["repository_url"],"properties":{"repository_url":{"type":"string","format":"uri","example":"https://github.com/owner/app"}}}}}},"responses":{"200":{"description":"Selected text files, repository URL, pinned revision and import notices","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid repository home URL","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Private or unavailable repository","content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Repository context too large","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Import or GitHub rate limit","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"GitHub unavailable or import timed out","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/analyze":{"post":{"operationId":"analyzeDesign","summary":"Find real incidents and safeguards for a planned design or existing app","description":"Profiles behavior signals in a design description or submitted existing-app context, retrieves analogous documented incidents and advisories, and returns safeguards. Call this before implementing features that move money, delete data, change permissions, run code, or let an AI agent act on external content.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","anyOf":[{"required":["proposal"]},{"properties":{"mode":{"const":"existing_app"},"files":{"minItems":1}},"required":["files","mode"]}],"properties":{"repository":{"type":"object","description":"Repository metadata returned by /api/app-context; preserve it alongside imported files.","properties":{"url":{"type":"string"},"revision":{"type":"string"},"selected_files":{"type":"integer"},"available_files":{"type":"integer"},"partial":{"const":true}},"required":["url","revision","selected_files","available_files","partial"]},"mode":{"type":"string","enum":["design","existing_app"],"default":"design"},"files":{"type":"array","maxItems":10,"description":"Existing-app mode only. Combined description and file contents: at most 25,000 characters. Entire request: at most 32 KB. Text is not executed or crawled.","items":{"type":"object","required":["name","content"],"properties":{"name":{"type":"string","minLength":1,"maxLength":160},"content":{"type":"string","minLength":1,"maxLength":25000},"origin":{"type":"string","enum":["repository","upload"],"description":"Preserve repository origin from /api/app-context; mark additional local text as upload."}}}},"proposal":{"type":"string","maxLength":25000,"description":"What the system does: what it can change, what it reads, which services it calls."},"max_results":{"type":"integer","minimum":1,"maximum":25,"default":6},"exclude_incident_ids":{"type":"array","items":{"type":"string"},"maxItems":10}}}}}},"responses":{"200":{"description":"Analysis result","content":{"application/json":{"schema":{"type":"object","properties":{"analysis_id":{"type":"string"},"input_context":{"type":"object","properties":{"mode":{"type":"string","enum":["design","existing_app"]},"sources":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"characters":{"type":"integer"}}}},"limitations":{"type":"string"}}},"profile":{"type":"object"},"matches":{"type":"array","items":{"type":"object","properties":{"incident":{"type":"object"},"composite_score":{"type":"number"},"why_analogous":{"type":"string"},"lessons":{"type":"array","items":{"type":"object"}}}}},"top_lessons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"statement":{"type":"string"},"actionable_rule":{"type":"string"},"supporting_incident_ids":{"type":"array","items":{"type":"string"}}}}},"coverage":{"type":"object","properties":{"status":{"type":"string","enum":["strong","partial","none"]},"message":{"type":"string"}}},"metadata":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Proposal too long","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/incidents":{"get":{"operationId":"listIncidents","summary":"List served records","parameters":[{"name":"view","in":"query","schema":{"type":"string","enum":["full","summary"]},"description":"summary returns compact records"}],"responses":{"200":{"description":"Records","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/incidents/{id}":{"get":{"operationId":"getIncident","summary":"Get one record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"SEA-POST-005"}],"responses":{"200":{"description":"Record","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/patterns":{"get":{"operationId":"listFailurePatterns","summary":"Failure-pattern taxonomy","responses":{"200":{"description":"Patterns","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/frameworks":{"get":{"operationId":"listFrameworks","summary":"Framework crosswalk (OWASP, NIST, CISA, CWE)","responses":{"200":{"description":"Frameworks","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/stats":{"get":{"operationId":"getStats","summary":"Corpus counts and headline usage","responses":{"200":{"description":"Stats","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/impact":{"get":{"operationId":"getImpact","summary":"Privacy-preserving usage report (last 30 days)","responses":{"200":{"description":"Impact report","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/benchmark":{"get":{"operationId":"getBenchmark","summary":"Internal retrieval benchmark on the served corpus","responses":{"200":{"description":"Benchmark results","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/health":{"get":{"operationId":"getHealth","summary":"Deployment contract, corpus version and feed health","responses":{"200":{"description":"Health","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/feedback":{"post":{"operationId":"sendFeedback","summary":"Send feedback or report a problem with a record","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"type":{"type":"string"},"message":{"type":"string","maxLength":2000},"email":{"type":"string"},"incident_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Received","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}