{"openapi":"3.0.3","info":{"title":"Tently API","description":"The institutional memory layer for codebases in the agent era.","version":"0.1.0"},"components":{"schemas":{}},"paths":{"/health":{"get":{"summary":"Liveness probe","tags":["system"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"uptime":{"type":"number","description":"Process uptime in seconds."},"timestamp":{"type":"string","format":"date-time"}},"required":["status","uptime","timestamp"],"additionalProperties":false}}}}}}},"/v1/echo":{"post":{"summary":"Echo a message back (zod-validated)","tags":["example"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":280,"description":"Text to echo back."},"shout":{"type":"boolean","default":false,"description":"Uppercase the echoed message."}},"required":["message"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"echoed":{"type":"string"},"length":{"type":"integer"}},"required":["echoed","length"],"additionalProperties":false}}}}}}},"/v1/auth/github":{"get":{"summary":"Begin GitHub OAuth login","tags":["auth"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"next","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"ref","required":false}],"responses":{"302":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/github/callback":{"get":{"summary":"GitHub OAuth callback","tags":["auth"],"parameters":[{"schema":{"type":"string","minLength":1},"in":"query","name":"code","required":false},{"schema":{"type":"string"},"in":"query","name":"state","required":false},{"schema":{"type":"string"},"in":"query","name":"error","required":false}],"responses":{"302":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/me":{"get":{"summary":"Current authenticated user","tags":["auth"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"githubUserId":{"type":"number"},"githubLogin":{"type":"string"},"plan":{"type":"string","enum":["solo","crew","fleet"]},"orgName":{"type":"string"},"orgLogin":{"type":"string","nullable":true},"role":{"type":"string","enum":["owner","member","viewer"]},"isPlatformAdmin":{"type":"boolean"}},"required":["userId","orgId","githubUserId","githubLogin","plan","orgName","orgLogin","role","isPlatformAdmin"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/logout":{"post":{"summary":"Log out","tags":["auth"],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}}}}},"/v1/jobs/echo":{"post":{"summary":"Enqueue a demo echo job","tags":["jobs"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":500}},"required":["message"],"additionalProperties":false}}},"required":true},"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string","nullable":true},"queue":{"type":"string"}},"required":["jobId","queue"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/webhooks/github":{"post":{"summary":"GitHub App webhook receiver","tags":["webhooks"],"description":"Verifies the X-Hub-Signature-256 HMAC over the raw body, parses the event, and enqueues review/extract jobs (installation events sync repo access instead). 202 handled, 200 duplicate delivery, 204 ignored, 401 bad signature, 503 unconfigured.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"duplicate":{"type":"boolean","enum":[true]},"enqueued":{"type":"number","enum":[0]}},"required":["duplicate","enqueued"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enqueued":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0}},"required":["enqueued","skipped"],"additionalProperties":false}}}},"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions/search":{"post":{"summary":"Search decisions for the MCP write-time gate","tags":["decisions"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":4000},"repoId":{"type":"string","format":"uuid"},"repos":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":5},"paths":{"type":"array","items":{"type":"string","minLength":1}},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["query"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"rationale":{"type":"string"},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"]},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"similarity":{"type":"number","nullable":true}},"required":["id","title","rationale","tier","status","enforcement","scope","similarity"],"additionalProperties":false}}},"required":["decisions"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos":{"get":{"summary":"List the org repos with their index status","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"repos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fullName":{"type":"string"},"defaultBranch":{"type":"string"},"prMiningLimit":{"type":"integer"},"reviewBranchMode":{"type":"string","enum":["default_only","all","custom"]},"reviewBranchPatterns":{"type":"array","items":{"type":"string"}},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewDependencyPrs":{"type":"boolean"},"services":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"globs":{"type":"array","items":{"type":"string"},"default":[]}},"required":["key","label"],"additionalProperties":false}},"enabled":{"type":"boolean"},"countsTowardLimit":{"type":"boolean"},"overLimit":{"type":"boolean"},"installationId":{"type":"integer","nullable":true},"indexState":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","INDEXING","READY","FAILED","DISCONNECTED"]},"lastIndexedSha":{"type":"string","nullable":true},"prMiningCursor":{"type":"integer","nullable":true},"progress":{"type":"object","properties":{"phase":{"type":"string","enum":["resolving","scanning_docs","mining_docs","mining_prs","deduping","finalizing","cloning"]},"current":{"type":"integer","minimum":0,"nullable":true},"total":{"type":"integer","minimum":0,"nullable":true}},"required":["phase","current","total"],"additionalProperties":false,"nullable":true},"updatedAt":{"type":"string","format":"date-time"},"error":{"type":"string","nullable":true},"deferredUntil":{"type":"string","format":"date-time","nullable":true}},"required":["status","lastIndexedSha","prMiningCursor","progress","updatedAt","error","deferredUntil"],"additionalProperties":false,"nullable":true}},"required":["id","fullName","defaultBranch","prMiningLimit","reviewBranchMode","reviewBranchPatterns","reviewTriggerMode","reviewCheckMode","reviewDependencyPrs","services","enabled","countsTowardLimit","overLimit","installationId","indexState"],"additionalProperties":false}}},"required":["repos"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add a GitHub repo to the workspace (off, not indexed)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"githubRepoId":{"type":"integer"},"fullName":{"type":"string","minLength":1},"defaultBranch":{"type":"string","minLength":1},"installationId":{"type":"integer"},"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000},"acceptExtraRepo":{"type":"boolean"}},"required":["githubRepoId","fullName","defaultBranch","installationId"],"additionalProperties":false}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"githubRepoId":{"type":"integer"},"fullName":{"type":"string"},"defaultBranch":{"type":"string"},"installationId":{"type":"integer","nullable":true},"prMiningLimit":{"type":"integer"}},"required":["id","githubRepoId","fullName","defaultBranch","installationId","prMiningLimit"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["repo_limit","extra_repo_confirmation","repo_off"]},"slots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false}},"required":["error","code"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}]}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/github/repos":{"get":{"summary":"List the GitHub repos the Tently App can access for the org","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"repos":{"type":"array","items":{"type":"object","properties":{"githubRepoId":{"type":"integer"},"fullName":{"type":"string"},"defaultBranch":{"type":"string"},"installationId":{"type":"integer"},"alreadyAdded":{"type":"boolean"},"claimedElsewhere":{"type":"boolean"}},"required":["githubRepoId","fullName","defaultBranch","installationId","alreadyAdded","claimedElsewhere"],"additionalProperties":false}},"installations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"login":{"type":"string"},"accountType":{"type":"string","enum":["User","Organization"]},"repositorySelection":{"type":"string","enum":["all","selected"]},"settingsUrl":{"type":"string"}},"required":["id","login","accountType","repositorySelection","settingsUrl"],"additionalProperties":false}}},"required":["repos","installations"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/github/app":{"get":{"summary":"GitHub App install info for self-serve onboarding","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"installUrl":{"type":"string","nullable":true},"installUrls":{"type":"object","properties":{"manual":{"type":"string"},"on_open":{"type":"string"},"on_open_and_commit":{"type":"string"}},"required":["manual","on_open","on_open_and_commit"],"additionalProperties":false,"nullable":true}},"required":["configured","installUrl","installUrls"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/github/setup":{"get":{"summary":"GitHub App post-install callback — sends the owner to onboarding","tags":["dashboard"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"installation_id","required":false},{"schema":{"type":"string"},"in":"query","name":"setup_action","required":false},{"schema":{"type":"string"},"in":"query","name":"state","required":false}],"responses":{"302":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}}}}},"/v1/onboarding/installations/{installationId}/sync":{"post":{"summary":"Bring an installation’s repos in (off) and suggest how to start","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","maxLength":500}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","exclusiveMinimum":true,"minimum":0},"in":"path","name":"installationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"integer"},"repos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fullName":{"type":"string"},"enabled":{"type":"boolean"},"isNew":{"type":"boolean"},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"indexStatus":{"type":"string","enum":["PENDING","INDEXING","READY","FAILED","DISCONNECTED"],"nullable":true}},"required":["id","fullName","enabled","isNew","reviewTriggerMode","indexStatus"],"additionalProperties":false}},"inaccessible":{"type":"integer"},"claimedElsewhere":{"type":"integer"},"slots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true},"newRepoEnabled":{"type":"boolean"},"suggestion":{"type":"object","properties":{"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]}},"required":["reviewTriggerMode"],"additionalProperties":false}},"required":["installationId","repos","inaccessible","slots","newRepoEnabled","suggestion"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["installation_not_accessible"]}},"required":["error","code"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}]}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/onboarding/start":{"post":{"summary":"Turn on the repos picked in onboarding, with the picked review mode","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"integer","exclusiveMinimum":true,"minimum":0},"repoIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"saveAsDefaults":{"type":"boolean","default":false},"newRepoEnabled":{"type":"boolean"}},"required":["installationId","repoIds","reviewTriggerMode"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"indexing":{"type":"boolean"},"extra":{"type":"boolean"},"skipped":{"type":"string","enum":["repo_limit","extra_repo_confirmation","not_connected","not_indexed"]}},"required":["id","enabled","indexing","extra"],"additionalProperties":false}},"slots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true}},"required":["results","slots"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/{id}/reindex":{"post":{"summary":"Re-run indexing for a repo","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000},"acceptExtraRepo":{"type":"boolean"},"enable":{"type":"boolean"},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["repo_limit","extra_repo_confirmation","repo_off"]},"slots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false}},"required":["error","code"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}]}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/enabled":{"patch":{"summary":"Turn repositories on or off within the plan’s repository limit","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"repoIds":{"anyOf":[{"type":"string","enum":["all"]},{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":1000}]},"enabled":{"type":"boolean"},"acceptExtraRepos":{"type":"integer","minimum":0,"maximum":1000}},"required":["repoIds","enabled"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"indexing":{"type":"boolean"},"extra":{"type":"boolean"},"skipped":{"type":"string","enum":["repo_limit","extra_repo_confirmation","not_connected","not_indexed"]}},"required":["id","enabled","indexing","extra"],"additionalProperties":false}},"slots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true}},"required":["results","slots"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/index":{"post":{"summary":"Index never-indexed repositories, with one review mode, within the limit","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"repoIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":1000},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000},"acceptExtraRepos":{"type":"integer","minimum":0,"maximum":1000}},"required":["repoIds","reviewTriggerMode"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"indexing":{"type":"boolean"},"extra":{"type":"boolean"},"skipped":{"type":"string","enum":["repo_limit","extra_repo_confirmation","not_connected","not_indexed"]}},"required":["id","enabled","indexing","extra"],"additionalProperties":false}},"slots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true}},"required":["results","slots"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/slots":{"get":{"summary":"The workspace’s repository slots","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/settings":{"patch":{"summary":"Set review settings on every repo (or the given repos) at once","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"repoIds":{"anyOf":[{"type":"string","enum":["all"]},{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":1000}]},"settings":{"type":"object","properties":{"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewDependencyPrs":{"type":"boolean"},"reviewBranchMode":{"type":"string","enum":["default_only","all","custom"]},"reviewBranchPatterns":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50},"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000}},"additionalProperties":false}},"required":["repoIds","settings"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","minimum":0}},"required":["updated"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/{id}/settings":{"patch":{"summary":"Update a repo’s PR review targeting (branches + trigger events)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["default_only","all","custom"]},"patterns":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50}},"required":["mode","patterns"]},{"type":"object","properties":{"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewDependencyPrs":{"type":"boolean"}}}]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reviewBranchMode":{"type":"string","enum":["default_only","all","custom"]},"reviewBranchPatterns":{"type":"array","items":{"type":"string"}},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewDependencyPrs":{"type":"boolean"}},"required":["id","reviewBranchMode","reviewBranchPatterns","reviewTriggerMode","reviewCheckMode","reviewDependencyPrs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/{id}/branches":{"get":{"summary":"List a repo’s branch names (for the review-branch picker)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"branches":{"type":"array","items":{"type":"string"}}},"required":["branches"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/{id}/commit/{sha}":{"get":{"summary":"Resolve a commit sha to its subject + GitHub URL","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"sha","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"commit":{"type":"object","properties":{"sha":{"type":"string"},"message":{"type":"string"},"htmlUrl":{"type":"string"}},"required":["sha","message","htmlUrl"],"additionalProperties":false,"nullable":true}},"required":["commit"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/{id}":{"delete":{"summary":"Disconnect a repo from the org (purges pending jobs + cascades its data)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions":{"get":{"summary":"List decisions for curation (org-wide, optionally repo/status/enforcement/text filtered)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]}},"in":"query","name":"status","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["BLOCKING","ADVISORY"]}},"in":"query","name":"enforcement","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":true,"minimum":0,"default":1},"supersedesId":{"type":"string","format":"uuid","nullable":true,"default":null},"supersededById":{"type":"string","format":"uuid","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","orgId","repoId","title","tier","status","scope","signals","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string"}},"required":["decisions"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Curate many decisions at once (approve, reject, archive, restore)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":200},"status":{"type":"string","enum":["approve","reject","archive","restore"]}},"required":["ids","status"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":"boolean"},"error":{"type":"string"}},"required":["id","ok"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a decision manually","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false,"default":{"includePaths":[],"excludePaths":[],"modules":[]}},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"repoId":{"type":"string","format":"uuid"}},"required":["title","tier","repoId"],"additionalProperties":false}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":true,"minimum":0,"default":1},"supersedesId":{"type":"string","format":"uuid","nullable":true,"default":null},"supersededById":{"type":"string","format":"uuid","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","orgId","repoId","title","tier","status","scope","signals","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"duplicateOf":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"similarity":{"type":"number"}},"required":["id","title","similarity"],"additionalProperties":false}},"required":["error","duplicateOf"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions/counts":{"get":{"summary":"Count decisions per status under the given repo/enforcement/text filters","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["BLOCKING","ADVISORY"]}},"in":"query","name":"enforcement","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","properties":{"ACTIVE":{"type":"integer","minimum":0},"PROPOSED":{"type":"integer","minimum":0},"SUPERSEDED":{"type":"integer","minimum":0},"REJECTED":{"type":"integer","minimum":0},"ARCHIVED":{"type":"integer","minimum":0}},"required":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"],"additionalProperties":false}},"required":["counts"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions/{id}":{"get":{"summary":"Get one decision","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":true,"minimum":0,"default":1},"supersedesId":{"type":"string","format":"uuid","nullable":true,"default":null},"supersededById":{"type":"string","format":"uuid","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","orgId","repoId","title","tier","status","scope","signals","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Curate a decision: change status and/or edit fields","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["approve","reject","archive","restore"]},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"]},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":true,"minimum":0,"default":1},"supersedesId":{"type":"string","format":"uuid","nullable":true,"default":null},"supersededById":{"type":"string","format":"uuid","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","orgId","repoId","title","tier","status","scope","signals","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Permanently delete a decision (owner-only; prefer archiving)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions/{id}/impact":{"get":{"summary":"Decision impact: how many findings cite it, and when last cited","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"findings":{"type":"integer","minimum":0},"lastCitedAt":{"type":"string","format":"date-time","nullable":true}},"required":["findings","lastCitedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions/batch":{"post":{"summary":"Create several decisions at once (e.g. confirmed doc-import rows)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"repoId":{"type":"string","format":"uuid"},"decisions":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false,"default":{"includePaths":[],"excludePaths":[],"modules":[]}},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false}},"required":["title","tier"],"additionalProperties":false},"minItems":1,"maxItems":50},"source":{"type":"string","enum":["manual","import"]}},"required":["repoId","decisions"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":true,"minimum":0,"default":1},"supersedesId":{"type":"string","format":"uuid","nullable":true,"default":null},"supersededById":{"type":"string","format":"uuid","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","orgId","repoId","title","tier","status","scope","signals","createdAt","updatedAt"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"title":{"type":"string"},"duplicateOf":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"similarity":{"type":"number"}},"required":["id","title","similarity"],"additionalProperties":false,"nullable":true}},"required":["index","title","duplicateOf"],"additionalProperties":false}}},"required":["decisions","skipped"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":true,"minimum":0,"default":1},"supersedesId":{"type":"string","format":"uuid","nullable":true,"default":null},"supersededById":{"type":"string","format":"uuid","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","orgId","repoId","title","tier","status","scope","signals","createdAt","updatedAt"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"title":{"type":"string"},"duplicateOf":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"similarity":{"type":"number"}},"required":["id","title","similarity"],"additionalProperties":false,"nullable":true}},"required":["index","title","duplicateOf"],"additionalProperties":false}}},"required":["decisions","skipped"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/decisions/import":{"post":{"summary":"Extract candidate decisions from an uploaded document (preview, not saved)","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"type":"object","properties":{"decision":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"rationale":{"type":"string","default":""},"tier":{"type":"string","enum":["EXPLICIT","MANUAL","MINED","PROPOSED"]},"status":{"type":"string","enum":["ACTIVE","PROPOSED","SUPERSEDED","REJECTED","ARCHIVED"]},"enforcement":{"type":"string","enum":["BLOCKING","ADVISORY"],"default":"ADVISORY"},"scope":{"type":"object","properties":{"includePaths":{"type":"array","items":{"type":"string"},"default":[]},"excludePaths":{"type":"array","items":{"type":"string"},"default":[]},"modules":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false,"default":{"includePaths":[],"excludePaths":[],"modules":[]}},"exemplars":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"symbol":{"type":"string"},"note":{"type":"string"}},"required":["path"],"additionalProperties":false},"default":[]},"provenance":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ADR","PR","COMMIT","ISSUE","RULES_FILE","DOC","SESSION","INFERENCE","OTHER"]},"ref":{"type":"string"},"label":{"type":"string"},"statistic":{"type":"object","properties":{"conforming":{"type":"integer","minimum":0},"total":{"type":"integer","exclusiveMinimum":true,"minimum":0},"note":{"type":"string"}},"required":["conforming","total"],"additionalProperties":false}},"required":["kind"],"additionalProperties":false},"default":[]},"signals":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5},"reinforcement":{"type":"integer","minimum":0,"default":0},"halfLifeDays":{"type":"number","exclusiveMinimum":true,"minimum":0,"default":180},"acceptRate":{"type":"number","minimum":0,"maximum":1,"nullable":true,"default":null}},"additionalProperties":false}},"required":["title","tier"],"additionalProperties":false},"sourceQuote":{"type":"string"},"duplicateOf":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"similarity":{"type":"number"}},"required":["id","title","similarity"],"additionalProperties":false,"nullable":true}},"required":["decision","sourceQuote","duplicateOf"],"additionalProperties":false}}},"required":["decisions"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"415":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/findings":{"get":{"summary":"List findings (org-wide, optionally repo/state/category/text filtered)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]}},"in":"query","name":"state","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["REGRESSION","DRIFT"]}},"in":"query","name":"category","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]}},"in":"query","name":"severity","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"decision","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"findings":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["REGRESSION","DRIFT"]},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"confidence":{"type":"number","minimum":0,"maximum":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1},"location":{"type":"object","properties":{"path":{"type":"string","minLength":1},"line":{"type":"integer","exclusiveMinimum":true,"minimum":0},"endLine":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["path"],"additionalProperties":false},"decisionId":{"type":"string","format":"uuid"},"impactedSymbolUids":{"type":"array","items":{"type":"string"},"default":[]},"evidence":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"startLine":{"type":"integer","exclusiveMinimum":true,"minimum":0},"quote":{"type":"string","minLength":1}},"required":["path","startLine","quote"],"additionalProperties":false},"default":[]},"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"commitSha":{"type":"string"},"githubCommentId":{"type":"string","nullable":true},"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]},"feedback":{"type":"string","enum":["THUMBS_UP","THUMBS_DOWN"],"nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"prTitle":{"type":"string","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["category","severity","confidence","title","body","location","id","orgId","repoId","prNumber","commitSha","githubCommentId","state","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string"}},"required":["findings"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Move many findings to one lifecycle state","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":200},"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]}},"required":["ids","state"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","minimum":0}},"required":["updated"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/findings/counts":{"get":{"summary":"Count findings per state under the given repo/category/text filters","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["REGRESSION","DRIFT"]}},"in":"query","name":"category","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]}},"in":"query","name":"severity","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"decision","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","properties":{"POSTED":{"type":"integer","minimum":0},"RESOLVED":{"type":"integer","minimum":0},"DISMISSED":{"type":"integer","minimum":0}},"required":["POSTED","RESOLVED","DISMISSED"],"additionalProperties":false}},"required":["counts"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/findings/outcomes":{"get":{"summary":"Findings raised, resolved and voted 👍/👎 (optionally per repo, last N days)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"integer","minimum":1,"maximum":365},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"resolved":{"type":"integer","minimum":0},"helpful":{"type":"integer","minimum":0},"notHelpful":{"type":"integer","minimum":0}},"required":["total","resolved","helpful","notHelpful"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/findings/{id}":{"get":{"summary":"Get one finding","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["REGRESSION","DRIFT"]},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"confidence":{"type":"number","minimum":0,"maximum":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1},"location":{"type":"object","properties":{"path":{"type":"string","minLength":1},"line":{"type":"integer","exclusiveMinimum":true,"minimum":0},"endLine":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["path"],"additionalProperties":false},"decisionId":{"type":"string","format":"uuid"},"impactedSymbolUids":{"type":"array","items":{"type":"string"},"default":[]},"evidence":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"startLine":{"type":"integer","exclusiveMinimum":true,"minimum":0},"quote":{"type":"string","minLength":1}},"required":["path","startLine","quote"],"additionalProperties":false},"default":[]},"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"commitSha":{"type":"string"},"githubCommentId":{"type":"string","nullable":true},"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]},"feedback":{"type":"string","enum":["THUMBS_UP","THUMBS_DOWN"],"nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"prTitle":{"type":"string","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["category","severity","confidence","title","body","location","id","orgId","repoId","prNumber","commitSha","githubCommentId","state","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Move a finding through its lifecycle (set state)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]}},"required":["state"],"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["REGRESSION","DRIFT"]},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"confidence":{"type":"number","minimum":0,"maximum":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1},"location":{"type":"object","properties":{"path":{"type":"string","minLength":1},"line":{"type":"integer","exclusiveMinimum":true,"minimum":0},"endLine":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["path"],"additionalProperties":false},"decisionId":{"type":"string","format":"uuid"},"impactedSymbolUids":{"type":"array","items":{"type":"string"},"default":[]},"evidence":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"startLine":{"type":"integer","exclusiveMinimum":true,"minimum":0},"quote":{"type":"string","minLength":1}},"required":["path","startLine","quote"],"additionalProperties":false},"default":[]},"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"commitSha":{"type":"string"},"githubCommentId":{"type":"string","nullable":true},"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]},"feedback":{"type":"string","enum":["THUMBS_UP","THUMBS_DOWN"],"nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"prTitle":{"type":"string","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["category","severity","confidence","title","body","location","id","orgId","repoId","prNumber","commitSha","githubCommentId","state","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/findings/{id}/feedback":{"post":{"summary":"Record reviewer feedback on a finding","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signal":{"anyOf":[{"type":"string","enum":["THUMBS_UP","THUMBS_DOWN","DISMISSED","RESOLVED","CLEARED"]},{"type":"string","enum":["CLEAR"]},{"enum":["null"],"nullable":true}]}},"required":["signal"],"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["REGRESSION","DRIFT"]},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"confidence":{"type":"number","minimum":0,"maximum":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1},"location":{"type":"object","properties":{"path":{"type":"string","minLength":1},"line":{"type":"integer","exclusiveMinimum":true,"minimum":0},"endLine":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["path"],"additionalProperties":false},"decisionId":{"type":"string","format":"uuid"},"impactedSymbolUids":{"type":"array","items":{"type":"string"},"default":[]},"evidence":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"startLine":{"type":"integer","exclusiveMinimum":true,"minimum":0},"quote":{"type":"string","minLength":1}},"required":["path","startLine","quote"],"additionalProperties":false},"default":[]},"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"commitSha":{"type":"string"},"githubCommentId":{"type":"string","nullable":true},"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]},"feedback":{"type":"string","enum":["THUMBS_UP","THUMBS_DOWN"],"nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"prTitle":{"type":"string","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["category","severity","confidence","title","body","location","id","orgId","repoId","prNumber","commitSha","githubCommentId","state","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/prs":{"get":{"summary":"List reviewed pull requests (last review + findings, derived status), org-wide or repo-scoped","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"string","enum":["open","clear","all"]},"in":"query","name":"attention","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["REGRESSION","DRIFT"]}},"in":"query","name":"category","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"prs":{"type":"array","items":{"type":"object","properties":{"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"prTitle":{"type":"string","nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"headSha":{"type":"string"},"counts":{"type":"object","properties":{"POSTED":{"type":"integer","minimum":0},"RESOLVED":{"type":"integer","minimum":0},"DISMISSED":{"type":"integer","minimum":0}},"required":["POSTED","RESOLVED","DISMISSED"],"additionalProperties":false},"total":{"type":"integer","minimum":0},"maxOpenSeverity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"],"nullable":true,"default":null},"needsAttention":{"type":"boolean"},"latestActivityAt":{"type":"string","format":"date-time"},"lastReview":{"type":"object","properties":{"status":{"type":"string","enum":["completed","failed","interrupted"]},"headSha":{"type":"string"},"finishedAt":{"type":"string","format":"date-time"},"findingsCount":{"type":"integer","minimum":0,"nullable":true}},"required":["status","headSha","finishedAt","findingsCount"],"additionalProperties":false,"nullable":true,"default":null}},"required":["repoId","prNumber","headSha","counts","total","needsAttention","latestActivityAt"],"additionalProperties":false}},"nextCursor":{"type":"string"}},"required":["prs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/prs/counts":{"get":{"summary":"Count pull requests by derived status under the given repo/category/text filters","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"array","items":{"type":"string","enum":["REGRESSION","DRIFT"]}},"in":"query","name":"category","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","properties":{"open":{"type":"integer","minimum":0},"clear":{"type":"integer","minimum":0},"all":{"type":"integer","minimum":0}},"required":["open","clear","all"],"additionalProperties":false}},"required":["counts"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/prs/{repoId}/{prNumber}":{"get":{"summary":"Get one reviewed PR: its derived summary, last review and every finding on it","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"repoId","required":true},{"schema":{"type":"integer","minimum":0},"in":"path","name":"prNumber","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"prTitle":{"type":"string","nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"headSha":{"type":"string"},"counts":{"type":"object","properties":{"POSTED":{"type":"integer","minimum":0},"RESOLVED":{"type":"integer","minimum":0},"DISMISSED":{"type":"integer","minimum":0}},"required":["POSTED","RESOLVED","DISMISSED"],"additionalProperties":false},"total":{"type":"integer","minimum":0},"maxOpenSeverity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"],"nullable":true,"default":null},"needsAttention":{"type":"boolean"},"latestActivityAt":{"type":"string","format":"date-time"},"lastReview":{"type":"object","properties":{"status":{"type":"string","enum":["completed","failed","interrupted"]},"headSha":{"type":"string"},"finishedAt":{"type":"string","format":"date-time"},"findingsCount":{"type":"integer","minimum":0,"nullable":true}},"required":["status","headSha","finishedAt","findingsCount"],"additionalProperties":false,"nullable":true,"default":null}},"required":["repoId","prNumber","headSha","counts","total","needsAttention","latestActivityAt"],"additionalProperties":false},"findings":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["REGRESSION","DRIFT"]},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"confidence":{"type":"number","minimum":0,"maximum":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1},"location":{"type":"object","properties":{"path":{"type":"string","minLength":1},"line":{"type":"integer","exclusiveMinimum":true,"minimum":0},"endLine":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["path"],"additionalProperties":false},"decisionId":{"type":"string","format":"uuid"},"impactedSymbolUids":{"type":"array","items":{"type":"string"},"default":[]},"evidence":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"startLine":{"type":"integer","exclusiveMinimum":true,"minimum":0},"quote":{"type":"string","minLength":1}},"required":["path","startLine","quote"],"additionalProperties":false},"default":[]},"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"repoId":{"type":"string","format":"uuid"},"prNumber":{"type":"integer"},"commitSha":{"type":"string"},"githubCommentId":{"type":"string","nullable":true},"state":{"type":"string","enum":["POSTED","RESOLVED","DISMISSED"]},"feedback":{"type":"string","enum":["THUMBS_UP","THUMBS_DOWN"],"nullable":true,"default":null},"author":{"type":"string","nullable":true,"default":null},"prTitle":{"type":"string","nullable":true,"default":null},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["category","severity","confidence","title","body","location","id","orgId","repoId","prNumber","commitSha","githubCommentId","state","createdAt","updatedAt"],"additionalProperties":false}}},"required":["summary","findings"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/prs/{repoId}/{prNumber}/diff":{"get":{"summary":"Fetch a PR’s changed files + hunks live from GitHub (not persisted)","tags":["dashboard"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"repoId","required":true},{"schema":{"type":"integer","minimum":0},"in":"path","name":"prNumber","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"status":{"type":"string"},"additions":{"type":"integer","minimum":0},"deletions":{"type":"integer","minimum":0},"patch":{"type":"string","nullable":true},"previousPath":{"type":"string","nullable":true}},"required":["path","status","additions","deletions","patch","previousPath"],"additionalProperties":false}},"truncated":{"type":"boolean"},"maxFiles":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["files","truncated","maxFiles"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces":{"get":{"summary":"List the workspaces the caller belongs to","tags":["workspaces"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"githubLogin":{"type":"string","nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]},"createdAt":{"type":"string","format":"date-time"},"role":{"type":"string","enum":["owner","member","viewer"]}},"required":["id","name","githubLogin","plan","createdAt","role"],"additionalProperties":false}},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":true,"minimum":0,"nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]}},"required":["used","limit","plan"],"additionalProperties":false}},"required":["workspaces","allowance"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a workspace","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"],"additionalProperties":false}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"githubLogin":{"type":"string","nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]},"createdAt":{"type":"string","format":"date-time"},"role":{"type":"string","enum":["owner","member","viewer"]}},"required":["id","name","githubLogin","plan","createdAt","role"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["workspace_limit"]},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":true,"minimum":0,"nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]}},"required":["used","limit","plan"],"additionalProperties":false}},"required":["error","code","allowance"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}]}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/switch":{"post":{"summary":"Switch the active workspace","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"}},"required":["orgId"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"githubLogin":{"type":"string","nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]},"createdAt":{"type":"string","format":"date-time"},"role":{"type":"string","enum":["owner","member","viewer"]}},"required":["id","name","githubLogin","plan","createdAt","role"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active":{"patch":{"summary":"Update the active workspace (name only; plan is billing-controlled)","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"githubLogin":{"type":"string","nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]},"createdAt":{"type":"string","format":"date-time"},"role":{"type":"string","enum":["owner","member","viewer"]}},"required":["id","name","githubLogin","plan","createdAt","role"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete the active workspace","tags":["workspaces"],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["personal_workspace","subscription_active"]}},"required":["error","code"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active/members":{"get":{"summary":"List members of the active workspace","tags":["workspaces"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"githubUserId":{"type":"number"},"githubLogin":{"type":"string"},"email":{"type":"string","nullable":true},"role":{"type":"string","enum":["owner","member","viewer"]},"joinedAt":{"type":"string","format":"date-time"}},"required":["githubUserId","githubLogin","email","role","joinedAt"],"additionalProperties":false}}},"required":["members"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active/members/{githubUserId}":{"patch":{"summary":"Change a member's role (owner only)","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","member","viewer"]}},"required":["role"],"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"githubUserId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"githubUserId":{"type":"number"},"githubLogin":{"type":"string"},"email":{"type":"string","nullable":true},"role":{"type":"string","enum":["owner","member","viewer"]},"joinedAt":{"type":"string","format":"date-time"}},"required":["githubUserId","githubLogin","email","role","joinedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove a member (owner only, or self-leave)","tags":["workspaces"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"githubUserId","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active/invites":{"get":{"summary":"List pending invites (owner only)","tags":["workspaces"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"invites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["owner","member","viewer"]},"kind":{"type":"string","enum":["email","link"]},"invitedEmail":{"type":"string","nullable":true},"token":{"type":"string"},"status":{"type":"string"},"maxUses":{"type":"number","nullable":true},"usedCount":{"type":"number"},"expiresAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","role","kind","invitedEmail","token","status","maxUses","usedCount","expiresAt","createdAt"],"additionalProperties":false}}},"required":["invites"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create an invite: email (sent to an address) or shareable link (member/viewer only)","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","member","viewer"]},"kind":{"type":"string","enum":["email","link"]},"email":{"type":"string","format":"email"},"maxUses":{"type":"integer","exclusiveMinimum":true,"minimum":0},"expiresInDays":{"type":"integer","exclusiveMinimum":true,"minimum":0,"maximum":90}},"required":["role","kind"],"additionalProperties":false}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["owner","member","viewer"]},"kind":{"type":"string","enum":["email","link"]},"invitedEmail":{"type":"string","nullable":true},"token":{"type":"string"},"status":{"type":"string"},"maxUses":{"type":"number","nullable":true},"usedCount":{"type":"number"},"expiresAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","role","kind","invitedEmail","token","status","maxUses","usedCount","expiresAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active/invites/{id}":{"delete":{"summary":"Revoke a pending invite (owner only)","tags":["workspaces"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invites/received":{"get":{"summary":"Pending invites addressed to the caller's email","tags":["workspaces"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"invites":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"role":{"type":"string","enum":["owner","member","viewer"]},"orgId":{"type":"string","format":"uuid"},"orgName":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["token","role","orgId","orgName","expiresAt","createdAt"],"additionalProperties":false}}},"required":["invites"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invites/{token}":{"get":{"summary":"Preview an invite by token","tags":["workspaces"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"orgName":{"type":"string"},"role":{"type":"string","enum":["owner","member","viewer"]},"kind":{"type":"string","enum":["email","link"]},"invitedBy":{"type":"string","nullable":true},"alreadyMember":{"type":"boolean"},"emailMismatch":{"type":"boolean"}},"required":["orgId","orgName","role","kind"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invites/{token}/decline":{"post":{"summary":"Decline an invite addressed to the authenticated user","tags":["workspaces"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invites/{token}/accept":{"post":{"summary":"Accept an invite as the authenticated user","tags":["workspaces"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"githubLogin":{"type":"string","nullable":true},"plan":{"type":"string","enum":["solo","crew","fleet"]},"createdAt":{"type":"string","format":"date-time"},"role":{"type":"string","enum":["owner","member","viewer"]}},"required":["id","name","githubLogin","plan","createdAt","role"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/keys":{"post":{"summary":"Create an org-scoped API key (raw key returned once)","tags":["keys"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"key":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","key","createdAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"summary":"List the API keys the caller can manage (no secrets)","tags":["keys"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"revokedAt":{"type":"string","format":"date-time","nullable":true},"lastFour":{"type":"string","nullable":true},"lastUsedAt":{"type":"string","format":"date-time","nullable":true},"createdByLogin":{"type":"string","nullable":true}},"required":["id","name","createdAt","revokedAt","lastFour","lastUsedAt","createdByLogin"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/keys/{id}":{"delete":{"summary":"Revoke an org API key","tags":["keys"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active/llm-key":{"get":{"summary":"The workspace's model API key status (no secret)","tags":["workspaces"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"provider":{"type":"string","enum":["openrouter"],"nullable":true},"lastFour":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["configured","provider","lastFour","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Set or replace the workspace OpenRouter API key (validated, encrypted)","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","minLength":16,"maxLength":512,"pattern":"^sk-or-[A-Za-z0-9_-]+$"}},"required":["apiKey"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"provider":{"type":"string","enum":["openrouter"],"nullable":true},"lastFour":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["configured","provider","lastFour","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove the workspace API key (fall back to the platform key)","tags":["workspaces"],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/workspaces/active/repo-defaults":{"get":{"summary":"The workspace's defaults for new repositories","tags":["workspaces"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"defaults":{"type":"object","properties":{"newRepoEnabled":{"type":"boolean"},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewBranchMode":{"type":"string","enum":["default_only","all","custom"]},"reviewBranchPatterns":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50},"reviewDependencyPrs":{"type":"boolean"},"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000}},"required":["newRepoEnabled","reviewTriggerMode","reviewCheckMode","reviewBranchMode","reviewBranchPatterns","reviewDependencyPrs","prMiningLimit"],"additionalProperties":false},"saved":{"type":"boolean"}},"required":["defaults","saved"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Save the workspace's defaults for new repositories","tags":["workspaces"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"newRepoEnabled":{"type":"boolean"},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewBranchMode":{"type":"string","enum":["default_only","all","custom"]},"reviewBranchPatterns":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50},"reviewDependencyPrs":{"type":"boolean"},"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000}},"required":["newRepoEnabled","reviewTriggerMode","reviewCheckMode","reviewBranchMode","reviewBranchPatterns","reviewDependencyPrs","prMiningLimit"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"defaults":{"type":"object","properties":{"newRepoEnabled":{"type":"boolean"},"reviewTriggerMode":{"type":"string","enum":["on_open","on_open_and_commit","manual"]},"reviewCheckMode":{"type":"string","enum":["advisory","blocking"]},"reviewBranchMode":{"type":"string","enum":["default_only","all","custom"]},"reviewBranchPatterns":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50},"reviewDependencyPrs":{"type":"boolean"},"prMiningLimit":{"type":"integer","minimum":1,"maximum":1000}},"required":["newRepoEnabled","reviewTriggerMode","reviewCheckMode","reviewBranchMode","reviewBranchPatterns","reviewDependencyPrs","prMiningLimit"],"additionalProperties":false},"saved":{"type":"boolean"}},"required":["defaults","saved"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/audit":{"get":{"summary":"The workspace's activity log, newest first","tags":["workspaces"],"parameters":[{"schema":{"type":"string","enum":["decision","member","invite","api_key","repo","workspace","billing"]},"in":"query","name":"subjectType","required":false},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"query","name":"subjectId","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":500},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"actor":{"type":"object","properties":{"githubUserId":{"type":"integer","nullable":true},"login":{"type":"string","minLength":1}},"required":["githubUserId","login"],"additionalProperties":false,"nullable":true},"action":{"type":"string","enum":["decision.created","decision.imported","decision.edited","decision.approved","decision.rejected","decision.archived","decision.restored","decision.deleted","member.role_changed","member.removed","member.left","member.joined","invite.created","invite.revoked","invite.declined","api_key.created","api_key.revoked","repo.added","repo.indexed","repo.enabled","repo.disabled","repo.deleted","repo.settings_changed","workspace.renamed","workspace.defaults_changed","workspace.llm_key_changed","billing.plan_changed","billing.extra_prs_changed","billing.extra_repos_changed"]},"subjectType":{"type":"string","enum":["decision","member","invite","api_key","repo","workspace","billing"]},"subjectId":{"type":"string","minLength":1,"maxLength":200,"nullable":true},"subjectLabel":{"type":"string","maxLength":300,"nullable":true},"data":{"type":"object","additionalProperties":{},"default":{}},"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}},"required":["actor","action","subjectType","subjectId","subjectLabel","id","createdAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["events","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/account/notifications":{"get":{"summary":"Your notification settings in the active workspace","tags":["auth"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"usageEmails":{"type":"boolean"}},"required":["usageEmails"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Change your notification settings in the active workspace","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"usageEmails":{"type":"boolean"}},"required":["usageEmails"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"usageEmails":{"type":"boolean"}},"required":["usageEmails"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/usage":{"get":{"summary":"Review usage for the active workspace over a 7/30/90-day window","tags":["dashboard"],"parameters":[{"schema":{"type":"integer","default":30},"in":"query","name":"days","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"windowDays":{"type":"integer"},"repoId":{"type":"string","format":"uuid","nullable":true},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"nullable":true},"base":{"type":"integer","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","warning","reached","unlimited"]},"periodEnd":{"type":"string","format":"date-time"},"periodStart":{"type":"string","format":"date-time"}},"required":["used","limit","base","state","periodEnd"],"additionalProperties":false},"costVisible":{"type":"boolean"},"current":{"type":"object","properties":{"prsReviewed":{"type":"integer","minimum":0},"reviews":{"type":"integer","minimum":0},"failedReviews":{"type":"integer","minimum":0},"skippedReviews":{"type":"integer","minimum":0},"issues":{"type":"integer","minimum":0},"highSeverityIssues":{"type":"integer","minimum":0},"medianTimeToReviewMs":{"type":"number","minimum":0,"nullable":true},"p90TimeToReviewMs":{"type":"number","minimum":0,"nullable":true},"medianCostPerPrUsd":{"type":"number","minimum":0,"nullable":true},"p90CostPerPrUsd":{"type":"number","minimum":0,"nullable":true},"totalCostUsd":{"type":"number","minimum":0,"nullable":true}},"required":["prsReviewed","reviews","failedReviews","skippedReviews","issues","highSeverityIssues","medianTimeToReviewMs","p90TimeToReviewMs","medianCostPerPrUsd","p90CostPerPrUsd","totalCostUsd"],"additionalProperties":false},"previous":{"type":"object","properties":{"prsReviewed":{"type":"integer","minimum":0},"reviews":{"type":"integer","minimum":0},"failedReviews":{"type":"integer","minimum":0},"skippedReviews":{"type":"integer","minimum":0},"issues":{"type":"integer","minimum":0},"highSeverityIssues":{"type":"integer","minimum":0},"medianTimeToReviewMs":{"type":"number","minimum":0,"nullable":true},"p90TimeToReviewMs":{"type":"number","minimum":0,"nullable":true},"medianCostPerPrUsd":{"type":"number","minimum":0,"nullable":true},"p90CostPerPrUsd":{"type":"number","minimum":0,"nullable":true},"totalCostUsd":{"type":"number","minimum":0,"nullable":true}},"required":["prsReviewed","reviews","failedReviews","skippedReviews","issues","highSeverityIssues","medianTimeToReviewMs","p90TimeToReviewMs","medianCostPerPrUsd","p90CostPerPrUsd","totalCostUsd"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"reviews":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"issues":{"type":"integer","minimum":0},"highSeverityIssues":{"type":"integer","minimum":0},"costUsd":{"type":"number","minimum":0,"nullable":true}},"required":["date","reviews","failed","skipped","issues","highSeverityIssues","costUsd"],"additionalProperties":false}},"byRepo":{"type":"array","items":{"type":"object","properties":{"repoId":{"type":"string","format":"uuid"},"repoFullName":{"type":"string"},"prsReviewed":{"type":"integer","minimum":0},"reviews":{"type":"integer","minimum":0},"issues":{"type":"integer","minimum":0},"medianTimeToReviewMs":{"type":"number","minimum":0,"nullable":true},"costUsd":{"type":"number","minimum":0,"nullable":true}},"required":["repoId","repoFullName","prsReviewed","reviews","issues","medianTimeToReviewMs","costUsd"],"additionalProperties":false}}},"required":["windowDays","repoId","from","to","allowance","costVisible","current","previous","daily","byRepo"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/usage/allowance":{"get":{"summary":"The workspace's standing against its review limit (sidebar meter)","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"nullable":true},"base":{"type":"integer","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","warning","reached","unlimited"]},"periodEnd":{"type":"string","format":"date-time"},"periodStart":{"type":"string","format":"date-time"}},"required":["used","limit","base","state","periodEnd"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/usage/prs":{"get":{"summary":"PRs reviewed in the window, most recently reviewed first (keyset-paginated)","tags":["dashboard"],"parameters":[{"schema":{"type":"integer","default":30},"in":"query","name":"days","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"string","maxLength":512},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"repoId":{"type":"string","format":"uuid"},"repoFullName":{"type":"string"},"prNumber":{"type":"integer","exclusiveMinimum":true,"minimum":0},"prTitle":{"type":"string","nullable":true},"prAuthor":{"type":"string","nullable":true},"reviews":{"type":"integer","minimum":0},"failedReviews":{"type":"integer","minimum":0},"issues":{"type":"integer","minimum":0},"lastReviewedAt":{"type":"string","format":"date-time"},"costUsd":{"type":"number","minimum":0,"nullable":true}},"required":["repoId","repoFullName","prNumber","prTitle","prAuthor","reviews","failedReviews","issues","lastReviewedAt","costUsd"],"additionalProperties":false}},"nextCursor":{"type":"string"}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/referrals":{"get":{"summary":"The workspace's referral code and the reviews its sign-ups earned","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"referred":{"type":"integer","minimum":0},"remaining":{"type":"integer","minimum":0},"bonusEarned":{"type":"integer","minimum":0},"bonusPerReferral":{"type":"integer","exclusiveMinimum":true,"minimum":0},"cap":{"type":"integer","exclusiveMinimum":true,"minimum":0}},"required":["code","referred","remaining","bonusEarned","bonusPerReferral","cap"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing":{"get":{"summary":"The active workspace's plan, PR allowance and billing state","tags":["dashboard"],"parameters":[{"schema":{"type":"string","enum":["1","true"]},"in":"query","name":"live","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["solo","crew","fleet"]},"selfServe":{"type":"boolean"},"subscribed":{"type":"boolean"},"hasCustomer":{"type":"boolean"},"trialEndsAt":{"type":"string","format":"date-time","nullable":true},"interval":{"type":"string","enum":["month","year"]},"extraPrCapUsd":{"type":"number","minimum":0},"extraRepoCap":{"type":"integer","minimum":0},"canBuyExtraRepos":{"type":"boolean"},"repoSlots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"nullable":true},"base":{"type":"integer","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","warning","reached","unlimited"]},"periodEnd":{"type":"string","format":"date-time"},"periodStart":{"type":"string","format":"date-time"}},"required":["used","limit","base","state","periodEnd"],"additionalProperties":false},"promo":{"type":"object","properties":{"code":{"type":"string"},"percentOff":{"type":"number"},"months":{"type":"integer"},"redeemedAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true}},"required":["code","percentOff","months","redeemedAt","endsAt"],"additionalProperties":false,"nullable":true},"status":{"type":"string","nullable":true},"cancelAtPeriodEnd":{"type":"boolean","nullable":true},"cancelAt":{"type":"string","format":"date-time","nullable":true},"currentPeriodEnd":{"type":"string","format":"date-time","nullable":true},"paymentFailed":{"type":"boolean","nullable":true},"hasCard":{"type":"boolean","nullable":true},"pendingUpdate":{"type":"boolean","nullable":true}},"required":["plan","selfServe","subscribed","hasCustomer","trialEndsAt","interval","extraPrCapUsd","extraRepoCap","canBuyExtraRepos","repoSlots","allowance","promo"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/subscribe":{"post":{"summary":"Subscribe to a paid plan (Checkout URL) or switch plans in place (url: null)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["crew","fleet"]},"interval":{"type":"string","enum":["month","year"],"default":"month"}},"required":["plan"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","nullable":true},"pending":{"type":"boolean"}},"required":["url"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/preview":{"post":{"summary":"What switching the live subscription to another plan charges now and changes","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["crew","fleet"]},"interval":{"type":"string","enum":["month","year"],"default":"month"}},"required":["plan"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"object","properties":{"plan":{"type":"string","enum":["solo","crew","fleet"]},"includedPrs":{"type":"integer","minimum":0},"includedRepos":{"type":"integer","minimum":0},"maxWorkspaces":{"type":"integer","minimum":0}},"required":["plan","includedPrs","includedRepos","maxWorkspaces"],"additionalProperties":false},"to":{"type":"object","properties":{"plan":{"type":"string","enum":["solo","crew","fleet"]},"includedPrs":{"type":"integer","minimum":0},"includedRepos":{"type":"integer","minimum":0},"maxWorkspaces":{"type":"integer","minimum":0}},"required":["plan","includedPrs","includedRepos","maxWorkspaces"],"additionalProperties":false},"amountDue":{"type":"integer","nullable":true},"currency":{"type":"string","nullable":true},"endsTrial":{"type":"boolean"},"reposToPause":{"type":"integer","minimum":0}},"required":["from","to","amountDue","currency","endsTrial","reposToPause"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/portal":{"post":{"summary":"Open the Stripe billing portal (card, invoices, cancel)","tags":["dashboard"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","nullable":true},"pending":{"type":"boolean"}},"required":["url"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/extra-prs":{"put":{"summary":"Set the monthly spend cap on extra PRs (0 turns them off)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"capUsd":{"type":"integer","minimum":0,"maximum":10000}},"required":["capUsd"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["solo","crew","fleet"]},"selfServe":{"type":"boolean"},"subscribed":{"type":"boolean"},"hasCustomer":{"type":"boolean"},"trialEndsAt":{"type":"string","format":"date-time","nullable":true},"interval":{"type":"string","enum":["month","year"]},"extraPrCapUsd":{"type":"number","minimum":0},"extraRepoCap":{"type":"integer","minimum":0},"canBuyExtraRepos":{"type":"boolean"},"repoSlots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"nullable":true},"base":{"type":"integer","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","warning","reached","unlimited"]},"periodEnd":{"type":"string","format":"date-time"},"periodStart":{"type":"string","format":"date-time"}},"required":["used","limit","base","state","periodEnd"],"additionalProperties":false},"promo":{"type":"object","properties":{"code":{"type":"string"},"percentOff":{"type":"number"},"months":{"type":"integer"},"redeemedAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true}},"required":["code","percentOff","months","redeemedAt","endsAt"],"additionalProperties":false,"nullable":true},"status":{"type":"string","nullable":true},"cancelAtPeriodEnd":{"type":"boolean","nullable":true},"cancelAt":{"type":"string","format":"date-time","nullable":true},"currentPeriodEnd":{"type":"string","format":"date-time","nullable":true},"paymentFailed":{"type":"boolean","nullable":true},"hasCard":{"type":"boolean","nullable":true},"pendingUpdate":{"type":"boolean","nullable":true}},"required":["plan","selfServe","subscribed","hasCustomer","trialEndsAt","interval","extraPrCapUsd","extraRepoCap","canBuyExtraRepos","repoSlots","allowance","promo"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/extra-repos":{"put":{"summary":"Set how many extra repositories (one-time fee each) may be indexed (0 = off)","tags":["dashboard"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cap":{"type":"integer","minimum":0,"maximum":1000}},"required":["cap"],"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["solo","crew","fleet"]},"selfServe":{"type":"boolean"},"subscribed":{"type":"boolean"},"hasCustomer":{"type":"boolean"},"trialEndsAt":{"type":"string","format":"date-time","nullable":true},"interval":{"type":"string","enum":["month","year"]},"extraPrCapUsd":{"type":"number","minimum":0},"extraRepoCap":{"type":"integer","minimum":0},"canBuyExtraRepos":{"type":"boolean"},"repoSlots":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"base":{"type":"integer","minimum":0,"nullable":true},"limit":{"type":"integer","minimum":0,"nullable":true},"extraRepoPriceUsd":{"type":"number","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","reached","over"]}},"required":["used","base","limit","extraRepoPriceUsd","state"],"additionalProperties":false,"nullable":true},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"nullable":true},"base":{"type":"integer","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","warning","reached","unlimited"]},"periodEnd":{"type":"string","format":"date-time"},"periodStart":{"type":"string","format":"date-time"}},"required":["used","limit","base","state","periodEnd"],"additionalProperties":false},"promo":{"type":"object","properties":{"code":{"type":"string"},"percentOff":{"type":"number"},"months":{"type":"integer"},"redeemedAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true}},"required":["code","percentOff","months","redeemedAt","endsAt"],"additionalProperties":false,"nullable":true},"status":{"type":"string","nullable":true},"cancelAtPeriodEnd":{"type":"boolean","nullable":true},"cancelAt":{"type":"string","format":"date-time","nullable":true},"currentPeriodEnd":{"type":"string","format":"date-time","nullable":true},"paymentFailed":{"type":"boolean","nullable":true},"hasCard":{"type":"boolean","nullable":true},"pendingUpdate":{"type":"boolean","nullable":true}},"required":["plan","selfServe","subscribed","hasCustomer","trialEndsAt","interval","extraPrCapUsd","extraRepoCap","canBuyExtraRepos","repoSlots","allowance","promo"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/webhooks/stripe":{"post":{"summary":"Stripe webhook receiver (subscription changes → workspace plan)","tags":["webhooks"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","enum":[true]}},"required":["received"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/overview":{"get":{"summary":"Platform-wide totals and the daily series over a 7/30/90-day window","tags":["admin"],"parameters":[{"schema":{"type":"integer","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"windowDays":{"type":"integer"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"totals":{"type":"object","properties":{"workspaces":{"type":"integer","minimum":0},"users":{"type":"integer","minimum":0},"repos":{"type":"integer","minimum":0},"decisions":{"type":"integer","minimum":0},"activeDecisions":{"type":"integer","minimum":0},"findings":{"type":"integer","minimum":0},"reviews":{"type":"integer","minimum":0},"costUsd":{"type":"number","minimum":0},"byokCostUsd":{"type":"number","minimum":0},"byokWorkspaces":{"type":"integer","minimum":0},"workspacesAtLimit":{"type":"integer","minimum":0},"newWorkspaces":{"type":"integer","minimum":0},"newUsers":{"type":"integer","minimum":0},"activeWorkspaces":{"type":"integer","minimum":0},"windowReviews":{"type":"integer","minimum":0},"windowFailedReviews":{"type":"integer","minimum":0},"windowSkippedReviews":{"type":"integer","minimum":0},"windowPrsReviewed":{"type":"integer","minimum":0},"windowFindings":{"type":"integer","minimum":0},"windowHighSeverityFindings":{"type":"integer","minimum":0},"windowCostUsd":{"type":"number","minimum":0},"windowByokCostUsd":{"type":"number","minimum":0},"windowFailedCostUsd":{"type":"number","minimum":0},"windowLlmCalls":{"type":"integer","minimum":0},"windowInputTokens":{"type":"integer","minimum":0},"windowCachedInputTokens":{"type":"integer","minimum":0},"windowOutputTokens":{"type":"integer","minimum":0},"medianTimeToReviewMs":{"type":"number","minimum":0,"nullable":true},"p90TimeToReviewMs":{"type":"number","minimum":0,"nullable":true}},"required":["workspaces","users","repos","decisions","activeDecisions","findings","reviews","costUsd","byokCostUsd","byokWorkspaces","workspacesAtLimit","newWorkspaces","newUsers","activeWorkspaces","windowReviews","windowFailedReviews","windowSkippedReviews","windowPrsReviewed","windowFindings","windowHighSeverityFindings","windowCostUsd","windowByokCostUsd","windowFailedCostUsd","windowLlmCalls","windowInputTokens","windowCachedInputTokens","windowOutputTokens","medianTimeToReviewMs","p90TimeToReviewMs"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"reviews":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"issues":{"type":"integer","minimum":0},"highSeverityIssues":{"type":"integer","minimum":0},"costUsd":{"type":"number","minimum":0},"signups":{"type":"integer","minimum":0}},"required":["date","reviews","failed","skipped","issues","highSeverityIssues","costUsd","signups"],"additionalProperties":false}}},"required":["windowDays","from","to","totals","daily"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/orgs":{"get":{"summary":"Every workspace with its plan allowance, footprint and spend","tags":["admin"],"parameters":[{"schema":{"type":"integer","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"windowDays":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"githubLogin":{"type":"string","nullable":true},"plan":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"trialEndsAt":{"type":"string","format":"date-time","nullable":true},"allowance":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"nullable":true},"base":{"type":"integer","minimum":0,"nullable":true},"state":{"type":"string","enum":["ok","warning","reached","unlimited"]},"periodEnd":{"type":"string","format":"date-time"},"periodStart":{"type":"string","format":"date-time"}},"required":["used","limit","base","state","periodEnd"],"additionalProperties":false},"reviewsUsed":{"type":"integer","minimum":0},"members":{"type":"integer","minimum":0},"owners":{"type":"array","items":{"type":"string"}},"repos":{"type":"integer","minimum":0},"decisions":{"type":"integer","minimum":0},"findings":{"type":"integer","minimum":0},"byok":{"type":"boolean"},"windowReviews":{"type":"integer","minimum":0},"windowFailedReviews":{"type":"integer","minimum":0},"windowFindings":{"type":"integer","minimum":0},"windowCostUsd":{"type":"number","minimum":0},"lifetimeCostUsd":{"type":"number","minimum":0},"windowByokCostUsd":{"type":"number","minimum":0},"lifetimeByokCostUsd":{"type":"number","minimum":0},"lastReviewAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","name","githubLogin","plan","createdAt","trialEndsAt","allowance","reviewsUsed","members","owners","repos","decisions","findings","byok","windowReviews","windowFailedReviews","windowFindings","windowCostUsd","lifetimeCostUsd","windowByokCostUsd","lifetimeByokCostUsd","lastReviewAt"],"additionalProperties":false}}},"required":["windowDays","items"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/orgs/{orgId}/repos":{"get":{"summary":"One workspace's repositories with index state and activity","tags":["admin"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fullName":{"type":"string"},"defaultBranch":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"indexStatus":{"type":"string","nullable":true},"indexError":{"type":"string","nullable":true},"lastIndexedSha":{"type":"string","nullable":true},"indexedAt":{"type":"string","format":"date-time","nullable":true},"decisions":{"type":"integer","minimum":0},"activeDecisions":{"type":"integer","minimum":0},"findings":{"type":"integer","minimum":0},"openFindings":{"type":"integer","minimum":0},"reviews":{"type":"integer","minimum":0},"failedReviews":{"type":"integer","minimum":0},"costUsd":{"type":"number","minimum":0},"lastReviewAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","fullName","defaultBranch","createdAt","indexStatus","indexError","lastIndexedSha","indexedAt","decisions","activeDecisions","findings","openFindings","reviews","failedReviews","costUsd","lastReviewAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/users":{"get":{"summary":"Everyone who has signed in, newest first","tags":["admin"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"githubUserId":{"type":"integer"},"githubLogin":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"workspaces":{"type":"array","items":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"name":{"type":"string"},"role":{"type":"string"}},"required":["orgId","name","role"],"additionalProperties":false}},"ownedReviews":{"type":"integer","minimum":0},"ownedCostUsd":{"type":"number","minimum":0}},"required":["githubUserId","githubLogin","name","email","company","location","createdAt","workspaces","ownedReviews","ownedCostUsd"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/reviews":{"get":{"summary":"Review attempts across workspaces, newest first (keyset-paginated)","tags":["admin"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"orgId","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"failedOnly","required":false},{"schema":{"type":"string","maxLength":512},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"orgName":{"type":"string"},"repoFullName":{"type":"string"},"prNumber":{"type":"integer"},"prTitle":{"type":"string","nullable":true},"prAuthor":{"type":"string","nullable":true},"status":{"type":"string","enum":["completed","failed","interrupted","skipped_limit"]},"startedAt":{"type":"string","format":"date-time"},"durationMs":{"type":"number","minimum":0},"findingsCount":{"type":"integer","minimum":0,"nullable":true},"llmCalls":{"type":"integer","minimum":0,"nullable":true},"inputTokens":{"type":"integer","minimum":0,"nullable":true},"outputTokens":{"type":"integer","minimum":0,"nullable":true},"costUsd":{"type":"number","minimum":0},"keySource":{"type":"string","enum":["platform","org","mixed"],"nullable":true},"error":{"type":"string","nullable":true}},"required":["id","orgId","orgName","repoFullName","prNumber","prTitle","prAuthor","status","startedAt","durationMs","findingsCount","llmCalls","inputTokens","outputTokens","costUsd","keySource","error"],"additionalProperties":false}},"nextCursor":{"type":"string"}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/errors":{"get":{"summary":"Failed background jobs (every queue) and repositories whose indexing failed","tags":["admin"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"queue":{"type":"string"},"state":{"type":"string"},"orgId":{"type":"string","format":"uuid","nullable":true},"orgName":{"type":"string","nullable":true},"repoFullName":{"type":"string","nullable":true},"prNumber":{"type":"integer","nullable":true},"retryCount":{"type":"integer","minimum":0},"retryLimit":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"failedAt":{"type":"string","format":"date-time"},"message":{"type":"string","nullable":true},"stack":{"type":"string","nullable":true}},"required":["id","queue","state","orgId","orgName","repoFullName","prNumber","retryCount","retryLimit","createdAt","failedAt","message","stack"],"additionalProperties":false}},"indexing":{"type":"array","items":{"type":"object","properties":{"repoId":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"orgName":{"type":"string"},"repoFullName":{"type":"string"},"error":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}},"required":["repoId","orgId","orgName","repoFullName","error","updatedAt"],"additionalProperties":false}}},"required":["jobs","indexing"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/findings":{"get":{"summary":"Posted findings across workspaces — filter by workspace/repo/severity, sort","tags":["admin"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"orgId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"repoId","required":false},{"schema":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"in":"query","name":"severity","required":false},{"schema":{"type":"string","enum":["newest","oldest","severity"],"default":"newest"},"in":"query","name":"sort","required":false},{"schema":{"type":"string","maxLength":32},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"orgName":{"type":"string"},"repoId":{"type":"string","format":"uuid"},"repoFullName":{"type":"string"},"prNumber":{"type":"integer"},"prTitle":{"type":"string","nullable":true},"title":{"type":"string"},"category":{"type":"string"},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL"]},"state":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","orgId","orgName","repoId","repoFullName","prNumber","prTitle","title","category","severity","state","createdAt"],"additionalProperties":false}},"nextCursor":{"type":"string"}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/access-campaigns":{"get":{"summary":"Channel links that skip the waitlist, with sign-ups and activations","tags":["admin"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"cap":{"type":"integer","exclusiveMinimum":true,"minimum":0},"signups":{"type":"integer","minimum":0},"activated":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"closedAt":{"type":"string","format":"date-time","nullable":true}},"required":["code","label","cap","signups","activated","createdAt","closedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a channel link that admits up to `cap` sign-ups past the waitlist","tags":["admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"label":{"type":"string","minLength":1,"maxLength":120},"cap":{"type":"integer","minimum":1,"maximum":10000}},"required":["code","label","cap"],"additionalProperties":false}}},"required":true},"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/admin/access-campaigns/{code}/close":{"post":{"summary":"Close a channel link: it stops admitting sign-ups (its tally stays)","tags":["admin"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"in":"path","name":"code","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"enum":["null"],"nullable":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/repos/events":{"get":{"summary":"Server-Sent Events stream of repo index-status changes (org-scoped)","tags":["dashboard"],"description":"Long-lived `text/event-stream`. Emits `event: index-status` frames whose `data` is `{repoId,status,error,lastIndexedSha}` for the caller’s org, plus a heartbeat comment every ~25s. Consume with a credentialed `EventSource`.","responses":{"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}}},"servers":[{"url":"/","description":"current host"}]}