{"openapi":"3.1.0","info":{"title":"AI Log Agent — Dashboard API","version":"0.7.0"},"paths":{"/healthz":{"get":{"tags":["meta"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/incidents":{"get":{"tags":["incidents"],"summary":"List Incidents","operationId":"list_incidents_v1_incidents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"repo_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/incidents/{incident_id}":{"get":{"tags":["incidents"],"summary":"Get Incident","operationId":"get_incident_v1_incidents__incident_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/incidents/{incident_id}/notifications":{"get":{"tags":["incidents"],"summary":"List Incident Notifications","operationId":"list_incident_notifications_v1_incidents__incident_id__notifications_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IncidentNotificationPublic"},"title":"Response List Incident Notifications V1 Incidents  Incident Id  Notifications Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/incidents/{incident_id}/feedback":{"get":{"tags":["incidents"],"summary":"List Incident Feedback","operationId":"list_incident_feedback_v1_incidents__incident_id__feedback_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IncidentFeedbackPublic"},"title":"Response List Incident Feedback V1 Incidents  Incident Id  Feedback Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/repos":{"get":{"tags":["repos"],"summary":"List Repos","operationId":"list_repos_v1_repos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["repos"],"summary":"Connect Repo","operationId":"connect_repo_v1_repos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoConnectRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/repos/{repo_id}":{"get":{"tags":["repos"],"summary":"Get Repo","operationId":"get_repo_v1_repos__repo_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"repo_id","in":"path","required":true,"schema":{"type":"string","title":"Repo Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["repos"],"summary":"Disconnect Repo","operationId":"disconnect_repo_v1_repos__repo_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"repo_id","in":"path","required":true,"schema":{"type":"string","title":"Repo Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/settings":{"get":{"tags":["settings"],"summary":"Get Settings","operationId":"get_settings_v1_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["settings"],"summary":"Update Settings","operationId":"update_settings_v1_settings_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/quota":{"get":{"tags":["quota"],"summary":"Get Quota","operationId":"get_quota_v1_quota_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/github/repos":{"get":{"tags":["github"],"summary":"List Github Repos","operationId":"list_github_repos_v1_github_repos_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubRepoListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stream/incidents":{"get":{"tags":["stream"],"summary":"Stream Incidents","operationId":"stream_incidents_v1_stream_incidents_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JWT (fallback to header)","title":"Token"},"description":"JWT (fallback to header)"},{"name":"last_event_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Resume after this incident id (overrides Last-Event-ID).","title":"Last Event Id"},"description":"Resume after this incident id (overrides Last-Event-ID)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/log-sources":{"post":{"tags":["log-sources"],"summary":"Create Log Source","operationId":"create_log_source_v1_log_sources_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourceCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourceCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["log-sources"],"summary":"List Log Sources","operationId":"list_log_sources_v1_log_sources_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"repo_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Repo Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/log-sources/{source_id}":{"get":{"tags":["log-sources"],"summary":"Get Log Source","operationId":"get_log_source_v1_log_sources__source_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourcePublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["log-sources"],"summary":"Delete Log Source","operationId":"delete_log_source_v1_log_sources__source_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/log-sources/{source_id}/snippets":{"get":{"tags":["log-sources"],"summary":"Get Snippets","operationId":"get_snippets_v1_log_sources__source_id__snippets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourceSnippetsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/log-sources/{source_id}/rotate-secret":{"post":{"tags":["log-sources"],"summary":"Rotate Secret","operationId":"rotate_secret_v1_log_sources__source_id__rotate_secret_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourceCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/log-sources/{source_id}/test":{"post":{"tags":["log-sources"],"summary":"Test Event","operationId":"test_event_v1_log_sources__source_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/LogSourceTestRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSourceTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/webhook/{token}":{"post":{"tags":["ingest"],"summary":"Post Webhook","description":"Generic webhook endpoint.\n\nThis is the URL the dashboard's wizard puts in the user's\nsnippet. The receiver is intentionally permissive about\npayload shape so the same endpoint works for raw posts,\ncustom SDKs, and OTel collectors.","operationId":"post_webhook_ingest_webhook__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestEventBody"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Webhook Ingest Webhook  Token  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/sentry/{token}":{"post":{"tags":["ingest"],"summary":"Post Sentry","description":"Sentry forwarder endpoint — auto-unwraps `{event: {...}}`.\n\nPreferred path — **structured adapter**: if the envelope\ncarries a well-formed `exception.values[*].stacktrace.frames`\narray (which Sentry's SDKs always produce for real\nexceptions), we hand it to\n`packages.monitor.sentry_adapter.from_sentry_payload` and\nbypass the regex detector entirely. This gives us\nHIGH-confidence detections with real in-app frames instead\nof frameless LOW-confidence matches from parsing Sentry's\nshort top-level `message` string.\n\nFallback path — **body-driven**: if the payload isn't\nstructured (e.g. Sentry `message`-only capture, or a\nwebhook posing as a Sentry-shaped envelope), we validate\nthe flat `IngestEventBody` and go through the standard\npipeline. This preserves the pre-Phase-0 behaviour so no\ndownstream customer's ingestion silently breaks.","operationId":"post_sentry_ingest_sentry__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Sentry Ingest Sentry  Token  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CodeSnippet":{"properties":{"language":{"type":"string","title":"Language"},"label":{"type":"string","title":"Label"},"code":{"type":"string","title":"Code"}},"type":"object","required":["language","label","code"],"title":"CodeSnippet","description":"One copy-paste snippet for connecting an upstream to a source.\n\n`language` is the surface label (\"Python\", \"Node.js\", \"curl\",\n\"Sentry\") the dashboard renders as a tab; `code` is verbatim\ntext the user pastes into their app or config."},"GithubRepoListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GithubRepoSummary"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"GithubRepoListResponse","description":"Bare list response wrapped for forward-compatibility (paging)."},"GithubRepoSummary":{"properties":{"full_name":{"type":"string","title":"Full Name"},"default_branch":{"type":"string","title":"Default Branch"},"private":{"type":"boolean","title":"Private"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"pushed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pushed At"}},"type":"object","required":["full_name","default_branch","private"],"title":"GithubRepoSummary","description":"One row in the GitHub OAuth repo picker.\n\nMirrors `packages/api/github_client.py:GithubRepoSummary` with\nthe same intentionally narrow field set. We do NOT pass through\nGitHub's full repo object — only what the UI needs to render a\nrow + decide which repo to connect."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","enum":["ok","degraded"],"title":"Status","default":"ok"},"version":{"type":"string","title":"Version"},"checks":{"additionalProperties":{"type":"string"},"type":"object","title":"Checks"}},"type":"object","required":["version"],"title":"HealthResponse"},"IncidentDetail":{"properties":{"id":{"type":"integer","title":"Id"},"fingerprint":{"type":"string","title":"Fingerprint"},"repo_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo Id"},"language":{"type":"string","title":"Language"},"exception_type":{"type":"string","title":"Exception Type"},"message":{"type":"string","title":"Message"},"severity":{"type":"string","title":"Severity"},"sectors":{"items":{"type":"string"},"type":"array","title":"Sectors"},"status":{"type":"string","title":"Status"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"confidence_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence Score","description":"Pulled from the FixProposal when available. None if the incident is still pending/analyzing or analyzer didn't produce a proposal."},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"},"raw_payload":{"additionalProperties":true,"type":"object","title":"Raw Payload"},"analysis_report":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Analysis Report"},"error_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Detail"}},"type":"object","required":["id","fingerprint","repo_id","language","exception_type","message","severity","sectors","status","occurrence_count","first_seen_at","last_seen_at","raw_payload","analysis_report","error_detail"],"title":"IncidentDetail","description":"Full payload for the incident detail page.\n\nIncludes the analysis report shape the frontend renders into\nthe \"Root cause\", \"Fix\", \"Validations\" panels."},"IncidentFeedbackPublic":{"properties":{"channel":{"type":"string","title":"Channel"},"actor":{"type":"string","title":"Actor"},"action":{"type":"string","title":"Action"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["channel","actor","action","value","created_at"],"title":"IncidentFeedbackPublic"},"IncidentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/IncidentSummary"},"type":"array","title":"Items"},"page":{"$ref":"#/components/schemas/PageMeta","default":{}}},"type":"object","required":["items"],"title":"IncidentListResponse"},"IncidentNotificationPublic":{"properties":{"channel":{"type":"string","title":"Channel"},"status":{"type":"string","title":"Status"},"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target"},"attempts":{"type":"integer","title":"Attempts"},"error_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Detail"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["channel","status","target","attempts","error_detail","created_at","updated_at"],"title":"IncidentNotificationPublic"},"IncidentSummary":{"properties":{"id":{"type":"integer","title":"Id"},"fingerprint":{"type":"string","title":"Fingerprint"},"repo_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo Id"},"language":{"type":"string","title":"Language"},"exception_type":{"type":"string","title":"Exception Type"},"message":{"type":"string","title":"Message"},"severity":{"type":"string","title":"Severity"},"sectors":{"items":{"type":"string"},"type":"array","title":"Sectors"},"status":{"type":"string","title":"Status"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"confidence_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence Score","description":"Pulled from the FixProposal when available. None if the incident is still pending/analyzing or analyzer didn't produce a proposal."},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"}},"type":"object","required":["id","fingerprint","repo_id","language","exception_type","message","severity","sectors","status","occurrence_count","first_seen_at","last_seen_at"],"title":"IncidentSummary","description":"Compact projection used by the incidents list page.\n\nStrips heavy fields (full traceback text, full FixProposal\nJSON) so the list endpoint stays fast even with thousands of\nincidents. The detail page calls a separate endpoint to get\nthe full report."},"IngestEventBody":{"properties":{"raw_text":{"anyOf":[{"type":"string","maxLength":262144},{"type":"null"}],"title":"Raw Text"},"message":{"anyOf":[{"type":"string","maxLength":8192},{"type":"null"}],"title":"Message"},"stack":{"anyOf":[{"type":"string","maxLength":262144},{"type":"null"}],"title":"Stack"},"service":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Service"},"host":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Host"},"environment":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Environment"},"level":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Level"},"language":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Language"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"repo_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Repo Id"}},"type":"object","title":"IngestEventBody","description":"Validated body of one ingest POST.\n\nEither `raw_text` OR (`message` + `stack`) must be present — we\nfail validation otherwise. Everything else is optional;\nserver-side defaults kick in for missing fields."},"LogSourceCreateRequest":{"properties":{"repo_id":{"type":"string","maxLength":255,"minLength":1,"title":"Repo Id"},"kind":{"type":"string","enum":["webhook","sentry","file_tail","loki"],"title":"Kind"},"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"additionalProperties":false,"type":"object","required":["repo_id","kind","name"],"title":"LogSourceCreateRequest","description":"Body for `POST /v1/log-sources`.\n\n`name` is a friendly label the user sees in the dashboard list\n(\"Production webhook\", \"Staging file tail\"). `repo_id` MUST refer\nto a repo the user has connected — we don't enforce that with an\nFK (so disconnecting doesn't cascade-delete) but the router\nvalidates it against `user_repos` before accepting the create.\n\n`config` is adapter-specific:\n    webhook   - {} (we generate everything server-side)\n    sentry    - {} (same; Sentry-specific shape is on inbound)\n    file_tail - {\"path\": \"/var/log/app.log\", \"service\": \"api\"}\n    loki      - {\"base_url\": \"...\", \"query\": \"{...}\"}"},"LogSourceCreatedResponse":{"properties":{"source":{"$ref":"#/components/schemas/LogSourcePublic"},"ingest_url":{"type":"string","title":"Ingest Url"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"snippets":{"items":{"$ref":"#/components/schemas/CodeSnippet"},"type":"array","title":"Snippets"}},"type":"object","required":["source","ingest_url","secret","snippets"],"title":"LogSourceCreatedResponse","description":"`POST /v1/log-sources` response — includes the secret ONCE.\n\nThe dashboard shows the secret in a one-shot reveal panel. After\nthe user dismisses the panel, the only ways to reach this state\nagain are (a) rotate the secret or (b) delete and recreate."},"LogSourceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LogSourcePublic"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"LogSourceListResponse"},"LogSourcePublic":{"properties":{"id":{"type":"string","title":"Id"},"repo_id":{"type":"string","title":"Repo Id"},"kind":{"type":"string","enum":["webhook","sentry","file_tail","loki"],"title":"Kind"},"name":{"type":"string","title":"Name"},"ingest_token":{"type":"string","title":"Ingest Token"},"has_secret":{"type":"boolean","title":"Has Secret"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"routing_rules":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Routing Rules"},"event_count":{"type":"integer","title":"Event Count"},"last_event_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Event At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","repo_id","kind","name","ingest_token","has_secret","event_count","created_at","updated_at"],"title":"LogSourcePublic","description":"Read shape — never includes the plaintext secret.\n\n`has_secret=True` means the user CAN authenticate inbound\nrequests; the secret itself is only available immediately after\ncreation or after rotation (see `LogSourceCreatedResponse`)."},"LogSourceSnippetsResponse":{"properties":{"ingest_url":{"type":"string","title":"Ingest Url"},"snippets":{"items":{"$ref":"#/components/schemas/CodeSnippet"},"type":"array","title":"Snippets"}},"type":"object","required":["ingest_url","snippets"],"title":"LogSourceSnippetsResponse","description":"`GET /v1/log-sources/{id}/snippets` — secret is masked.\n\nReturned anytime AFTER the one-shot reveal. Snippets here have\n`<YOUR_SECRET>` placeholders so the user can still see exactly\nwhat they would paste, just without the live value."},"LogSourceTestRequest":{"properties":{"message":{"type":"string","maxLength":4096,"title":"Message","default":"Test event from dashboard — your log source is wired up correctly. You can delete this incident."},"level":{"type":"string","enum":["error","warning","info"],"title":"Level","default":"error"},"raw_text":{"anyOf":[{"type":"string","maxLength":262144},{"type":"null"}],"title":"Raw Text","description":"Override the synthesized stack with a verbatim raw log string. Use to submit a real production traceback through the dashboard for analysis."}},"additionalProperties":false,"type":"object","title":"LogSourceTestRequest","description":"Body for `POST /v1/log-sources/{id}/test`.\n\nThe dashboard's \"Send test event\" button posts an empty body by\ndefault; advanced users can override the message/level for a\nrealistic dry-run.\n\n`raw_text` is the escape hatch: when set, the synthesized event\nuses this verbatim string as its `raw_text` (the field the\ndetector parses). This is what the dashboard's \"Send custom\nevent\" textarea uses so an operator can paste a real production\ntraceback through the dashboard without writing any client code.\nWhen `raw_text` is set, `message` is ignored."},"LogSourceTestResponse":{"properties":{"outcome":{"type":"string","title":"Outcome"},"incident_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Id"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint"}},"type":"object","required":["outcome"],"title":"LogSourceTestResponse","description":"`POST /v1/log-sources/{id}/test` — outcome of the synthetic event.\n\n`outcome` mirrors `MonitorPipeline.observe()`'s return value:\n    \"incident_created\"   - new fingerprint, incident enqueued\n    \"deduped\"            - matched an existing fingerprint\n    \"dropped\"            - filtered out (very unlikely for a test)\n\n`incident_id` is set when an incident was created or the dedupe\ntarget is known so the dashboard can deep-link to it."},"PageMeta":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"total_estimate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Estimate"}},"type":"object","title":"PageMeta","description":"Pagination envelope used by every list endpoint.\n\n`next_cursor` is `None` when there's no more data; otherwise\nit's an opaque string the client passes back as `?cursor=...`.\nCursors are preferred over offset pagination because:\n\n* Offset paging is O(N) — pagination cost grows with total\n  row count, painful when an incident table reaches 100k rows.\n* Cursor paging is O(1) — Postgres uses the `(last_seen_at, id)`\n  index regardless of how deep the user scrolls."},"QuotaResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"True on the hosted SaaS where quotas apply. False on self-hosted installs; other fields are then unset."},"plan":{"type":"string","title":"Plan","description":"One of 'trial', 'paid_hosted', 'self_hosted', 'expired', 'none'."},"active":{"type":"boolean","title":"Active","description":"True iff the caller may consume more investigations. False when the trial has expired or the cap is reached."},"investigations_used":{"type":"integer","title":"Investigations Used"},"investigations_cap":{"type":"integer","title":"Investigations Cap"},"investigations_remaining":{"type":"integer","title":"Investigations Remaining"},"repos_cap":{"type":"integer","title":"Repos Cap"},"trial_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Started At"},"trial_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Expires At"},"days_remaining":{"type":"integer","title":"Days Remaining"}},"type":"object","required":["enabled","plan","active","investigations_used","investigations_cap","investigations_remaining","repos_cap","trial_started_at","trial_expires_at","days_remaining"],"title":"QuotaResponse","description":"Trial state snapshot returned by ``GET /v1/quota``.\n\n``enabled=False`` means this deployment is self-hosted: quotas\nare inactive and the numeric fields carry the sentinel value 0.\nFrontends should render the \"unlimited\" state accordingly (no\nbanner, no upgrade CTA)."},"RepoConnectRequest":{"properties":{"github_full_name":{"type":"string","maxLength":255,"minLength":3,"title":"Github Full Name","description":"GitHub repo slug, e.g. 'acme/checkout'.","examples":["acme/checkout"]},"default_branch":{"type":"string","maxLength":128,"minLength":1,"title":"Default Branch","description":"Default branch to clone and watch.","default":"main"},"repo_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Repo Id","description":"Optional friendly id used by the indexer/monitor. Defaults to `github_full_name` when omitted."},"git_ref":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Git Ref","description":"Optional git ref (commit SHA, tag, or branch) to pin the indexer at. When set, takes precedence over default_branch. Use to reproduce a bug at the parent of a known fix commit.","examples":["3d11042772fe7f75008e53dc48c537fc4bbd0b1a"]},"github_installation_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Github Installation Id","description":"GitHub App installation id from Clerk OAuth. When set, the indexer authenticates as the app rather than using a personal access token."}},"additionalProperties":false,"type":"object","required":["github_full_name"],"title":"RepoConnectRequest","description":"Body of POST /v1/repos.\n\nFor v1 we accept a GitHub `owner/repo` slug + optional\nbranch override. The Phase 7.4 OAuth flow sets\n`github_installation_id`; manual PAT users leave it null and\nthe indexer falls back to `GITHUB_TOKEN`."},"RepoListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RepoPublic"},"type":"array","title":"Items"},"page":{"$ref":"#/components/schemas/PageMeta","default":{}}},"type":"object","required":["items"],"title":"RepoListResponse"},"RepoPublic":{"properties":{"id":{"type":"integer","title":"Id"},"repo_id":{"type":"string","title":"Repo Id"},"github_full_name":{"type":"string","title":"Github Full Name"},"default_branch":{"type":"string","title":"Default Branch"},"git_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Ref"},"indexing_status":{"type":"string","enum":["pending","indexing","ready","failed"],"title":"Indexing Status"},"indexing_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Indexing Error"},"indexed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Indexed At"},"file_count":{"type":"integer","title":"File Count","default":0},"chunk_count":{"type":"integer","title":"Chunk Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"github_installation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Installation Id"}},"type":"object","required":["id","repo_id","github_full_name","default_branch","indexing_status","indexing_error","indexed_at","created_at"],"title":"RepoPublic","description":"Wire shape of a connected repo."},"SettingsResponse":{"properties":{"openai_api_key_set":{"type":"boolean","title":"Openai Api Key Set","default":false},"openai_api_key_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Openai Api Key Preview"},"anthropic_api_key_set":{"type":"boolean","title":"Anthropic Api Key Set","default":false},"anthropic_api_key_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic Api Key Preview"},"voyage_api_key_set":{"type":"boolean","title":"Voyage Api Key Set","default":false},"voyage_api_key_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voyage Api Key Preview"},"notifier_high_threshold":{"type":"integer","title":"Notifier High Threshold","default":80},"notifier_mid_threshold":{"type":"integer","title":"Notifier Mid Threshold","default":60},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","title":"SettingsResponse","description":"Per-user settings as the dashboard sees them.\n\nFor each BYO key field we expose only a boolean `*_set` flag\nplus a 4-char `*_preview`. The plaintext NEVER goes back to\nthe browser — even the user can't read their own key after\nsaving it (they'd just paste a new one if they forgot)."},"SettingsUpdateRequest":{"properties":{"openai_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Openai Api Key"},"anthropic_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic Api Key"},"voyage_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voyage Api Key"},"notifier_high_threshold":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Notifier High Threshold"},"notifier_mid_threshold":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Notifier Mid Threshold"}},"additionalProperties":false,"type":"object","title":"SettingsUpdateRequest","description":"Partial update — all fields optional.\n\nSentinel values:\n\n* `None` — \"no change to this field\" (the default).\n* `\"\"` (empty string) — \"clear this field\" (removes the key).\n* non-empty string — \"store this new key\".\n\nThis three-way semantic is necessary because we can't use\n`null` to mean \"delete\" *and* \"no change\". Empty string is\nchosen for \"delete\" because it's impossible to be a valid API\nkey anyway."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}