{"openapi":"3.1.0","info":{"title":"Entire API","description":"OpenAPI documentation for Entire API.","version":"0.1.0"},"tags":[{"name":"System","description":"Health and status endpoints for uptime checks, diagnostics, and runtime metadata."}],"paths":{"/api/v1/health":{"get":{"operationId":"getApiV1Health","tags":["System"],"summary":"Health check","description":"Returns API liveness and runtime metadata.","responses":{"200":{"description":"API health response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"message":{"type":"string"},"version":{"type":"string"},"environment":{"type":"string"},"timestamp":{"type":"number"}},"required":["status","message","version","environment","timestamp"]}}}}}}},"/api/v1/status":{"get":{"operationId":"getApiV1Status","tags":["System"],"summary":"API status","description":"Returns API status and documented endpoint map.","responses":{"200":{"description":"API status response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"message":{"type":"string"},"endpoints":{"type":"object","properties":{"auth":{"type":"object","properties":{"start":{"type":"string"},"core_start":{"type":"string"},"core_callback":{"type":"string"},"start_installation":{"type":"string"},"me":{"type":"string"},"logout":{"type":"string"}},"required":["start","core_start","core_callback","start_installation","me","logout"]},"preferences":{"type":"object","properties":{"repos":{"type":"string"},"pin_repo":{"type":"string"},"unpin_repo":{"type":"string"},"add_recent_repo":{"type":"string"},"remove_recent_repo":{"type":"string"},"migrate_repo_preferences":{"type":"string"},"session_detail_filters":{"type":"string"},"filter_tabs":{"type":"string"}},"required":["repos","pin_repo","unpin_repo","add_recent_repo","remove_recent_repo","migrate_repo_preferences","session_detail_filters","filter_tabs"]},"me":{"type":"object","properties":{"delete_account":{"type":"string"},"deletion_preview":{"type":"string"},"cancel_deletion":{"type":"string"}},"required":["delete_account","deletion_preview","cancel_deletion"]},"repositories":{"type":"object","properties":{"list":{"type":"string"},"stream":{"type":"string"}},"required":["list","stream"]},"dispatches":{"type":"object","properties":{"generate":{"type":"string"}},"required":["generate"]},"cache":{"type":"object","properties":{"commits":{"type":"string"},"checkpoints":{"type":"string"},"checkpointResolve":{"type":"string"},"checkpointTranscript":{"type":"string"},"sessionTranscript":{"type":"string"}},"required":["commits","checkpoints","checkpointResolve","checkpointTranscript","sessionTranscript"]},"webhooks":{"type":"object","properties":{"github":{"type":"string"},"health":{"type":"string"}},"required":["github","health"]},"changes":{"type":"object","properties":{"update_settings":{"type":"string"},"list":{"type":"string"},"create":{"type":"string"},"detail":{"type":"string"},"update":{"type":"string"},"delete":{"type":"string"},"discussions":{"type":"string"},"discussion":{"type":"string"},"discussion_messages":{"type":"string"},"discussion_events":{"type":"string"},"threads":{"type":"string"},"thread":{"type":"string"},"thread_messages":{"type":"string"},"thread_events":{"type":"string"},"submit_approval":{"type":"string"},"get_approvals":{"type":"string"},"get_files":{"type":"string"},"start_review":{"type":"string"},"review_comments":{"type":"string"},"review_comment":{"type":"string"},"review":{"type":"string"},"review_diff":{"type":"string"},"review_files":{"type":"string"},"list_review_comments":{"type":"string"},"list_review_comments_by_repo":{"type":"string"},"events":{"type":"string"},"events_by_repo":{"type":"string"}},"required":["update_settings","list","create","detail","update","delete","discussions","discussion","discussion_messages","discussion_events","threads","thread","thread_messages","thread_events","submit_approval","get_approvals","get_files","start_review","review_comments","review_comment","review","review_diff","review_files","list_review_comments","list_review_comments_by_repo","events","events_by_repo"]},"system":{"type":"object","properties":{"meta":{"type":"string"}},"required":["meta"]}},"required":["auth","preferences","me","repositories","dispatches","cache","webhooks","changes","system"]}},"required":["status","message","endpoints"]}}}}}}},"/api/v1/meta":{"get":{"operationId":"getApiV1Meta","tags":["System"],"summary":"Fleet metadata","description":"Entire's public egress IP addresses in CIDR notation, flat and grouped by AWS region. Customers with IP allow lists (e.g. GitHub organizations) must permit these addresses.","responses":{"200":{"description":"Fleet metadata response","content":{"application/json":{"schema":{"type":"object","properties":{"egress":{"type":"array","items":{"type":"string"}},"egress_by_region":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"updated":{"type":"string"}},"required":["egress","egress_by_region","updated"]}}}}}}},"/api/v1/auth/me":{"get":{"operationId":"getApiV1AuthMe","tags":["Auth"],"summary":"Get current authenticated user","description":"Returns the current session user and auth-scoped application state.","responses":{"200":{"description":"Current authenticated user","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"core_account_id":{"type":"string"},"github_login":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"orgs":{"type":"string"},"search_enabled":{"type":"boolean","const":true},"feature_flags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"repo_preferences":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]},"home_jurisdiction":{"type":"string"},"needs_onboarding":{"type":"boolean"},"cli_logged_in":{"type":"boolean"},"deletion_scheduled_at":{"type":"string"},"cooldown_ends_at":{"type":"string"}},"required":["id","github_login","created_at","orgs","search_enabled","feature_flags"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/session-detail-filters":{"get":{"operationId":"getApiV1PreferencesSessionDetailFilters","tags":["Preferences"],"summary":"Get session detail filter defaults for the current user","responses":{"200":{"description":"Session detail filter defaults","content":{"application/json":{"schema":{"type":"object","properties":{"filters":{"anyOf":[{"type":"object","properties":{"prompts":{"type":"boolean"},"responses":{"type":"boolean"},"intermediateSteps":{"type":"boolean"},"checkpoints":{"type":"boolean"},"toolCalls":{"type":"boolean"},"toolCategories":{"type":"object","propertyNames":{"type":"string","enum":["File edits","Bash","Read","Skills","Entire","Other"]},"additionalProperties":{"type":"boolean"}}},"required":["prompts","responses","intermediateSteps","checkpoints","toolCalls","toolCategories"],"additionalProperties":false},{"type":"null"}]},"showHiddenIndicators":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["filters","showHiddenIndicators"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"putApiV1PreferencesSessionDetailFilters","tags":["Preferences"],"summary":"Save session detail filter defaults for the current user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filters","showHiddenIndicators"],"additionalProperties":false,"properties":{"filters":{"type":"object","required":["prompts","responses","intermediateSteps","checkpoints","toolCalls","toolCategories"],"additionalProperties":false,"properties":{"prompts":{"type":"boolean"},"responses":{"type":"boolean"},"intermediateSteps":{"type":"boolean"},"checkpoints":{"type":"boolean"},"toolCalls":{"type":"boolean"},"toolCategories":{"type":"object","additionalProperties":{"type":"boolean"},"propertyNames":{"enum":["File edits","Bash","Read","Skills","Entire","Other"]}}}},"showHiddenIndicators":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Saved session detail filter defaults","content":{"application/json":{"schema":{"type":"object","properties":{"filters":{"anyOf":[{"type":"object","properties":{"prompts":{"type":"boolean"},"responses":{"type":"boolean"},"intermediateSteps":{"type":"boolean"},"checkpoints":{"type":"boolean"},"toolCalls":{"type":"boolean"},"toolCategories":{"type":"object","propertyNames":{"type":"string","enum":["File edits","Bash","Read","Skills","Entire","Other"]},"additionalProperties":{"type":"boolean"}}},"required":["prompts","responses","intermediateSteps","checkpoints","toolCalls","toolCategories"],"additionalProperties":false},{"type":"null"}]},"showHiddenIndicators":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["filters","showHiddenIndicators"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/diff-view":{"get":{"operationId":"getApiV1PreferencesDiffView","tags":["Preferences"],"summary":"Get diff view settings for the current user","responses":{"200":{"description":"Diff view settings","content":{"application/json":{"schema":{"type":"object","properties":{"viewMode":{"anyOf":[{"type":"string","enum":["unified","split"]},{"type":"null"}]},"wrapLines":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"fileTreeOpen":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["viewMode","wrapLines","fileTreeOpen"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"putApiV1PreferencesDiffView","tags":["Preferences"],"summary":"Save diff view settings for the current user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["viewMode","wrapLines","fileTreeOpen"],"additionalProperties":false,"properties":{"viewMode":{"type":"string","enum":["unified","split"]},"wrapLines":{"type":"boolean"},"fileTreeOpen":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Saved diff view settings","content":{"application/json":{"schema":{"type":"object","properties":{"viewMode":{"type":"string","enum":["unified","split"]},"wrapLines":{"type":"boolean"},"fileTreeOpen":{"type":"boolean"}},"required":["viewMode","wrapLines","fileTreeOpen"],"additionalProperties":false}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/filter-tabs":{"get":{"operationId":"getApiV1PreferencesFilterTabs","tags":["Preferences"],"summary":"Get saved list filter tabs for the current user","responses":{"200":{"description":"Saved filter tabs keyed by surface storage key","content":{"application/json":{"schema":{"type":"object","properties":{"tabs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"savedTabs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterOrder":{"type":"array","items":{"type":"string"}},"displaySettings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","name","filters","filterOrder"]}},"allTab":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterOrder":{"type":"array","items":{"type":"string"}},"displaySettings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["name","filters","filterOrder"]},{"type":"null"}]}},"required":["savedTabs","allTab"]}}},"required":["tabs"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"putApiV1PreferencesFilterTabs","tags":["Preferences"],"summary":"Save a single list filter tabs slice for the current user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["storage_key"],"additionalProperties":false,"properties":{"storage_key":{"type":"string","minLength":1,"maxLength":200},"saved_tabs":{"type":"array","items":{"type":"object","required":["id","name","filters","filterOrder"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":true},"filterOrder":{"type":"array","items":{"type":"string"}},"displaySettings":{"type":"object","additionalProperties":{"type":"string"}}}},"maxItems":100},"all_tab":{"type":["object","null"],"required":["name","filters","filterOrder"],"properties":{"name":{"type":"string"},"filters":{"type":"object","additionalProperties":true},"filterOrder":{"type":"array","items":{"type":"string"}},"displaySettings":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Saved filter tabs keyed by surface storage key","content":{"application/json":{"schema":{"type":"object","properties":{"tabs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"savedTabs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterOrder":{"type":"array","items":{"type":"string"}},"displaySettings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","name","filters","filterOrder"]}},"allTab":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterOrder":{"type":"array","items":{"type":"string"}},"displaySettings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["name","filters","filterOrder"]},{"type":"null"}]}},"required":["savedTabs","allTab"]}}},"required":["tabs"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/repos":{"get":{"operationId":"getApiV1PreferencesRepos","tags":["Preferences"],"summary":"Get repository preferences for the current user","description":"Pinned and recent repositories from entire-api, hydrated with each item's `provider` (`github`/`entire`) via entire-core's POST /repos/resolve-ids — repo preferences aren't confined to the caller's home jurisdiction, so provider can't be derived from entire-api's own (regional) store. Hydration is best-effort: a core failure or an id that no longer resolves degrades to that item omitting `provider` rather than failing the whole read.","responses":{"200":{"description":"Pinned and recent repositories","content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository is missing or inaccessible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/repos/pinned":{"post":{"operationId":"postApiV1PreferencesReposPinned","tags":["Preferences"],"summary":"Pin a repository for the current user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["repo_id"],"properties":{"repo_id":{"type":"string","minLength":1,"description":"Internal repository id"}}}}}},"responses":{"200":{"description":"Pinned and recent repositories after mutation","content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository is missing or inaccessible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Pinned repo limit reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/repos/pinned/{repoId}":{"delete":{"operationId":"deleteApiV1PreferencesReposPinnedByRepoId","tags":["Preferences"],"summary":"Unpin a repository for the current user","parameters":[{"name":"repoId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Internal repository id"}],"responses":{"200":{"description":"Pinned and recent repositories after mutation","content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]}}}},"400":{"description":"Invalid path parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/repos/recent":{"post":{"operationId":"postApiV1PreferencesReposRecent","tags":["Preferences"],"summary":"Add a repository to the current user's recent list","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["repo_id"],"properties":{"repo_id":{"type":"string","minLength":1,"description":"Internal repository id"}}},{"type":"object","required":["full_name"],"properties":{"full_name":{"type":"string","description":"Repository full name"}}}]}}}},"responses":{"200":{"description":"Pinned and recent repositories after mutation","content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/repos/recent/{repoId}":{"delete":{"operationId":"deleteApiV1PreferencesReposRecentByRepoId","tags":["Preferences"],"summary":"Remove a repository from the current user's recent list","parameters":[{"name":"repoId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Internal repository id"}],"responses":{"200":{"description":"Pinned and recent repositories after mutation","content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]}}}},"400":{"description":"Invalid path parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/preferences/repos/migrate":{"post":{"operationId":"postApiV1PreferencesReposMigrate","tags":["Preferences"],"summary":"Migrate local repository preferences for the current user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pinned","recent"],"properties":{"pinned":{"type":"array","items":{"type":"object","required":["github_id","full_name"],"properties":{"github_id":{"type":"integer","description":"GitHub repository id"},"full_name":{"type":"string","description":"Repository full name at the time it was stored locally"}}}},"recent":{"type":"array","items":{"type":"object","required":["github_id","full_name"],"properties":{"github_id":{"type":"integer","description":"GitHub repository id"},"full_name":{"type":"string","description":"Repository full name at the time it was stored locally"}}}}}}}}},"responses":{"200":{"description":"Pinned and recent repositories after migration","content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}},"recent":{"type":"array","items":{"type":"object","properties":{"repo_id":{"type":"string","minLength":1},"full_name":{"type":"string"},"runners_enabled":{"type":"boolean"},"trails_enabled":{"type":"boolean"},"provider":{"type":"string","enum":["github","entire"]}},"required":["repo_id","full_name","runners_enabled","trails_enabled"]}}},"required":["pinned","recent"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/dispatches/generate":{"post":{"operationId":"postApiV1DispatchesGenerate","tags":["Dispatches"],"summary":"Generate a dispatch","parameters":[{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell resolves the repos and generates (bearer callers). Gateway-only — never forwarded. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repos":{"type":"array","items":{"type":"string"}},"orgs":{"type":"array","items":{"type":"string"}},"since":{"type":"string"},"until":{"type":"string"},"branches":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["all"]}]},"voice":{"type":"string"}}}}}},"responses":{"200":{"description":"Dispatch generated immediately","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"jurisdiction":{"type":"string"},"covered_repos":{"type":"array","items":{"type":"string"}},"branches":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","const":"all"}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"normalized_since":{"type":"string"},"normalized_until":{"type":"string"},"first_checkpoint_created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_checkpoint_created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["normalized_since","normalized_until","first_checkpoint_created_at","last_checkpoint_created_at"]},"totals":{"type":"object","properties":{"checkpoints":{"type":"number"},"used_checkpoint_count":{"type":"number"},"branches":{"type":"number"},"files_touched":{"type":"number"}},"required":["checkpoints","used_checkpoint_count","branches","files_touched"]},"generated_markdown":{"type":"string"},"repos":{"type":"array","items":{"type":"object","properties":{"full_name":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"bullets":{"type":"array","items":{"type":"object","properties":{"checkpoint_id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["cloud_analysis","local_summary","commit_message"]},"branch":{"type":"string"},"created_at":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}}},"required":["checkpoint_id","text","source","branch","created_at","labels"]}}},"required":["label","bullets"]}}},"required":["full_name","sections"]}}},"required":["title","covered_repos","branches","voice","window","totals","generated_markdown","repos"]}}}},"400":{"description":"Invalid dispatch request"},"404":{"description":"Repository not found"},"429":{"description":"Rate limit exceeded"},"503":{"description":"Dispatch generation unavailable"}}}},"/api/v1/sessions/{cell}/{shareId}":{"get":{"operationId":"getApiV1SessionsByCellByShareId","tags":["Sessions"],"summary":"Get a publicly shared session by share link","description":"Returns the session transcript envelope for a home-cell + opaque share id. No auth required. Only the shareId is forwarded upstream; the repository is never part of the request. Unknown/invalid cell or non-shared → 404.","responses":{"200":{"description":"Session transcript envelope","content":{"application/json":{"schema":{}}}},"404":{"description":"Invalid cell or unknown/non-shared session","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"cell","required":true},{"schema":{"type":"string"},"in":"path","name":"shareId","required":true}]}},"/api/v1/cache/user/checkpoints":{"get":{"operationId":"getApiV1CacheUserCheckpoints","tags":["Users"],"summary":"List checkpoints for the authenticated user","description":"Returns recent checkpoints across the authenticated user's repositories. The response includes contribution streak dates and CLI onboarding state for Home.","parameters":[{"name":"timeframe","in":"query","required":false,"description":"Window of user activity to return. Defaults to last-6-months.","schema":{"type":"string","enum":["last-month","last-3-months","last-6-months"]}},{"name":"limit","in":"query","required":false,"description":"Maximum number of results to return. Defaults to 500 and is capped at 1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":500}}],"responses":{"200":{"description":"User checkpoints and Home activity state","content":{"application/json":{"schema":{"type":"object","properties":{"checkpoints":{"type":"array","items":{"type":"object","properties":{"checkpoint_id":{"type":"string"},"commit_sha":{"type":"string"},"commit_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_body":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_date":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_author_github_id":{"anyOf":[{"type":"number"},{"type":"null"}]},"additions":{"type":"number"},"deletions":{"type":"number"},"files_changed":{"type":"number"},"repo_id":{"type":"string"},"repo_full_name":{"type":"string"},"branch":{"type":"string"},"is_private":{"type":"boolean"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"number"},"session_count":{"type":"number"},"session_ids":{"type":"array","items":{"type":"string"}},"sessions":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"agent":{"type":"string"},"model":{"type":"string"},"kind":{"type":"string"},"steps":{"type":"number"},"sessionId":{"type":"string"},"createdAt":{"type":"string"},"tokenUsage":{"type":"object","properties":{"inputTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"outputTokens":{"type":"number"},"apiCallCount":{"type":"number"}},"required":["inputTokens","cacheCreationTokens","cacheReadTokens","outputTokens","apiCallCount"]},"attribution":{"type":"object","properties":{"calculatedAt":{"type":"string"},"agentLines":{"type":"number"},"humanAdded":{"type":"number"},"humanModified":{"type":"number"},"humanRemoved":{"type":"number"},"totalCommitted":{"type":"number"},"agentPercentage":{"type":"number"}},"required":["calculatedAt","agentLines","humanAdded","humanModified","humanRemoved","totalCommitted","agentPercentage"]},"transcriptIdentifierAtStart":{"type":"string"},"checkpointTranscriptStart":{"anyOf":[{"type":"number"},{"type":"null"}]},"skillEvents":{"type":"array","items":{}}},"required":["prompt","agent","steps"]}},{"type":"null"}]},"dead_session_indices":{"type":"array","items":{"type":"number"}},"payload_hydration_state":{"type":"string","enum":["pending","hydrated","partial","failed"]},"input_tokens":{"type":"number"},"output_tokens":{"type":"number"}},"required":["checkpoint_id","commit_sha","commit_message","commit_subject","commit_body","commit_date","commit_author_github_id","additions","deletions","files_changed","repo_id","repo_full_name","branch","is_private","prompt","steps","session_count","session_ids","sessions","dead_session_indices","input_tokens","output_tokens"]}},"streakDates":{"type":"array","items":{"type":"string"}},"timeframe":{"type":"string"},"updated_at":{"type":"string"},"hasCheckpoints":{"type":"boolean"},"cliRepoEnabled":{"type":"boolean"},"cliRepoEnablePendingAccess":{"type":"boolean"},"syncing":{"type":"boolean"}},"required":["checkpoints","streakDates","timeframe","updated_at","hasCheckpoints","cliRepoEnabled","cliRepoEnablePendingAccess","syncing"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/cache/user/sessions":{"get":{"operationId":"getApiV1CacheUserSessions","tags":["Sessions"],"summary":"List sessions for the authenticated user","description":"Returns recent sessions across the authenticated user's repositories for the Home session list.","parameters":[{"name":"timeframe","in":"query","required":false,"description":"Window of user activity to return. Defaults to last-6-months.","schema":{"type":"string","enum":["last-month","last-3-months","last-6-months"]}},{"name":"limit","in":"query","required":false,"description":"Maximum number of results to return. Defaults to 500 and is capped at 1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":500}}],"responses":{"200":{"description":"Recent user sessions","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"displayName":{"type":"string"},"customName":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPublic":{"type":"boolean"},"agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"type":"string","const":"agent_review"},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstCommitAuthorUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"lastActivityAt":{"type":"string"},"checkpointCount":{"type":"number"},"stepCount":{"type":"number"},"inputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"outputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"cacheCreationTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"cacheReadTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionAgentLines":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanAdded":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanModified":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanRemoved":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionTotalCommitted":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionCalculatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"repo_full_name":{"type":"string"},"is_private":{"type":"boolean"}},"required":["sessionId","displayName","customName","isPublic","agent","model","kind","prompt","firstCommitAuthorUsername","startedAt","lastActivityAt","checkpointCount","stepCount","inputTokens","outputTokens","cacheCreationTokens","cacheReadTokens","attributionAgentLines","attributionHumanAdded","attributionHumanModified","attributionHumanRemoved","attributionTotalCommitted","attributionCalculatedAt","repo_full_name","is_private"]}},"timeframe":{"type":"string"},"updated_at":{"type":"string"}},"required":["sessions","timeframe","updated_at"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/cache/{provider}/{org}/{repo}/commits":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoCommits","tags":["Commits"],"summary":"List repository commits","description":"Returns one cursor or offset page of commits for a repository branch.","parameters":[{"name":"branch","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["github"]}},{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"until","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Commit list","content":{"application/json":{"schema":{"type":"object","properties":{"commits":{"type":"array","items":{"type":"object","properties":{"commitSha":{"type":"string"},"commitMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitSubject":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitAuthorUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"additions":{"anyOf":[{"type":"number"},{"type":"null"}]},"deletions":{"anyOf":[{"type":"number"},{"type":"null"}]},"filesChanged":{"anyOf":[{"type":"number"},{"type":"null"}]},"statsPending":{"type":"boolean"},"parentSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"filesTouched":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"fileStats":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"status":{"type":"string","enum":["added","removed","modified","renamed","copied","changed","unchanged"]},"additions":{"type":"number"},"deletions":{"type":"number"},"patch":{"anyOf":[{"type":"string"},{"type":"null"}]},"patchTruncated":{"type":"boolean"}},"required":["filename","status","additions","deletions"]}},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkpoints":{"type":"array","items":{"type":"object","properties":{"commitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitSubject":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitAuthorUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"additions":{"anyOf":[{"type":"number"},{"type":"null"}]},"deletions":{"anyOf":[{"type":"number"},{"type":"null"}]},"filesChanged":{"anyOf":[{"type":"number"},{"type":"null"}]},"fileStats":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"status":{"type":"string","enum":["added","removed","modified","renamed","copied","changed","unchanged"]},"additions":{"type":"number"},"deletions":{"type":"number"},"patch":{"anyOf":[{"type":"string"},{"type":"null"}]},"patchTruncated":{"type":"boolean"}},"required":["filename","status","additions","deletions"]}},{"type":"null"}]},"filesTouched":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"checkpointId":{"type":"string"},"createdAt":{"type":"string"},"sessions":{"type":"array","items":{"type":"object","properties":{"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"prompt_redacted":{"type":"boolean"},"displayName":{"type":"string"},"agent":{"type":"string"},"steps":{"type":"number"},"kind":{"anyOf":[{"type":"string","const":"agent_review"},{"type":"null"}]},"sessionId":{"type":"string"},"model":{"type":"string"}},"required":["prompt","agent","steps"]}},"sessionCount":{"type":"number"},"totalSteps":{"type":"number"},"agents":{"type":"array","items":{"type":"string"}},"inputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"outputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"attribution":{"anyOf":[{"type":"object","properties":{"calculatedAt":{"type":"string"},"agentLines":{"type":"number"},"humanAdded":{"type":"number"},"humanModified":{"type":"number"},"humanRemoved":{"type":"number"},"totalCommitted":{"type":"number"},"agentPercentage":{"type":"number"}},"required":["calculatedAt","agentLines","humanAdded","humanModified","humanRemoved","totalCommitted","agentPercentage"]},{"type":"null"}]},"checkpointRepoFullName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["commitSha","commitMessage","commitSubject","commitBody","commitAuthor","commitAuthorUsername","commitDate","additions","deletions","filesChanged","fileStats","filesTouched","checkpointId","sessions","sessionCount","totalSteps","agents","inputTokens","outputTokens","attribution","checkpointRepoFullName"]}}},"required":["commitSha","commitMessage","commitSubject","commitBody","commitAuthor","commitAuthorUsername","commitDate","additions","deletions","filesChanged","filesTouched","fileStats","url","checkpoints"]}},"repo_full_name":{"type":"string"},"updated_at":{"type":"string"},"from_cache":{"type":"boolean"},"app_has_access":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"session_branch_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"history_status":{"anyOf":[{"type":"string","enum":["pending","syncing","complete","error"]},{"type":"null"}]},"history_complete":{"type":"boolean"},"history_pages_fetched":{"type":"number"},"has_more":{"type":"boolean"},"next_offset":{"anyOf":[{"type":"number"},{"type":"null"}]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["commits","repo_full_name","updated_at","from_cache","app_has_access","session_branch_exists"]}}}},"404":{"description":"Repository or branch not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Repository service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/cache/{provider}/{org}/{repo}/branches":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoBranches","tags":["Commits"],"summary":"List repository branches","responses":{"200":{"description":"Repository branches","content":{"application/json":{"schema":{"type":"object","properties":{"branches":{"type":"array","items":{"type":"string"}},"default_branch":{"type":"string"},"stored_default_branch":{"type":"string"},"from_cache":{"type":"boolean"}},"required":["branches","default_branch","stored_default_branch","from_cache"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Repository service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/checkpoint-status":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoCheckpointStatus","tags":["Commits"],"summary":"Get repository checkpoint status","responses":{"200":{"description":"Checkpoint status","content":{"application/json":{"schema":{"type":"object","properties":{"app_has_access":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"session_branch_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"checkpoint_count":{"type":"number"},"checkpoint_branch_state":{"type":"string","enum":["unknown","present","absent","inaccessible"]},"checkpoint_repo_full_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewer_can_see_checkpoint_data":{"type":"boolean"}},"required":["app_has_access","session_branch_exists","checkpoint_count"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Repository service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/sessions":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoSessions","tags":["Sessions"],"summary":"List sessions for a repo","description":"Returns the authoritative session list for a repo from entire-api.","parameters":[{"name":"scope","in":"query","required":false,"description":"Set to \"all\" to include every historically linked session, including sessions from branches that were later deleted or rewritten. Cannot be combined with branch, base, or head.","schema":{"type":"string","enum":["all"]}},{"name":"branch","in":"query","required":false,"description":"Restrict to sessions whose contributing commits are reachable from this branch. When both scope and branch are omitted, the repo's default branch is used.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Case-insensitive literal substring over effective session name, prompt, and agent.","schema":{"type":"string"}},{"name":"authorFacet","in":"query","required":false,"description":"Match any author facet key. Multiple values are comma-separated.","schema":{"type":"string"}},{"name":"authorFacetNot","in":"query","required":false,"description":"Exclude author facet keys. Multiple values are comma-separated.","schema":{"type":"string"}},{"name":"agent","in":"query","required":false,"description":"Match any agent. Multiple values are comma-separated.","schema":{"type":"string"}},{"name":"agentNot","in":"query","required":false,"description":"Exclude agents. Multiple values are comma-separated.","schema":{"type":"string"}},{"name":"model","in":"query","required":false,"description":"Match any model. Multiple values are comma-separated.","schema":{"type":"string"}},{"name":"modelNot","in":"query","required":false,"description":"Exclude models. Multiple values are comma-separated.","schema":{"type":"string"}},{"name":"isReview","in":"query","required":false,"description":"Include only Review sessions when true, or exclude Review sessions when false.","schema":{"type":"boolean"}},{"name":"includeFacets","in":"query","required":false,"description":"Include complete scoped author, agent, and model choices on the first page.","schema":{"type":"boolean"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page's `next_cursor`.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, defaults to 50, capped at 200.","schema":{"type":"integer","minimum":1,"maximum":200}},{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Sessions list","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"displayName":{"type":"string"},"customName":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPublic":{"type":"boolean"},"agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"type":"string","const":"agent_review"},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstCommitAuthorUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"lastActivityAt":{"type":"string"},"checkpointCount":{"type":"number"},"stepCount":{"type":"number"},"inputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"outputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"cacheCreationTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"cacheReadTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionAgentLines":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanAdded":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanModified":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanRemoved":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionTotalCommitted":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionCalculatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["sessionId","displayName","customName","isPublic","agent","model","kind","prompt","firstCommitAuthorUsername","startedAt","lastActivityAt","checkpointCount","stepCount","inputTokens","outputTokens","cacheCreationTokens","cacheReadTokens","attributionAgentLines","attributionHumanAdded","attributionHumanModified","attributionHumanRemoved","attributionTotalCommitted","attributionCalculatedAt"]}},"facets":{"type":"object","properties":{"authors":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"agents":{"type":"array","items":{"type":"string"}},"models":{"type":"array","items":{"type":"string"}}},"required":["authors","agents","models"]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"repo_full_name":{"type":"string"},"app_has_access":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"session_branch_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"history_status":{"anyOf":[{"type":"string","enum":["pending","syncing","complete","error"]},{"type":"null"}]},"history_complete":{"type":"boolean"},"source":{"type":"string","const":"db"}},"required":["sessions","next_cursor","repo_full_name","app_has_access","session_branch_exists","history_status","history_complete","source"]}}}},"400":{"description":"Invalid branch or cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Checkpoint repo access denied — the source repo is public but its checkpoints live in a separate private repo the caller can't read.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/cache/{provider}/{org}/{repo}/session/{sessionId}/display-name":{"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoSessionBySessionIdDisplayName","tags":["Sessions"],"summary":"Update a session display name","description":"Sets a custom display name for a session. Requires the authenticated viewer to be allowed to manage the selected repository.","responses":{"200":{"description":"Updated display name","content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"}},"required":["displayName"]}}}},"400":{"description":"Invalid request body or session ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"GitHub token missing or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Caller is not a repo admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository or session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["displayName"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/permissions":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoPermissions","tags":["Repo Settings"],"summary":"Viewer's runtime GitHub admin permission on a repo","description":"Returns whether the authenticated user has `permissions.admin` on the repo, per GitHub. Used by the repo Settings page to decide whether to enable admin-only controls. Returns `{ canAdmin: false }` if the viewer has no GitHub token or the GitHub call fails transiently.","responses":{"200":{"description":"Viewer's permission result","content":{"application/json":{"schema":{"type":"object","properties":{"canAdmin":{"type":"boolean"}},"required":["canAdmin"]}}}},"401":{"description":"GitHub token expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/settings/public-sharing":{"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoSettingsPublicSharing","tags":["Repo Settings"],"summary":"Toggle repo-level public sharing","description":"Updates whether members may share sessions publicly. Requires the caller to be allowed to manage the selected repository.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"New setting value","content":{"application/json":{"schema":{"type":"object","properties":{"public_sharing_enabled":{"type":"boolean"}},"required":["public_sharing_enabled"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"GitHub token missing or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Caller is not a repo admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to update setting","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/settings/runner-settings":{"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoSettingsRunnerSettings","tags":["Repo Settings"],"summary":"Update repo runner settings","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"runners_enabled":{"type":"boolean"},"auto_run_on_push":{"type":"boolean"}}}}}},"responses":{"200":{"description":"New settings values","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"runners_enabled":{"type":"boolean"},"auto_run_on_push":{"type":"boolean"}},"required":["runners_enabled","auto_run_on_push"]}},"required":["settings"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/settings/trail-settings":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoSettingsTrailSettings","tags":["Repo Settings"],"summary":"Get repo Trail settings","responses":{"200":{"description":"Current Trail settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"trails_enabled":{"type":"boolean"}},"required":["trails_enabled"]}},"required":["settings"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Trail settings unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]},"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoSettingsTrailSettings","tags":["Repo Settings"],"summary":"Update repo trail settings","description":"Updates the entire-api Trail enablement setting. Requires the caller to have the trails feature flag and access to the repo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["trails_enabled"],"properties":{"trails_enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"New settings values","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"trails_enabled":{"type":"boolean"}},"required":["trails_enabled"]}},"required":["settings"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to update settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/gates":{"get":{"operationId":"getApiV1CacheByProviderByOrgByRepoGates","tags":["Repo Settings"],"summary":"List repository gate definitions","responses":{"200":{"description":"Gate definitions","content":{"application/json":{"schema":{"type":"object","properties":{"gates_enabled":{"type":"boolean"},"gates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"repo_id":{"type":"string"},"scope_type":{"type":"string"},"scope_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"enabled":{"type":"boolean"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","repo_id","scope_type","scope_id","gate_key","gate_type","blocking","enabled","config","created_by","updated_by","created_at","updated_at"]}},"bypass_policy":{"type":"string","enum":["nobody","admins","admins_author"]},"auto_merge_policy":{"type":"string","enum":["disabled","all_gates_pass"]},"forge_check_run_enabled":{"type":"boolean"}},"required":["gates_enabled","gates","bypass_policy","auto_merge_policy","forge_check_run_enabled"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/gates/enablement":{"put":{"operationId":"putApiV1CacheByProviderByOrgByRepoGatesEnablement","tags":["Repo Settings"],"summary":"Toggle repository gates enablement","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"New enablement state","content":{"application/json":{"schema":{"type":"object","properties":{"gates_enabled":{"type":"boolean"}},"required":["gates_enabled"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/gates/{id}":{"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoGatesById","tags":["Repo Settings"],"summary":"Update a repository gate definition","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blocking":{"type":"boolean"},"enabled":{"type":"boolean"},"config":{"type":"object","nullable":true}}}}}},"responses":{"200":{"description":"Updated gate","content":{"application/json":{"schema":{"type":"object","properties":{"gate":{"type":"object","properties":{"id":{"type":"string"},"repo_id":{"type":"string"},"scope_type":{"type":"string"},"scope_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"enabled":{"type":"boolean"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","repo_id","scope_type","scope_id","gate_key","gate_type","blocking","enabled","config","created_by","updated_by","created_at","updated_at"]}},"required":["gate"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Gate not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/settings/gate-bypass-policy":{"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoSettingsGateBypassPolicy","tags":["Repo Settings"],"summary":"Update the repo gate bypass policy","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["policy"],"properties":{"policy":{"type":"string","enum":["nobody","admins","admins_author"]}}}}}},"responses":{"200":{"description":"New policy","content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"string","enum":["nobody","admins","admins_author"]}},"required":["policy"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/settings/gate-forge-check-run":{"patch":{"operationId":"patchApiV1CacheByProviderByOrgByRepoSettingsGateForgeCheckRun","tags":["Repo Settings"],"summary":"Toggle the gate check run Entire posts on the pull request","description":"Suppresses or restores Entire's gate rollup check run on the GitHub PR. Gate enforcement itself is unaffected either way — this only controls whether the check run is posted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"New setting value","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found, or caller is not a repo admin (folded together)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-api response normalization failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{provider}/{org}/{repo}/session/{sessionId}/share":{"post":{"operationId":"postApiV1CacheByProviderByOrgByRepoSessionBySessionIdShare","tags":["Session Shares"],"summary":"Mark a session publicly viewable","description":"Marks the session publicly viewable without auth (entire-api mints a dedicated share token). Idempotent. Requires repo access and `public_sharing_enabled` on the repo. Public GitHub repos don't need (or accept) this — sessions there are always public. 409 if the repo is public or if `public_sharing_enabled` is off.","responses":{"200":{"description":"Share enabled","content":{"application/json":{"schema":{"type":"object","properties":{"isPublic":{"type":"boolean"},"shareId":{"type":"string"},"cell":{"type":"string"}},"required":["isPublic"]}}}},"400":{"description":"Invalid session ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repo not found or no access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo-level public sharing is disabled, or repo is public","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}]},"delete":{"operationId":"deleteApiV1CacheByProviderByOrgByRepoSessionBySessionIdShare","tags":["Session Shares"],"summary":"Unmark a session as public","description":"Deletes the `session_shares` row. No-op if none exists. Always allowed for repo members, even if repo-level sharing has since been disabled — lets users clean up stale rows.","responses":{"200":{"description":"Share disabled (or no-op)","content":{"application/json":{"schema":{"type":"object","properties":{"isPublic":{"type":"boolean"},"shareId":{"type":"string"},"cell":{"type":"string"}},"required":["isPublic"]}}}},"400":{"description":"Invalid session ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repo not found or no access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}]}},"/api/v1/code-search/symbols":{"get":{"operationId":"getApiV1CodeSearchSymbols","tags":["Code Search"],"summary":"Get symbols for a file from peregrine","description":"Fetches symbols (definitions, references) for a file from peregrine via entire-api. Used by the code viewer symbol panel. Anonymous callers (no session, no bearer) are served for public repos via entire-api's public-repo path; a private or unknown repo yields 404.","responses":{"200":{"description":"Symbols in the file","content":{"application/json":{"schema":{"type":"object","properties":{"symbols":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string"},"role":{"type":"string"},"line":{"type":"number"},"col_start":{"type":"number"},"col_end":{"type":"number"},"parent":{"anyOf":[{"type":"string"},{"type":"null"}]},"signature":{"anyOf":[{"type":"string"},{"type":"null"}]},"usages_count":{"type":"number"},"resolved_to":{"type":"object","properties":{"path":{"type":"string"},"line":{"type":"number"}},"required":["path","line"]}},"required":["name","kind","role","line","col_start","col_end","parent","signature"]}}},"required":["symbols"]}}}},"400":{"description":"Missing repo or path"},"404":{"description":"Repository not found (or not public, for anonymous callers)"},"503":{"description":"Code search not configured"}}}},"/api/v1/code-search/usages":{"get":{"operationId":"getApiV1CodeSearchUsages","tags":["Code Search"],"summary":"Get cross-file usages of a symbol definition","description":"Fetches all usage locations for a definition at a given file/line from peregrine via entire-api. Anonymous callers (no session, no bearer) are served for public repos via entire-api's public-repo path; a private or unknown repo yields 404.","responses":{"200":{"description":"Usage locations for the definition","content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"type":"object","properties":{"path":{"type":"string"},"line":{"type":"number"},"name":{"type":"string"}},"required":["path","line","name"]},"usages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"type":"number"},"col_start":{"type":"number"},"col_end":{"type":"number"},"context":{"type":"string"}},"required":["path","line","col_start","col_end","context"]}},"total_count":{"type":"number"},"truncated":{"type":"boolean"}},"required":["definition","usages","total_count","truncated"]}}}},"400":{"description":"Missing repo, path, or line"},"404":{"description":"Repository not found (or not public, for anonymous callers)"},"503":{"description":"Code search not configured"}}}},"/api/v1/code-search/stream":{"post":{"operationId":"postApiV1CodeSearchStream","tags":["Code Search"],"summary":"Stream cross-jurisdiction code search results (SSE)","description":"Server-sent events. Fans out the search query to peregrine in each cell where the user has repos, streaming results per cell as they arrive. A failing cell emits an error frame; other cells are unaffected.","responses":{"200":{"description":"SSE stream of ready/fill/error/done frames"},"400":{"description":"Invalid request body"},"401":{"description":"Not authenticated"},"502":{"description":"Could not list repos from entire-core"},"503":{"description":"entire-api is not configured"}}}},"/api/v1/search":{"get":{"operationId":"getApiV1Search","tags":["Search"],"summary":"Semantic search via the entire-api gateway (v4)","description":"Proxies semantic search to entire-search through the entire-api gateway, resolving the session cookie to a jurisdictional JWT and repo slugs to storage ULIDs. `repo` may be omitted (cross-repo: all accessible repos) or repeated (multi-repo); both are gated on the semantic-search flag. Response shape matches the shared search results contract.","responses":{"200":{"description":"Search results"},"400":{"description":"Missing q, blank repo, or more than 100 repos; also an invalid search parameter — upstream 4xx validation errors (e.g. an invalid `types` value) are forwarded as-is"},"401":{"description":"Unable to resolve authentication token (re-auth required)"},"403":{"description":"Semantic search (semantic-search) is not enabled for this user"},"404":{"description":"Repo not found or not accessible"},"501":{"description":"Cross-repo/multi-repo search with token auth (pending ENT-1055)"},"502":{"description":"Upstream search error (5xx) or repo could not be resolved"},"503":{"description":"Search or feature-flag service is not configured/available"}}}},"/api/v1/me":{"delete":{"operationId":"deleteApiV1Me","tags":["Me"],"summary":"Schedule deletion of the authenticated user's account (7-day cooldown)","description":"Requests deletion of the calling account at entire-core. This is a soft delete: the account enters a 7-day cooldown, its sessions and tokens are revoked, and a reaper hard-deletes it (cascading its mirrored repos) once the cooldown elapses. Logging back in during the window cancels the deletion. On success the browser session is invalidated and its cookies cleared. Requires a valid session cookie and CSRF token.","responses":{"200":{"description":"Account deletion scheduled","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Blocked: the account owns one or more orgs; resolve them first","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockers":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"message":{"type":"string"}},"required":["kind","id","name","message"]}}},"required":["error","blockers"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/deletion-preview":{"get":{"operationId":"getApiV1MeDeletionPreview","tags":["Me"],"summary":"Preview what deleting the authenticated user's account would do","description":"Proxies entire-core's deletion preview for the calling account: whether deletion is blocked (owned orgs), and the manifest of what would be permanently deleted (personal repos + GitHub mirrors, profile PII) and unlinked (grants, memberships). Read-only; requires a valid session cookie. Nothing is scheduled.","responses":{"200":{"description":"Deletion preview manifest","content":{"application/json":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"},"blockers":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"message":{"type":"string"}},"required":["kind","id","name","message"]}},"willDelete":{"default":{"repos":[],"profileDataNote":""},"type":"object","properties":{"repos":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cluster":{"type":"string"}},"required":["id","name"]}},"profileDataNote":{"default":"","type":"string"}}},"willUnlink":{"default":{"grants":[],"memberships":[]},"type":"object","properties":{"grants":{"default":[],"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string"},"resourceId":{"type":"string"},"resourceName":{"type":"string"},"role":{"type":"string"},"jurisdiction":{"type":"string"}},"required":["resourceType","resourceId","resourceName","role"]}},"memberships":{"default":[],"type":"array","items":{"type":"object","properties":{"orgId":{"type":"string"},"name":{"type":"string"}},"required":["orgId","name"]}}}}},"required":["blocked"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/cancel-deletion":{"post":{"operationId":"postApiV1MeCancelDeletion","tags":["Me"],"summary":"Cancel the authenticated user's pending account deletion","description":"Explicitly cancels a pending deletion at entire-core, restoring full access. Allowed during the 7-day cooldown even though the session is otherwise restricted. Idempotent — succeeds whether or not a deletion was pending. Requires a valid session cookie and CSRF token; the session is left intact.","responses":{"200":{"description":"Pending deletion cancelled (or nothing was pending)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/dispatches":{"post":{"operationId":"postApiV1MeDispatches","tags":["Dispatches"],"summary":"Generate a dispatch (cell-backed)","description":"Forwards to the cell of the jurisdiction named in ?jurisdiction= (default: the caller's home), which resolves the repos locally and persists the run — a dispatch covers repos in exactly one jurisdiction and lives in that cell. May return with generation already complete or failed (200/201), or still in progress (202) — poll GET /me/dispatches/:dispatchId?jurisdiction=<its jurisdiction> by the returned id until the run reaches a terminal status. A 404 names a repo not placed in (or not visible in) that jurisdiction.","parameters":[{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell stores the row (its `jurisdiction` field). Gateway-only — stripped before forwarding. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["since","until","branches"],"properties":{"repos":{"type":"array","items":{"type":"string"}},"since":{"type":"string"},"until":{"type":"string"},"branches":{"type":"array","items":{"type":"string"}},"voice":{"type":"string"}}}}}},"responses":{"200":{"description":"Dispatch generated and persisted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string","enum":["generating","complete","failed"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"type":"array","items":{"type":"string"}},"coveredRepoUlids":{"type":"array","items":{"type":"string"}},"coveredRepoGithubIds":{"type":"array","items":{"type":"number"}},"branches":{"type":"array","items":{"type":"string"}},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"normalizedSince":{"type":"string"},"normalizedUntil":{"type":"string"},"firstCheckpointCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckpointCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["normalizedSince","normalizedUntil","firstCheckpointCreatedAt","lastCheckpointCreatedAt"]},"totals":{"type":"object","properties":{"checkpoints":{"type":"number"},"usedCheckpointCount":{"type":"number"},"branches":{"type":"number"},"filesTouched":{"type":"number"}},"required":["checkpoints","usedCheckpointCount","branches","filesTouched"]},"repos":{"type":"array","items":{"type":"object","properties":{"fullName":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"bullets":{"type":"array","items":{"type":"object","properties":{"checkpointId":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["cloud_analysis","local_summary","commit_message"]},"branch":{"type":"string"},"createdAt":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}}},"required":["checkpointId","text","source","branch","createdAt","labels"]}}},"required":["label","bullets"]}}},"required":["fullName","sections"]}},"generatedMarkdown":{"type":"string"},"isPersisted":{"type":"boolean"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","branches","voice","window","totals","repos","generatedMarkdown","isPersisted","errorMessage","createdAt","updatedAt","completedAt"]}}}},"202":{"description":"Dispatch run created; generation is still in progress","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string","enum":["generating","complete","failed"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"type":"array","items":{"type":"string"}},"coveredRepoUlids":{"type":"array","items":{"type":"string"}},"coveredRepoGithubIds":{"type":"array","items":{"type":"number"}},"branches":{"type":"array","items":{"type":"string"}},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"normalizedSince":{"type":"string"},"normalizedUntil":{"type":"string"},"firstCheckpointCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckpointCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["normalizedSince","normalizedUntil","firstCheckpointCreatedAt","lastCheckpointCreatedAt"]},"totals":{"type":"object","properties":{"checkpoints":{"type":"number"},"usedCheckpointCount":{"type":"number"},"branches":{"type":"number"},"filesTouched":{"type":"number"}},"required":["checkpoints","usedCheckpointCount","branches","filesTouched"]},"repos":{"type":"array","items":{"type":"object","properties":{"fullName":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"bullets":{"type":"array","items":{"type":"object","properties":{"checkpointId":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["cloud_analysis","local_summary","commit_message"]},"branch":{"type":"string"},"createdAt":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}}},"required":["checkpointId","text","source","branch","createdAt","labels"]}}},"required":["label","bullets"]}}},"required":["fullName","sections"]}},"generatedMarkdown":{"type":"string"},"isPersisted":{"type":"boolean"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","branches","voice","window","totals","repos","generatedMarkdown","isPersisted","errorMessage","createdAt","updatedAt","completedAt"]}}}},"400":{"description":"Invalid dispatch request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found in the jurisdiction, or inaccessible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured, or generation is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/dispatches/{dispatchId}":{"get":{"operationId":"getApiV1MeDispatchesByDispatchId","tags":["Dispatches"],"summary":"Get a dispatch run","parameters":[{"name":"dispatchId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Dispatch id"},{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell stores the row (its `jurisdiction` field). Gateway-only — stripped before forwarding. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}}],"responses":{"200":{"description":"Dispatch detail","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string","enum":["generating","complete","failed"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"type":"array","items":{"type":"string"}},"coveredRepoUlids":{"type":"array","items":{"type":"string"}},"coveredRepoGithubIds":{"type":"array","items":{"type":"number"}},"branches":{"type":"array","items":{"type":"string"}},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"normalizedSince":{"type":"string"},"normalizedUntil":{"type":"string"},"firstCheckpointCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckpointCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["normalizedSince","normalizedUntil","firstCheckpointCreatedAt","lastCheckpointCreatedAt"]},"totals":{"type":"object","properties":{"checkpoints":{"type":"number"},"usedCheckpointCount":{"type":"number"},"branches":{"type":"number"},"filesTouched":{"type":"number"}},"required":["checkpoints","usedCheckpointCount","branches","filesTouched"]},"repos":{"type":"array","items":{"type":"object","properties":{"fullName":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"bullets":{"type":"array","items":{"type":"object","properties":{"checkpointId":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["cloud_analysis","local_summary","commit_message"]},"branch":{"type":"string"},"createdAt":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}}},"required":["checkpointId","text","source","branch","createdAt","labels"]}}},"required":["label","bullets"]}}},"required":["fullName","sections"]}},"generatedMarkdown":{"type":"string"},"isPersisted":{"type":"boolean"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","branches","voice","window","totals","repos","generatedMarkdown","isPersisted","errorMessage","createdAt","updatedAt","completedAt"]}}}},"404":{"description":"Dispatch not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/dispatch-setups":{"get":{"operationId":"getApiV1MeDispatchSetups","tags":["Dispatches"],"summary":"List dispatch setups","description":"The caller's saved dispatch setups across every jurisdiction, most recently created first, each with up to three of its most recent accessible dispatches. Setups are jurisdiction-scoped, so the gateway asks every jurisdiction's cell and merges; a page is the union of one cell page per jurisdiction — ordering is newest-first WITHIN a page, not across pages — so it can be longer OR shorter than pageSize (entire-api also masks a setup's config to the repos the caller can see and drops a setup whose repos are all gone) without meaning the list is exhausted — page until nextPageToken is null. A jurisdiction whose cell didn't answer is named in unavailableJurisdictions.","parameters":[{"name":"pageSize","in":"query","required":false,"description":"Max rows to return (1-100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"description":"Opaque cursor from a prior response's nextPageToken.","schema":{"type":"string"}}],"responses":{"200":{"description":"Dispatch setups","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPinned":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastDispatchedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"recentDispatches":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoUlids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoGithubIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"windowSince":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voiceBucket":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","windowSince","windowUntil","voice","voiceBucket","createdAt","updatedAt","completedAt"]}},{"type":"null"}]}},"required":["id","name","isPinned","config","lastDispatchedAt","createdAt","updatedAt","recentDispatches"]}},{"type":"null"}]},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]},"unavailableJurisdictions":{"type":"array","items":{"type":"string"}}},"required":["items","nextPageToken"]}}}},"400":{"description":"Invalid page token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/dispatch-setups/{setupId}":{"get":{"operationId":"getApiV1MeDispatchSetupsBySetupId","tags":["Dispatches"],"summary":"Get a dispatch setup","description":"A single dispatch setup, with its most recent accessible dispatches.","parameters":[{"name":"setupId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Dispatch setup id"},{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell stores the row (its `jurisdiction` field). Gateway-only — stripped before forwarding. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}}],"responses":{"200":{"description":"Dispatch setup","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPinned":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastDispatchedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"recentDispatches":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoUlids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoGithubIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"windowSince":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voiceBucket":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","windowSince","windowUntil","voice","voiceBucket","createdAt","updatedAt","completedAt"]}},{"type":"null"}]}},"required":["id","name","isPinned","config","lastDispatchedAt","createdAt","updatedAt","recentDispatches"]}}}},"404":{"description":"Setup not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"patchApiV1MeDispatchSetupsBySetupId","tags":["Dispatches"],"summary":"Rename, pin, or unpin a dispatch setup","parameters":[{"name":"setupId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Dispatch setup id"},{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell stores the row (its `jurisdiction` field). Gateway-only — stripped before forwarding. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New display name (max 120 chars); null clears it."},"isPinned":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated dispatch setup","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPinned":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastDispatchedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"recentDispatches":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoUlids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoGithubIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"windowSince":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voiceBucket":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","windowSince","windowUntil","voice","voiceBucket","createdAt","updatedAt","completedAt"]}},{"type":"null"}]}},"required":["id","name","isPinned","config","lastDispatchedAt","createdAt","updatedAt","recentDispatches"]}}}},"400":{"description":"Invalid patch body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Setup not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteApiV1MeDispatchSetupsBySetupId","tags":["Dispatches"],"summary":"Delete a dispatch setup","description":"Deletes the setup and all of its runs.","parameters":[{"name":"setupId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Dispatch setup id"},{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell stores the row (its `jurisdiction` field). Gateway-only — stripped before forwarding. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}}],"responses":{"204":{"description":"Setup deleted"},"404":{"description":"Setup not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/dispatch-setups/{setupId}/dispatches":{"get":{"operationId":"getApiV1MeDispatchSetupsBySetupIdDispatches","tags":["Dispatches"],"summary":"List a dispatch setup's runs","description":"One setup's past runs, most recently created first, filtered to the ones whose covered repos the caller can still see.","parameters":[{"name":"setupId","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"Dispatch setup id"},{"name":"jurisdiction","in":"query","required":false,"description":"Jurisdiction whose cell stores the row (its `jurisdiction` field). Gateway-only — stripped before forwarding. Omitted: the caller's home jurisdiction.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}},{"name":"pageSize","in":"query","required":false,"description":"Max rows to return (1-100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"description":"Opaque cursor from a prior response's nextPageToken.","schema":{"type":"string"}}],"responses":{"200":{"description":"Dispatch runs","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"setupId":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredRepos":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoUlids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"coveredRepoGithubIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"windowSince":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voiceBucket":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","setupId","status","title","coveredRepos","coveredRepoUlids","coveredRepoGithubIds","windowSince","windowUntil","voice","voiceBucket","createdAt","updatedAt","completedAt"]}},{"type":"null"}]},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","nextPageToken"]}}}},"404":{"description":"Setup not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/commits":{"get":{"operationId":"getApiV1MeCommits","tags":["Me"],"summary":"Recent commits for the authenticated user","description":"Returns the authenticated user's most recent commits within the requested timeframe, each grouped with its associated checkpoints. Backs the commit list on the overview dashboard and is suitable for CLI commit history views.","parameters":[{"name":"timeframe","in":"query","required":false,"description":"Window of commits to return. Defaults to last-6-months.","schema":{"type":"string","enum":["last-month","last-3-months","last-6-months"]}},{"name":"limit","in":"query","required":false,"description":"Max commits to return (1-1000, default 500).","schema":{"type":"integer","minimum":1,"maximum":1000,"default":500}}],"responses":{"200":{"description":"Recent commits with checkpoints","content":{"application/json":{"schema":{"type":"object","properties":{"commits":{"type":"array","items":{"type":"object","properties":{"commit_sha":{"type":"string"},"commit_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_body":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_author_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_date":{"anyOf":[{"type":"string"},{"type":"null"}]},"additions":{"type":"number"},"deletions":{"type":"number"},"files_changed":{"type":"number"},"checkpoints":{"type":"array","items":{"type":"object","properties":{"checkpoint_id":{"type":"string"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"agent":{"type":"string"},"agents":{"type":"array","items":{"type":"string"}},"session_count":{"type":"number"},"total_steps":{"type":"number"}},"required":["checkpoint_id","prompt","agent","agents","session_count","total_steps"]}},"repo_full_name":{"type":"string"},"is_private":{"type":"boolean"}},"required":["commit_sha","commit_message","commit_subject","commit_body","commit_author_username","commit_date","additions","deletions","files_changed","checkpoints","repo_full_name","is_private"]}},"timeframe":{"type":"string"},"updated_at":{"type":"string"}},"required":["commits","timeframe","updated_at"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to fetch commits","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/activity":{"get":{"operationId":"getApiV1MeActivity","tags":["Me"],"summary":"Pre-aggregated activity for the authenticated user","description":"Returns dashboard-ready rollups of the authenticated user's checkpoints: stats (tasks, orchestration, iteration, throughput, continuity, streaks), daily and hourly contributions grouped by agent, and a per-repo breakdown. Charts and the timeframe-scoped `streak` / `current_streak` are computed from checkpoints within `timeframe`, bucketed by `commit_date` in the caller-supplied IANA timezone. `lifetime_streak` / `lifetime_current_streak` reflect the user's activity across the last 365 days regardless of `timeframe`.","parameters":[{"name":"timezone","in":"query","required":true,"description":"IANA timezone identifier (e.g. Europe/Berlin, America/New_York, UTC).","schema":{"type":"string"}},{"name":"timeframe","in":"query","required":false,"description":"Window of activity to aggregate. Defaults to last-6-months.","schema":{"type":"string","enum":["last-month","last-3-months","last-6-months"]}},{"name":"limit","in":"query","required":false,"description":"Max checkpoints to aggregate (1-1000, default 500).","schema":{"type":"integer","minimum":1,"maximum":1000,"default":500}}],"responses":{"200":{"description":"Aggregated activity data","content":{"application/json":{"schema":{"type":"object","properties":{"stats":{"type":"object","properties":{"tasks":{"type":"number"},"orchestration":{"type":"number"},"iteration":{"type":"number"},"throughput":{"type":"number"},"continuity_hours":{"type":"number"},"streak":{"type":"number"},"current_streak":{"type":"number"},"lifetime_streak":{"type":"number"},"lifetime_current_streak":{"type":"number"}},"required":["tasks","orchestration","iteration","throughput","continuity_hours","streak","current_streak","lifetime_streak","lifetime_current_streak"]},"daily_contributions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"agents":{"type":"object","properties":{"claude":{"type":"number"},"gemini":{"type":"number"},"amp":{"type":"number"},"codex":{"type":"number"},"opencode":{"type":"number"},"copilot":{"type":"number"},"pi":{"type":"number"},"cursor":{"type":"number"},"droid":{"type":"number"},"kiro":{"type":"number"},"antigravity":{"type":"number"},"goose":{"type":"number"},"unknown":{"type":"number"}},"required":["claude","gemini","amp","codex","opencode","copilot","pi","cursor","droid","kiro","antigravity","goose","unknown"]}},"required":["date","agents"]}},"hourly_contributions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"hour":{"type":"number"},"agent":{"type":"string","enum":["claude","gemini","amp","codex","opencode","copilot","pi","cursor","droid","kiro","antigravity","goose","unknown"]},"value":{"type":"number"}},"required":["date","hour","agent","value"]}},"repos":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string"},"total":{"type":"number"},"agents":{"type":"object","properties":{"claude":{"type":"number"},"gemini":{"type":"number"},"amp":{"type":"number"},"codex":{"type":"number"},"opencode":{"type":"number"},"copilot":{"type":"number"},"pi":{"type":"number"},"cursor":{"type":"number"},"droid":{"type":"number"},"kiro":{"type":"number"},"antigravity":{"type":"number"},"goose":{"type":"number"},"unknown":{"type":"number"}},"required":["claude","gemini","amp","codex","opencode","copilot","pi","cursor","droid","kiro","antigravity","goose","unknown"]}},"required":["repo","total","agents"]}}},"required":["stats","daily_contributions","hourly_contributions","repos"]}}}},"400":{"description":"Missing or invalid timezone","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to fetch activity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/me/recap":{"get":{"operationId":"getApiV1MeRecap","tags":["Me"],"summary":"Per-agent recap aggregates for the authenticated user","description":"Returns per-agent aggregates (checkpoints, labels, skills, MCP servers, tool-profile mix) for the authenticated user's activity in the requested window. When ?repo=org/name is supplied, each agent row also carries a `contributors` counterpart aggregated across every contributor on the repo — what powers the 'you vs. team' columns in `entire recap`.","parameters":[{"name":"timeframe","in":"query","required":false,"description":"Window of activity to aggregate. Defaults to last-6-months.","schema":{"type":"string","enum":["last-month","last-3-months","last-6-months"]}},{"name":"repo","in":"query","required":false,"description":"Restrict me-side aggregates and enable the contributors side. Format: 'org/name'. Without it, me-side aggregates span every repo the user has checkpoints on and the contributors side is null.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Optional max checkpoints to consider (1-1000). Omit for an uncapped aggregate.","schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"since","in":"query","required":false,"description":"ISO-8601 lower bound for the activity window. When provided together with `until`, takes precedence over `timeframe`. The CLI uses this so its --day / --week / --month ranges line up exactly with the server's aggregation window.","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":false,"description":"ISO-8601 upper bound for the activity window. Must be supplied alongside `since` to override the `timeframe` enum.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Per-agent recap aggregates","content":{"application/json":{"schema":{"type":"object","properties":{"timeframe":{"type":"string"},"repo":{"anyOf":[{"type":"string"},{"type":"null"}]},"repos":{"type":"array","items":{"type":"string"}},"since":{"type":"string"},"until":{"type":"string"},"agents":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"agentId":{"type":"string"},"agentLabel":{"type":"string"},"me":{"type":"object","properties":{"sessions":{"type":"number"},"checkpoints":{"type":"number"},"tokens":{"type":"number"},"transcriptTokens":{"type":"number"},"filesChanged":{"type":"number"},"labels":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"number"}},"required":["label","count"]}},"skills":{"type":"array","items":{"type":"object","properties":{"skill":{"type":"string"},"count":{"type":"number"}},"required":["skill","count"]}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"count":{"type":"number"}},"required":["name","count"]}},"toolMix":{"type":"object","properties":{"shell":{"type":"number"},"fileOps":{"type":"number"},"search":{"type":"number"},"mcp":{"type":"number"},"agent":{"type":"number"},"other":{"type":"number"}},"required":["shell","fileOps","search","mcp","agent","other"]}},"required":["sessions","checkpoints","tokens","transcriptTokens","filesChanged","labels","skills","mcpServers","toolMix"]},"contributors":{"anyOf":[{"type":"object","properties":{"sessions":{"type":"number"},"checkpoints":{"type":"number"},"tokens":{"type":"number"},"transcriptTokens":{"type":"number"},"filesChanged":{"type":"number"},"labels":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"number"}},"required":["label","count"]}},"skills":{"type":"array","items":{"type":"object","properties":{"skill":{"type":"string"},"count":{"type":"number"}},"required":["skill","count"]}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"count":{"type":"number"}},"required":["name","count"]}},"toolMix":{"type":"object","properties":{"shell":{"type":"number"},"fileOps":{"type":"number"},"search":{"type":"number"},"mcp":{"type":"number"},"agent":{"type":"number"},"other":{"type":"number"}},"required":["shell","fileOps","search","mcp","agent","other"]}},"required":["sessions","checkpoints","tokens","transcriptTokens","filesChanged","labels","skills","mcpServers","toolMix"]},{"type":"null"}]}},"required":["agentId","agentLabel","me","contributors"]}},"summary":{"type":"object","properties":{"me":{"type":"object","properties":{"sessions":{"type":"number"},"checkpoints":{"type":"number"},"tokens":{"type":"number"}},"required":["sessions","checkpoints","tokens"]},"team":{"anyOf":[{"type":"object","properties":{"sessions":{"type":"number"},"checkpoints":{"type":"number"},"tokens":{"type":"number"}},"required":["sessions","checkpoints","tokens"]},{"type":"null"}]},"repoCount":{"type":"number"},"activeDays":{"type":"number"},"analysis":{"type":"object","properties":{"complete":{"type":"number"},"pending":{"type":"number"},"failed":{"type":"number"}},"required":["complete","pending","failed"]},"transcripts":{"type":"object","properties":{"me":{"type":"object","properties":{"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"empty":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["failed","pending","empty"]},"team":{"anyOf":[{"type":"object","properties":{"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"empty":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["failed","pending","empty"]},{"type":"null"}]}},"required":["me","team"]}},"required":["me","team","repoCount","activeDays","analysis","transcripts"]},"contributors":{"anyOf":[{"type":"object","properties":{"distinctUsers":{"type":"number"},"totalTokens":{"type":"number"},"totalCheckpoints":{"type":"number"}},"required":["distinctUsers","totalTokens","totalCheckpoints"]},{"type":"null"}]},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"]}},"updated_at":{"type":"string"}},"required":["timeframe","repo","repos","since","until","agents","summary","contributors","daily","updated_at"]}}}},"400":{"description":"Invalid since/until (must be supplied together as ISO-8601, with since < until)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Authenticated user record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to build recap","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/support/submit":{"post":{"operationId":"postApiV1SupportSubmit","tags":["Support"],"summary":"Submit a support request to Plain.com","description":"Upserts a Plain.com customer using the account's server-resolved primary email, then opens a support thread with the description + client-collected metadata and links any attachments. Requires `email_consent` to be true.","responses":{"200":{"description":"Support thread created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"thread_id":{"type":"string"},"attachments_linked":{"type":"boolean"}},"required":["success","thread_id","attachments_linked"]}}}},"400":{"description":"Invalid request body, or no email on file for the account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Support not configured or upstream unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/support/attachments/upload-url":{"post":{"operationId":"postApiV1SupportAttachmentsUploadUrl","tags":["Support"],"summary":"Mint a Plain.com presigned attachment upload URL","description":"Creates a Plain.com attachment owned by the authenticated user's Plain customer and returns a presigned S3 POST URL + form fields; the browser uploads the bytes directly and passes the returned `attachment_id` to /api/v1/support/submit. Limited to 5 MB. Requires `email_consent` to be true.","responses":{"200":{"description":"Presigned upload URL and form fields","content":{"application/json":{"schema":{"type":"object","properties":{"attachment_id":{"type":"string"},"upload_form_url":{"type":"string"},"upload_form_data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]}}},"required":["attachment_id","upload_form_url","upload_form_data"]}}}},"400":{"description":"Invalid request (bad type/size)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Support not configured, no email on file, or upstream unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/repositories/available":{"get":{"operationId":"getApiV1RepositoriesAvailable","tags":["Repositories"],"summary":"Get repositories available for onboarding","description":"Returns the current user's GitHub repository access state.","responses":{"200":{"description":"Available repository access state","content":{"application/json":{"schema":{"type":"object","properties":{"configure_url":{"type":"string"},"clusters":{"type":"array","items":{"type":"object","properties":{"jurisdiction":{"type":"string"},"label":{"type":"string"},"host":{"type":"string"},"publicUrl":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["jurisdiction","label","host","publicUrl","isDefault"]}},"suggested_cluster_host":{"anyOf":[{"type":"string"},{"type":"null"}]},"repos":{"type":"array","items":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"access":{"type":"string","enum":["read","write","admin"]},"status":{"type":"string","enum":["available","mirrored","owner-only"]},"isArchived":{"type":"boolean"},"isPrivate":{"type":"boolean"},"pushedAt":{"type":"string"},"mirroredClusterHosts":{"type":"array","items":{"type":"string"}}},"required":["owner","repo","access","status"]}}},"required":["configure_url","clusters","suggested_cluster_host","repos"]}}}}}}},"/api/v1/repositories/available/mirrors/{owner}/{repo}":{"post":{"operationId":"postApiV1RepositoriesAvailableMirrorsByOwnerByRepo","tags":["Repositories"],"summary":"Create a single onboarding mirror placement","requestBody":{"required":true,"content":{"application/json":{"schema":{"vendor":"zod"}}}},"responses":{"200":{"description":"Mirror placement registered; the clone runs asynchronously and does not block this response","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"clusterHost":{"type":"string"},"mirror_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["processing","ready","failed","suspended"]}},"required":["owner","repo","clusterHost","mirror_id","status"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Core authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Repository cannot be mirrored or region unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Failed to create mirror","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/repositories/{provider}/{org}/{repo}/members":{"get":{"operationId":"getApiV1RepositoriesByProviderByOrgByRepoMembers","tags":["Repositories"],"summary":"List repository members","description":"Resolves the provider-qualified repository and returns one page of its effective collaborators from Core. This endpoint is read-only.","parameters":[{"name":"page_token","in":"query","required":false,"description":"Opaque continuation token returned by the previous page","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Repository members","content":{"application/json":{"schema":{"type":"object","properties":{"repository":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"}},"required":["id","full_name"]},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"handle":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string"}},"required":["id","name","handle","role"]}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["repository","members","next_page_token"]}}}},"400":{"description":"Invalid repository provider or page token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository member list is not accessible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Repository member service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/repos/facets/languages":{"get":{"operationId":"getApiV1ReposFacetsLanguages","tags":["Repositories"],"summary":"List repository language filter values","parameters":[{"in":"query","name":"q","schema":{"type":"string"},"description":"Case-insensitive substring match over facet values."},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"in":"query","name":"pageToken","schema":{"type":"string"},"description":"Opaque cursor from the previous page."}],"responses":{"200":{"description":"One page of distinct repository filter values","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid pagination parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Could not load repository filter values from entire-core","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/repos/facets/owners":{"get":{"operationId":"getApiV1ReposFacetsOwners","tags":["Repositories"],"summary":"List repository owner filter values","parameters":[{"in":"query","name":"q","schema":{"type":"string"},"description":"Case-insensitive substring match over facet values."},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"in":"query","name":"pageToken","schema":{"type":"string"},"description":"Opaque cursor from the previous page."}],"responses":{"200":{"description":"One page of distinct repository filter values","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid pagination parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Could not load repository filter values from entire-core","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/repos":{"get":{"operationId":"getApiV1Repos","tags":["Repositories"],"summary":"List the repo registry (lean, no cell fill)","description":"A JSON passthrough of entire-core's `GET /repos` index: identity, facts, placements, permission, and candidate metadata, keyset-paginated. Unlike `/repos/stream`, this never fans out to cells for content — callers get the registry row set only. Query params `q`, `hasCheckpoints`, `org`, and `sort` forward to core's fact filters/sort; `pageToken`/`pageSize` (core's own default when omitted, max 100) drive pagination; `scope` defaults to `onboarded`.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"hasCheckpoints","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"org","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["onboarded","all"]}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"One page of the repo registry","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"visibility":{"type":"string"},"provider":{"type":"string","enum":["github","entire"]},"org":{"type":"string"},"placements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"cell":{"type":"string"},"clusterSlug":{"type":"string"},"mirror":{"type":"boolean"},"status":{"type":"string","enum":["processing","ready","failed","suspended"]}},"required":["id","jurisdiction","cell","clusterSlug","mirror","status"]}},"candidate":{"type":"object","properties":{"access":{"type":"string","enum":["read","write","admin"]},"onboardable":{"type":"boolean"}},"required":["access","onboardable"]}},"required":["name","full_name","visibility"],"additionalProperties":{}}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid pageSize, sort spec, or pageToken cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated, or entire-core rejected the login JWT","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"entire-core denied access to this scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Could not list repos from entire-core","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/repos/resolve":{"get":{"operationId":"getApiV1ReposResolve","tags":["Repositories"],"summary":"Resolve exact repositories","description":"Resolves provider-qualified repository names to routing and activation state without listing all repositories.","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"fullName","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The repository resolution","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["github","entire"]},"requestedFullName":{"type":"string"},"fullName":{"type":"string"},"status":{"type":"string","enum":["ready","processing","no-mirror","unavailable"]},"repoId":{"type":"string"},"placements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"cell":{"type":"string"},"clusterSlug":{"type":"string"},"mirror":{"type":"boolean"},"role":{"type":"string","enum":["primary","native_mirror"]},"status":{"type":"string","enum":["processing","ready","failed","suspended"]}},"required":["id","jurisdiction","cell","clusterSlug","mirror","role","status"],"additionalProperties":{}}},"candidate":{"type":"object","properties":{"access":{"type":"string","enum":["read","write","admin"]},"onboardable":{"type":"boolean"}},"required":["access","onboardable"]}},"required":["provider","requestedFullName","status"],"additionalProperties":{}}}}},"400":{"description":"Invalid repository reference","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Could not resolve repositories","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/repos/stream":{"get":{"operationId":"getApiV1ReposStream","tags":["Repositories"],"summary":"Stream the jurisdiction-federated repo list (SSE)","description":"Server-sent events. Auto-pages the full core repository index, emitting a `page` skeleton frame per core page (plus a rollout-compatible `ready` frame for the first page), `fill`/`error` frames as each page's cell batches settle, then `done` after the complete set is hydrated.","responses":{"200":{"description":"SSE stream of page/fill/error/done frames","content":{"text/event-stream":{"schema":{"type":"string"}}}},"401":{"description":"Not authenticated"},"502":{"description":"Could not list repos from entire-core"},"503":{"description":"entire-api is not configured"}}}},"/api/v1/repos/status":{"get":{"operationId":"getApiV1ReposStatus","tags":["Repositories"],"summary":"Current status (and content once ready) for specific repos","description":"Given `?repos=owner/repo,owner2/repo2`, returns each repo's current placement status from entire-core, plus the cell content for any repo that has reached `ready` — so the client can fill a still-cloning mirror the moment it settles, without re-streaming the whole list.","responses":{"200":{"description":"Per-repo status (and content for ready repos)"},"400":{"description":"Too many repositories requested"},"401":{"description":"Not authenticated"},"502":{"description":"Could not list repos from entire-core"},"503":{"description":"entire-api is not configured"}}}},"/api/v1/entire/mirrors":{"get":{"operationId":"getApiV1EntireMirrors","tags":["Entire"],"summary":"List the authenticated user's entire mirrors","description":"Lists entire-core mirror placements for the user. With `?owner=`, scopes to that single GitHub owner. Without it, returns every mirror entire-core reports the caller as affiliated with (reader or writer grant), across all owners and jurisdictions — that set is computed from the caller's identity, not from the Entire app's GitHub installations, so it may include owners the installation list does not.","parameters":[{"name":"owner","in":"query","required":false,"description":"Restrict the listing to a single GitHub owner (user or org login).","schema":{"type":"string"}}],"responses":{"200":{"description":"The user's mirrors","content":{"application/json":{"schema":{"type":"object","properties":{"mirrors":{"type":"array","items":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"clusterHost":{"type":"string"},"cell":{"type":"string"},"jurisdiction":{"type":"string"},"status":{"type":"string","enum":["processing","ready","failed","suspended"]},"repoId":{"type":"string"}},"required":["owner","repo","clusterHost","repoId"]}}},"required":["mirrors"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to list mirrors","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/topology":{"get":{"operationId":"getApiV1EntireTopology","tags":["Entire"],"summary":"Get entire topology","description":"Gets entire-core's jurisdiction → region → cluster topology. Cluster leaves carry `host`, which can be passed verbatim as `clusterHost` when creating mirrors.","responses":{"200":{"description":"Entire topology","content":{"application/json":{"schema":{"type":"object","properties":{"jurisdictions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"regions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"clusters":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"label":{"type":"string"},"host":{"type":"string"},"publicUrl":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["slug","label","host","publicUrl","isDefault"]}}},"required":["id","label","clusters"]}}},"required":["id","label","regions"]}}},"required":["jurisdictions"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/repos/{repoId}/visibility":{"get":{"operationId":"getApiV1EntireReposByRepoIdVisibility","tags":["Entire","Repo Settings"],"summary":"Get a repository's authoritative visibility","description":"Returns the authenticated viewer's exact repository visibility from entire-core.","responses":{"200":{"description":"Repository visibility","content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["public","private"]}},"required":["visibility"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"repoId","required":true}]}},"/api/v1/entire/ci-webhooks/gh/{owner}/{repo}":{"get":{"operationId":"getApiV1EntireCiWebhooksGhByOwnerByRepo","tags":["Entire"],"summary":"List a repo's CI webhooks","description":"Lists the Buildkite CI-webhook subscriptions for a mirrored repo. Requires the caller to have repo#list on the repo (enforced by entire-core).","responses":{"200":{"description":"The repo's CI-webhook subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"repo_id":{"type":"string"},"provider":{"type":"string"},"bk_organization":{"type":"string"},"bk_pipeline":{"type":"string"},"ref_filter":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"display_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","repo_id","provider","bk_organization","bk_pipeline","ref_filter","events","enabled","display_name","created_at","updated_at"]}}},"required":["subscriptions"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]},"post":{"operationId":"postApiV1EntireCiWebhooksGhByOwnerByRepo","tags":["Entire"],"summary":"Enroll a repo into a CI webhook","description":"Enrolls a repo so its ref pushes trigger a CI run. The body is the one the providers listing described — provider, mode, and the fields it published — and `config` is forwarded unread to the provider's adapter. The at-rest dispatch credential is never accepted here: it comes from an org-level credential the org connected. A self-managed enrolment answers with `setup`, the configuration to paste into the provider, already rendered. Requires repo#manage_ci.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"type":"string","minLength":1},"mode":{"type":"string"},"provider_account":{"type":"string"},"target_ref":{"type":"string"},"config":{"type":"object","additionalProperties":{"type":"string"}},"ref_filter":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"display_name":{"type":"string"}}}}}},"responses":{"201":{"description":"The created (or existing) subscription, plus any next step to show","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"repo_id":{"type":"string"},"provider":{"type":"string"},"bk_organization":{"type":"string"},"bk_pipeline":{"type":"string"},"ref_filter":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"display_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"automation_id":{"type":"string"},"core_url":{"type":"string"},"auth_plugin_ref":{"type":"string"},"setup":{"type":"object","properties":{"heading":{"type":"string"},"format":{"type":"string"},"content":{"type":"string"}},"required":["heading","format","content"]}},"required":["id","repo_id","provider","bk_organization","bk_pipeline","ref_filter","events","enabled","display_name","created_at","updated_at"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not permitted to manage CI on this repo","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/entire/ci-webhooks/gh/{owner}/{repo}/audit":{"get":{"operationId":"getApiV1EntireCiWebhooksGhByOwnerByRepoAudit","tags":["Entire"],"summary":"Show who last enabled or disabled each of a repo's CI webhooks","description":"Who last toggled each CI-webhook subscription on or off, keyed by subscription id, reduced from entire-core's audit log. Degrades to an empty map (never an error) when entire-core lacks or refuses the read.","responses":{"200":{"description":"The repo's CI-webhook audit trail","content":{"application/json":{"schema":{"type":"object","properties":{"attributions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"handle":{"type":"string"},"at":{"type":"string"},"enabled":{"type":"boolean"}},"required":["handle","at","enabled"]}}},"required":["attributions"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/entire/ci-webhooks/gh/{owner}/{repo}/builds":{"get":{"operationId":"getApiV1EntireCiWebhooksGhByOwnerByRepoBuilds","tags":["Entire"],"summary":"List a repo's recent Buildkite builds","description":"Lists a mirrored repo's recent Buildkite builds and their steps, newest first. Optional `commit` / `pipeline` filters and a `limit` (core clamps 1–200). Requires repo#list or repo#manage_ci on the repo (enforced by entire-core). Buildkite stays the place to read logs — this answers 'did it run, did it pass'.","parameters":[{"name":"commit","in":"query","required":false,"description":"Restrict to builds of a single commit SHA.","schema":{"type":"string"}},{"name":"pipeline","in":"query","required":false,"description":"Restrict to a single Buildkite pipeline slug.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max builds to return; core clamps to 1–200 (default 50).","schema":{"type":"integer"}},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"The repo's recent builds","content":{"application/json":{"schema":{"type":"object","properties":{"builds":{"type":"array","items":{"type":"object","properties":{"bk_build_uuid":{"type":"string"},"bk_organization":{"type":"string"},"bk_pipeline":{"type":"string"},"build_number":{"type":"number"},"state":{"type":"string"},"commit":{"type":"string"},"branch":{"type":"string"},"message":{"type":"string"},"web_url":{"type":"string"},"created_at":{"type":"string"},"started_at":{"type":"string"},"finished_at":{"type":"string"},"event_at":{"type":"string"},"last_event":{"type":"string"},"stale":{"type":"boolean"},"terminal":{"type":"boolean"},"updated_at":{"type":"string"},"jobs":{"type":"array","items":{"type":"object","properties":{"bk_job_id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"step_key":{"type":"string"},"state":{"type":"string"},"exit_status":{"type":"number"},"started_at":{"type":"string"},"finished_at":{"type":"string"}},"required":["bk_job_id","type","name","step_key","state"]}}},"required":["bk_build_uuid","bk_organization","bk_pipeline","build_number","state","commit","branch","message","web_url","event_at","last_event","stale","terminal","updated_at","jobs"]}}},"required":["builds"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/ci-webhooks/gh/{owner}/{repo}/providers":{"get":{"operationId":"getApiV1EntireCiWebhooksGhByOwnerByRepoProviders","tags":["Entire"],"summary":"Describe the enrolment form for every CI provider","description":"Returns each CI provider's enrolment form as data: its modes, its fields, and the select options drawn from this repo's owning org's connected credentials and registered clusters. The browser renders what it is handed and posts it back, so no CI vendor is named in the frontend. A provider the org cannot enrol into yet comes back enrollable=false with a reason. Requires repo#manage_ci.","responses":{"200":{"description":"One descriptor per provider","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"enrollable":{"type":"boolean"},"reason":{"type":"string"},"modes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"help":{"type":"string"},"default":{"type":"boolean"}},"required":["key","label"]}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"target":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"help":{"type":"string"},"placeholder":{"type":"string"},"required_in":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}}},"required":["key","target","kind","label","required_in"]}}},"required":["name","label","enrollable","modes","fields"]}}},"required":["providers"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not permitted to manage CI on this repo","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/entire/ci-webhooks/gh/{owner}/{repo}/{id}":{"patch":{"operationId":"patchApiV1EntireCiWebhooksGhByOwnerByRepoById","tags":["Entire"],"summary":"Update a repo's CI webhook","description":"Updates mutable fields on a subscription (enable/disable, ref filter, events, display name). Requires repo#manage_ci.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"properties":{"enabled":{"type":"boolean"},"publish_checks":{"type":"boolean"},"ref_filter":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"display_name":{"type":"string"}}}}}},"responses":{"200":{"description":"The updated subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"repo_id":{"type":"string"},"provider":{"type":"string"},"bk_organization":{"type":"string"},"bk_pipeline":{"type":"string"},"ref_filter":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"display_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","repo_id","provider","bk_organization","bk_pipeline","ref_filter","events","enabled","display_name","created_at","updated_at"]}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not permitted to manage CI on this repo","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"delete":{"operationId":"deleteApiV1EntireCiWebhooksGhByOwnerByRepoById","tags":["Entire"],"summary":"Delete a repo's CI webhook","description":"Removes a subscription so the repo's pushes no longer trigger a build. The Buildkite pipeline itself is kept. Requires repo#manage_ci.","responses":{"204":{"description":"Deleted"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not permitted to manage CI on this repo","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repo is not mirrored to Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/v1/entire/repos/{owner}/{repo}/data-residency":{"get":{"operationId":"getApiV1EntireReposByOwnerByRepoDataResidency","tags":["Entire"],"summary":"Get repository data residency","responses":{"200":{"description":"Repository data residency and selectable regions","content":{"application/json":{"schema":{"type":"object","properties":{"mirrored":{"type":"boolean"},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"regions":{"type":"array","items":{"type":"string"}},"processingRegions":{"type":"array","items":{"type":"string"}},"failedRegions":{"type":"array","items":{"type":"string"}},"suspendedRegions":{"type":"array","items":{"type":"string"}},"placements":{"type":"array","items":{"type":"object","properties":{"region":{"type":"string"},"mirrorId":{"type":"string"},"status":{"type":"string","enum":["processing","ready","failed","suspended","unknown"]},"cell":{"type":"string"},"cellLabel":{"type":"string"}},"required":["region","mirrorId","status"]}},"options":{"type":"array","items":{"type":"object","properties":{"region":{"type":"string"},"label":{"type":"string"},"cells":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["id","label","isDefault"]}}},"required":["region","label","cells"]}},"suggestedRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"suggestedCell":{"anyOf":[{"type":"string"},{"type":"null"}]},"warning":{"type":"string"},"warningKind":{"type":"string","enum":["mirror_failed"]}},"required":["mirrored","region","regions","placements","options"]}}}},"401":{"description":"Core authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to load data residency","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/entire/repos/{owner}/{repo}/mirrors":{"post":{"operationId":"postApiV1EntireReposByOwnerByRepoMirrors","tags":["Entire"],"summary":"Create a repository mirror in a region","requestBody":{"required":true,"content":{"application/json":{"schema":{"vendor":"zod"}}}},"responses":{"200":{"description":"Mirror placement registered; the clone runs asynchronously — poll data residency for readiness","content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"string"},"cell":{"type":"string"},"mirrorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["processing","suspended"]}},"required":["region","cell","mirrorId","status"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Core authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repo admin required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Mirror placement conflicts with existing state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Selected region is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to create mirror","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/entire/repos/{owner}/{repo}/mirrors/{region}":{"delete":{"operationId":"deleteApiV1EntireReposByOwnerByRepoMirrorsByRegion","tags":["Entire"],"summary":"Delete a repository mirror in a region","parameters":[{"name":"cell","in":"query","required":false,"description":"Remove the placement in this cell. Omit it to remove the region's placements that report no cell — not every placement in the region. Removing a whole jurisdiction is one call per placement.","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"region","required":true}],"responses":{"200":{"description":"Mirror placement deleted (or already absent)","content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"string"},"cell":{"type":"string"}},"required":["region"]}}}},"401":{"description":"Core authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repo admin required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Deleting the last active mirror is not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to delete mirror","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-core upstream error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/access/orgs":{"get":{"operationId":"listOrganizationAccess","tags":["Management"],"summary":"List accessible organizations and permissions","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Organization access page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}},"required":["resourceId","permissions"]}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/access/orgs/{orgId}":{"get":{"operationId":"getOrganizationPermissions","tags":["Management"],"summary":"Get organization permissions","responses":{"200":{"description":"Organization permissions","content":{"application/json":{"schema":{"type":"object","properties":{"resourceId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}},"required":["resourceId","permissions"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}]}},"/api/v1/entire/orgs":{"get":{"operationId":"listOrganizations","tags":["Management"],"summary":"List organizations","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Organization page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","region","createdAt"]}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createOrganization","tags":["Management"],"summary":"Create an organization","responses":{"201":{"description":"Created organization","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","region","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"region":{"type":"string","minLength":1}},"required":["name"]}}}}}},"/api/v1/entire/orgs/{orgId}":{"get":{"operationId":"getOrganization","tags":["Management"],"summary":"Get an organization","responses":{"200":{"description":"Organization","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","region","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}]},"delete":{"operationId":"deleteOrganization","tags":["Management"],"summary":"Delete an organization","responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}]}},"/api/v1/entire/orgs/{orgId}/members":{"get":{"operationId":"listOrganizationMembers","tags":["Management"],"summary":"List organization members","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Member page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"orgId":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"provider":{"type":"string"},"handle":{"type":"string"}},"required":["id","accountId","orgId","role","status","createdAt"],"additionalProperties":{}}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"addOrganizationMember","tags":["Management"],"summary":"Add an organization member","responses":{"201":{"description":"Created membership","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"orgId":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"provider":{"type":"string"},"handle":{"type":"string"}},"required":["id","accountId","orgId","role","status","createdAt"],"additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","minLength":1},"handle":{"type":"string","minLength":1},"role":{"type":"string","enum":["owner","admin","member"]}},"required":["provider","handle","role"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}]}},"/api/v1/entire/orgs/{orgId}/members/{provider}/{handle}":{"delete":{"operationId":"removeOrganizationMember","tags":["Management"],"summary":"Remove an organization member","responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"handle","required":true}]}},"/api/v1/entire/orgs/{orgId}/projects":{"get":{"operationId":"listOrganizationProjects","tags":["Management"],"summary":"List organization projects","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Project page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","ownerId","ownerType","region","createdAt"]}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/access/projects/{projectId}":{"get":{"operationId":"getProjectPermissions","tags":["Management"],"summary":"Get project permissions","responses":{"200":{"description":"Project permissions","content":{"application/json":{"schema":{"type":"object","properties":{"resourceId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["manage","write","read","create_repo"]}}},"required":["resourceId","permissions"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/v1/entire/projects":{"get":{"operationId":"listProjects","tags":["Management"],"summary":"List accessible projects","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Project page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","ownerId","ownerType","region","createdAt"]}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createProject","tags":["Management"],"summary":"Create a project","responses":{"201":{"description":"Created project","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","ownerId","ownerType","region","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"ownerId":{"type":"string","minLength":1},"ownerType":{"type":"string","enum":["org","account"]},"region":{"type":"string","minLength":1}},"required":["name","ownerId","ownerType"]}}}}}},"/api/v1/entire/projects/{projectId}":{"get":{"operationId":"getProject","tags":["Management"],"summary":"Get a project","responses":{"200":{"description":"Project","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","ownerId","ownerType","region","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]},"delete":{"operationId":"deleteProject","tags":["Management"],"summary":"Delete a project","responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/v1/entire/projects/{projectId}/members":{"get":{"operationId":"listProjectAccess","tags":["Management"],"summary":"List project access","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}],"responses":{"200":{"description":"Project access page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"granteeId":{"type":"string"},"granteeType":{"type":"string"},"granteeName":{"type":"string"},"role":{"type":"string"},"source":{"type":"string"}},"required":["granteeId","granteeType","role","source"],"additionalProperties":{}}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/entire/projects/{projectId}/grants":{"post":{"operationId":"grantProjectAccess","tags":["Management"],"summary":"Grant project access","responses":{"201":{"description":"Grant created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","minLength":1},"handle":{"type":"string","minLength":1},"role":{"type":"string","enum":["reader","writer","admin"]}},"required":["provider","handle","role"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/v1/entire/projects/{projectId}/grants/{granteeType}/{granteeId}":{"delete":{"operationId":"revokeProjectAccess","tags":["Management"],"summary":"Revoke project access","responses":{"204":{"description":"Revoked"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"path","name":"granteeType","required":true},{"schema":{"type":"string"},"in":"path","name":"granteeId","required":true}]}},"/api/v1/entire/projects/{projectId}/repos":{"get":{"operationId":"listProjectRepositories","tags":["Management"],"summary":"List project repositories","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}],"responses":{"200":{"description":"Repository page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string","enum":["github","entire"]},"fullName":{"type":"string"},"reference":{"type":"object","properties":{"provider":{"type":"string","enum":["gh","et"]},"owner":{"type":"string"},"repo":{"type":"string"}},"required":["provider","owner","repo"]},"jurisdiction":{"type":"string"},"state":{"type":"string","enum":["provisioning","active","failed"]},"visibility":{"type":"string","enum":["public","private"]}},"required":["id","name","provider"]}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createProjectRepository","tags":["Management"],"summary":"Create a project repository","responses":{"201":{"description":"Created repository","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string","enum":["github","entire"]},"fullName":{"type":"string"},"reference":{"type":"object","properties":{"provider":{"type":"string","enum":["gh","et"]},"owner":{"type":"string"},"repo":{"type":"string"}},"required":["provider","owner","repo"]},"jurisdiction":{"type":"string"},"state":{"type":"string","enum":["provisioning","active","failed"]},"visibility":{"type":"string","enum":["public","private"]}},"required":["id","name","provider"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Entire Core request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Entire Core is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"clusterHost":{"type":"string","minLength":1}},"required":["name","clusterHost"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/v1/trails/{trail_id}/reviews/{id}/diff":{"get":{"operationId":"getApiV1TrailsByTrailIdReviewsByIdDiff","tags":["CodeReview"],"summary":"Diff of the code reviewed by this review","description":"Uses the code_version pinned to the review, then reads its immutable comparison from the repository's authoritative entire-api cell. Returns per-file change status, additions/deletions, and patch hunks.","responses":{"200":{"description":"Per-file diff","headers":{"Cache-Control":{"description":"private, max-age=86400, immutable","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"code_version_id":{"type":"string"},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"previous_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"additions":{"type":"number"},"deletions":{"type":"number"},"patch":{"anyOf":[{"type":"string"},{"type":"null"}]},"patch_truncated":{"type":"boolean"}},"required":["path","previous_path","status","additions","deletions","patch","patch_truncated"]}}},"required":["code_version_id","base_sha","head_sha","files"]}}}},"404":{"description":"code_version not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"409":{"description":"code_version is missing base_sha or head_sha","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"503":{"description":"Authoritative review diff is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/v1/trails/{trail_id}/reviews/{id}/files":{"get":{"operationId":"getApiV1TrailsByTrailIdReviewsByIdFiles","tags":["CodeReview"],"summary":"File contents for the code reviewed by this review","description":"Uses the code_version pinned to the review, then reads files from the repository's authoritative entire-api cell. Returns a map from path to file content (or null when missing). Comma-separated paths in the `paths` query parameter, up to 200 per call.","parameters":[{"name":"paths","in":"query","required":true,"description":"Comma-separated file paths to read at the code_version head SHA.","schema":{"type":"string","minLength":1}},{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Path → content map","headers":{"Cache-Control":{"description":"private, max-age=86400, immutable","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"code_version_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"files":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"required":["code_version_id","head_sha","files"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"code_version not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"409":{"description":"code_version is missing head_sha","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"503":{"description":"Authoritative review files are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{trail_id}/reviews/{id}/comments/{comment_id}":{"get":{"operationId":"getApiV1TrailsByTrailIdReviewsByIdCommentsByCommentId","tags":["CodeReview"],"summary":"Get a review comment","responses":{"200":{"description":"Review comment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"comment_id","required":true}]}},"/api/v1/trails/{trail_id}/reviews/{id}/comments":{"get":{"operationId":"getApiV1TrailsByTrailIdReviewsByIdComments","tags":["CodeReview"],"summary":"List comments for a review","description":"Paginated. Filters: status, severity, stale. Returns has_more + next_offset.","parameters":[{"name":"status","in":"query","required":false,"description":"Comma-separated statuses.","schema":{"type":"string"}},{"name":"severity","in":"query","required":false,"description":"Comma-separated severities.","schema":{"type":"string"}},{"name":"stale","in":"query","required":false,"schema":{"type":"string","enum":["current","stale","any"]}},{"name":"include_dismissed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Paginated review comments","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location"]}},"has_more":{"type":"boolean"},"next_offset":{"anyOf":[{"type":"number"},{"type":"null"}]},"event_cursor":{"type":"string"}},"required":["comments","has_more","next_offset","event_cursor"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/reviews/comments":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberReviewsComments","tags":["CodeReview"],"summary":"List review comments by repository and trail number","description":"Paginated. Filters: status, severity, stale, review_id. Returns has_more + next_offset.","parameters":[{"name":"status","in":"query","required":false,"description":"Comma-separated statuses.","schema":{"type":"string"}},{"name":"severity","in":"query","required":false,"description":"Comma-separated severities.","schema":{"type":"string"}},{"name":"stale","in":"query","required":false,"schema":{"type":"string","enum":["current","stale","any"]}},{"name":"review_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"include_dismissed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"Paginated review comments","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location"]}},"has_more":{"type":"boolean"},"next_offset":{"anyOf":[{"type":"number"},{"type":"null"}]},"event_cursor":{"type":"string"}},"required":["comments","has_more","next_offset","event_cursor"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{trail_id}/reviews/comments":{"get":{"operationId":"getApiV1TrailsByTrailIdReviewsComments","tags":["CodeReview"],"summary":"List review comments","description":"Paginated. Filters: status, severity, stale, review_id. Returns has_more + next_offset.","parameters":[{"name":"status","in":"query","required":false,"description":"Comma-separated statuses.","schema":{"type":"string"}},{"name":"severity","in":"query","required":false,"description":"Comma-separated severities.","schema":{"type":"string"}},{"name":"stale","in":"query","required":false,"schema":{"type":"string","enum":["current","stale","any"]}},{"name":"review_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"include_dismissed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true}],"responses":{"200":{"description":"Paginated review comments","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location"]}},"has_more":{"type":"boolean"},"next_offset":{"anyOf":[{"type":"number"},{"type":"null"}]},"event_cursor":{"type":"string"}},"required":["comments","has_more","next_offset","event_cursor"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{trail_id}/watchers":{"get":{"operationId":"getApiV1TrailsByTrailIdWatchers","tags":["Trails"],"summary":"List live watchers on a trail","responses":{"200":{"description":"Live trail watchers","content":{"application/json":{"schema":{"type":"object","properties":{"watchers":{"type":"array","items":{"type":"string"}}},"required":["watchers"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"503":{"description":"Trail watch not configured"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true}]}},"/api/v1/repos/{repo_id}/watchers":{"get":{"operationId":"getApiV1ReposByRepoIdWatchers","tags":["Trails"],"summary":"List live watchers for all trails in a repository","responses":{"200":{"description":"Repo-wide live watchers keyed by trail id","content":{"application/json":{"schema":{"type":"object","properties":{"trails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["trails"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"503":{"description":"Trail watch not configured"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"repo_id","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/events":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberEvents","tags":["Trails"],"summary":"List or stream trail events by repository and trail number","parameters":[{"name":"type","in":"query","required":false,"description":"Comma-separated event category filter: runner, monitor, or finding.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"Last-Event-ID","in":"header","required":false,"description":"SSE resume cursor.","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"JSON event page or SSE stream","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"review_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor_id":{"type":"string"},"event_type":{"type":"string"},"target_type":{"type":"string"},"target_id":{"type":"string"},"payload":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","trail_id","review_id","actor_id","event_type","target_type","target_id","payload","created_at"]}}},"required":["events"]}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{trail_id}/events":{"get":{"operationId":"getApiV1TrailsByTrailIdEvents","tags":["Trails"],"summary":"List or stream trail events","parameters":[{"name":"trail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"Comma-separated event category filter: runner, monitor, or finding.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"Last-Event-ID","in":"header","required":false,"description":"SSE resume cursor.","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON event page or SSE stream","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"review_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor_id":{"type":"string"},"event_type":{"type":"string"},"target_type":{"type":"string"},"target_id":{"type":"string"},"payload":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","trail_id","review_id","actor_id","event_type","target_type","target_id","payload","created_at"]}}},"required":["events"]}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}},"404":{"description":"Not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{trail_id}/reviews/{id}":{"get":{"operationId":"getApiV1TrailsByTrailIdReviewsById","tags":["CodeReview"],"summary":"Get review state","description":"Returns the review, code_version, review-scoped counts, and a cursor-paginated page of comments with inlined suggested changes, link/thread summaries. Includes event_cursor for SSE resume.","parameters":[{"name":"include_dismissed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"stale","in":"query","required":false,"schema":{"type":"string","enum":["current","stale","any"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"trail_id","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Review state","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"type":"string"}},"required":["id","trail_id","code_version_id","actor_id","summary","started_at"]},"code_version":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"base_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"captured_at":{"type":"string"}},"required":["id","trail_id","repository_id","base_ref","head_ref","base_sha","head_sha","captured_at"]},"counts":{"type":"object","properties":{"open":{"type":"number"},"resolved":{"type":"number"},"dismissed":{"type":"number"},"stale":{"type":"number"},"total":{"type":"number"}},"required":["open","resolved","dismissed","stale","total"]},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"thread_message_count":{"type":"number"},"suggested_changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"change_type":{"type":"string","enum":["unified_diff","file_replacement","json_patch","manual_instruction"]},"patch":{"anyOf":[{"type":"string"},{"type":"null"}]},"instruction":{"anyOf":[{"type":"string"},{"type":"null"}]},"expected_file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"expected_file_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"expected_start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"expected_end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"expected_lines":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","review_comment_id","code_version_id","change_type","patch","instruction","expected_file_path","expected_file_hash","expected_start_line","expected_end_line","expected_lines","created_by","created_at","updated_at"]}},"outgoing_links":{"type":"array","items":{"type":"object","properties":{"source_comment_id":{"type":"string"},"target_comment_id":{"type":"string"},"link_type":{"type":"string","enum":["duplicate_of","supersedes","related_to"]}},"required":["source_comment_id","target_comment_id","link_type"]}}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location","thread_id","thread_message_count","suggested_changes","outgoing_links"]}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"event_cursor":{"type":"string"}},"required":["review","code_version","counts","comments","next_cursor","event_cursor"]}}}},"404":{"description":"Review not found or caller lacks trail access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/reviews":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberReviews","tags":["CodeReview"],"summary":"Start a review by repository and Trail number","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Native entire-api review request.","properties":{"headSha":{"type":["string","null"],"pattern":"^[a-fA-F0-9]{40}$"},"baseSha":{"type":["string","null"],"pattern":"^[a-fA-F0-9]{40}$"},"baseRef":{"type":["string","null"]},"headRef":{"type":["string","null"]}}}}}},"responses":{"201":{"description":"Review started","content":{"application/json":{"schema":{"type":"object","properties":{"reviewId":{"type":"string"},"trailId":{"type":"string"},"repositoryId":{"type":"string"},"codeVersionId":{"type":"string"},"baseSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"headSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventStreamUrl":{"type":"string"},"diffUrl":{"type":"string"},"filesUrl":{"type":"string"},"limits":{"type":"object","properties":{"maxCommentsPerBatch":{"type":"number"}},"required":["maxCommentsPerBatch"]}},"required":["reviewId","trailId","repositoryId","codeVersionId","baseSha","headSha","eventStreamUrl","diffUrl","filesUrl","limits"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/reviews/{id}/comments":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberReviewsByIdComments","tags":["CodeReview"],"summary":"Post review comments by repository and Trail number","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["comments"],"properties":{"comments":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["clientId","location"],"properties":{"clientId":{"type":"string","minLength":1,"maxLength":255},"body":{"type":["string","null"]},"severity":{"type":["string","null"],"enum":["high","medium","low",null]},"confidence":{"type":["number","null"],"minimum":0,"maximum":1},"status":{"type":"string","enum":["open","resolved","dismissed"]},"statusReason":{"type":["string","null"]},"location":{"type":"object","required":["granularity"],"properties":{"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"filePath":{"type":["string","null"]},"startLine":{"type":["integer","null"],"minimum":1},"startColumn":{"type":["integer","null"],"minimum":1},"endLine":{"type":["integer","null"],"minimum":1},"endColumn":{"type":["integer","null"],"minimum":1},"selectedText":{"type":["string","null"]},"nearbyText":{"type":["string","null"]},"language":{"type":["string","null"]}}}}}}}}}}},"responses":{"200":{"description":"Review comments published","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"results":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string"},"status":{"type":"string","enum":["created","existing","error"]},"comment":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"suggestedChange":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"anyOf":[{"type":"string"},{"type":"null"}]},"retryable":{"type":"boolean"}},"required":["code","message","field","retryable"]}},"required":["clientId","status"]}}},"required":["review","results"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/attachments/{id}/{variant}":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoAttachmentsByIdByVariant","tags":["Trails"],"summary":"Serve a trail attachment image variant (public)","responses":{"200":{"description":"Transformed and re-encoded image bytes"},"302":{"description":"Development-only redirect to a cell attachment's original"},"401":{"description":"The supplied browser session is invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Attachment not found / soft-deleted / bad variant","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Image transform unavailable (fail-closed; never raw bytes)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Cell attachment service returned an invalid response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Cell attachment routing is not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"variant","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepo","tags":["Trails"],"summary":"List trails for a repository","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"status_not","in":"query","required":false,"schema":{"type":"string"}},{"name":"priority","in":"query","required":false,"schema":{"type":"string"}},{"name":"priority_not","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string"}},{"name":"type_not","in":"query","required":false,"schema":{"type":"string"}},{"name":"author","in":"query","required":false,"schema":{"type":"string"}},{"name":"author_not","in":"query","required":false,"schema":{"type":"string"}},{"name":"author_account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"author_account_id_not","in":"query","required":false,"schema":{"type":"string"}},{"name":"assignee","in":"query","required":false,"schema":{"type":"string"}},{"name":"assignee_not","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Trail list","content":{"application/json":{"schema":{"type":"object","properties":{"trails":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stable trail id. Use as :trail_id for trail-scoped review APIs."},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Per-repo sequential identifier. Prefer this for URLs."},"url":{"type":"string","description":"Canonical browser URL for the trail."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"type":"string"},"title":{"type":"string"},"body_document":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"document_key":{"type":"string"},"schema_version":{"type":"number"},"content_json":{},"text_snapshot":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["id","document_key","schema_version","content_json","text_snapshot","updated_at"]},{"type":"null"}]},"status":{"type":"string","enum":["draft","open","merged","closed"]},"type":{"type":"string","enum":["bug","feature","task"]},"phase":{"anyOf":[{"type":"string","enum":["planning","building","reviewing"]},{"type":"null"}],"description":"Phase of an `open` trail: `planning` initially, `building` after code changes, `reviewing` when marked reviewing or when a reviewer is assigned. `null` for draft/merged/closed."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"login":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","login"]},{"type":"null"}]},"assignees":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"merged_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"merge_base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"reviewers":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"},"status":{"type":"string","enum":["approved","changes_requested","pending"]}},"required":["login","status"]}},"requested_reviewers":{"type":"array","items":{"type":"string"}},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"monitors":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"polarity":{"anyOf":[{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]},{"type":"null"}]},"trend_delta":{"anyOf":[{"type":"number"},{"type":"null"}]},"evaluating":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"evaluating":{"type":"boolean"},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["percent_value","size_value","boolean_value","rationale","run_id","head_sha","updated_at"]}},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["key","label","value_type","percent_value","size_value","boolean_value","rationale","polarity","run_id","head_sha","updated_at"]}}},"required":["id","number","url","branch","base","title","status","type","phase","author","assignees","created_at","updated_at","merged_at","priority","reviewers","comment_count","unresolved_count"]}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"repo_full_name":{"type":"string"},"default_branch":{"type":"string"},"updated_at":{"type":"string"},"has_app_installation":{"type":"boolean"},"has_more":{"type":"boolean"},"has_write_permission":{"type":"boolean"}},"required":["trails","total","limit","offset","repo_full_name","default_branch","updated_at","has_app_installation","has_more"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepo","tags":["Trails"],"summary":"Create a new trail","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","description":"Trail title"},"body":{"type":"string","description":"Trail description"},"branch_name":{"type":"string","description":"Git branch name to create or attach"},"branch_action":{"type":"string","enum":["create","link"],"description":"How to bind branch_name. 'create' (default) creates the branch at the base tip if it is missing on the remote. 'link' attaches the branch as delivered by the caller and never backfills it at base — use this when the client (e.g. the CLI) has already pushed the branch with its own credentials."},"base":{"type":"string","description":"Base branch (defaults to repo default branch)"},"status":{"type":"string","enum":["draft","open","merged","closed"],"description":"Initial status (defaults to open)"},"assignees":{"type":"array","items":{"type":"string"},"description":"GitHub usernames to set as trail assignees"},"type":{"type":"string","enum":["bug","feature","task"],"description":"Trail type (defaults to task)"},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"description":"Priority level (defaults to none)"}}}}}},"responses":{"201":{"description":"Trail created","content":{"application/json":{"schema":{"type":"object","properties":{"trail":{"type":"object","properties":{"id":{"type":"string","description":"Stable trail id. Use as :trail_id for trail-scoped review APIs."},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Per-repo sequential identifier. Prefer this for URLs."},"url":{"type":"string","description":"Canonical browser URL for the trail."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"type":"string"},"title":{"type":"string"},"body_document":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"document_key":{"type":"string"},"schema_version":{"type":"number"},"content_json":{},"text_snapshot":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["id","document_key","schema_version","content_json","text_snapshot","updated_at"]},{"type":"null"}]},"status":{"type":"string","enum":["draft","open","merged","closed"]},"type":{"type":"string","enum":["bug","feature","task"]},"phase":{"anyOf":[{"type":"string","enum":["planning","building","reviewing"]},{"type":"null"}],"description":"Phase of an `open` trail: `planning` initially, `building` after code changes, `reviewing` when marked reviewing or when a reviewer is assigned. `null` for draft/merged/closed."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"login":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","login"]},{"type":"null"}]},"assignees":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"merged_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"merge_base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"reviewers":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"},"status":{"type":"string","enum":["approved","changes_requested","pending"]}},"required":["login","status"]}},"requested_reviewers":{"type":"array","items":{"type":"string"}},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"monitors":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"polarity":{"anyOf":[{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]},{"type":"null"}]},"trend_delta":{"anyOf":[{"type":"number"},{"type":"null"}]},"evaluating":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"evaluating":{"type":"boolean"},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["percent_value","size_value","boolean_value","rationale","run_id","head_sha","updated_at"]}},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["key","label","value_type","percent_value","size_value","boolean_value","rationale","polarity","run_id","head_sha","updated_at"]}}},"required":["id","number","url","branch","base","title","status","type","phase","author","assignees","created_at","updated_at","merged_at","priority","reviewers","comment_count","unresolved_count"]},"branch_created":{"type":"boolean"}},"required":["trail","branch_created"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"A trail already exists for the requested branch","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/stats":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoStats","tags":["Trails"],"summary":"Trail status counts for a repository","responses":{"200":{"description":"Trail counts grouped by status","content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"type":"number"},"open":{"type":"number"},"merged":{"type":"number"},"closed":{"type":"number"},"total":{"type":"number"}},"required":["draft","open","merged","closed","total"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/linked-branches":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoLinkedBranches","tags":["Trails"],"summary":"Branches already linked to a trail in this repository","responses":{"200":{"description":"Linked branch names","content":{"application/json":{"schema":{"type":"object","properties":{"branches":{"type":"array","items":{"type":"string"}}},"required":["branches"]}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/branch":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberBranch","tags":["Trails"],"summary":"Create or link a branch to a trail","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["create"]},"branch_name":{"type":"string","minLength":1}}},{"type":"object","required":["action","branch_name"],"properties":{"action":{"type":"string","enum":["link"]},"branch_name":{"type":"string","minLength":1}}}]}}}},"responses":{"200":{"description":"Branch linked","content":{"application/json":{"schema":{"type":"object","properties":{"trail":{"type":"object","properties":{"id":{"type":"string","description":"Stable trail id. Use as :trail_id for trail-scoped review APIs."},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Per-repo sequential identifier. Prefer this for URLs."},"url":{"type":"string","description":"Canonical browser URL for the trail."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"type":"string"},"title":{"type":"string"},"body_document":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"document_key":{"type":"string"},"schema_version":{"type":"number"},"content_json":{},"text_snapshot":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["id","document_key","schema_version","content_json","text_snapshot","updated_at"]},{"type":"null"}]},"status":{"type":"string","enum":["draft","open","merged","closed"]},"type":{"type":"string","enum":["bug","feature","task"]},"phase":{"anyOf":[{"type":"string","enum":["planning","building","reviewing"]},{"type":"null"}],"description":"Phase of an `open` trail: `planning` initially, `building` after code changes, `reviewing` when marked reviewing or when a reviewer is assigned. `null` for draft/merged/closed."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"login":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","login"]},{"type":"null"}]},"assignees":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"merged_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"merge_base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"reviewers":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"},"status":{"type":"string","enum":["approved","changes_requested","pending"]}},"required":["login","status"]}},"requested_reviewers":{"type":"array","items":{"type":"string"}},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"monitors":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"polarity":{"anyOf":[{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]},{"type":"null"}]},"trend_delta":{"anyOf":[{"type":"number"},{"type":"null"}]},"evaluating":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"evaluating":{"type":"boolean"},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["percent_value","size_value","boolean_value","rationale","run_id","head_sha","updated_at"]}},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["key","label","value_type","percent_value","size_value","boolean_value","rationale","polarity","run_id","head_sha","updated_at"]}}},"required":["id","number","url","branch","base","title","status","type","phase","author","assignees","created_at","updated_at","merged_at","priority","reviewers","comment_count","unresolved_count"]},"branch_created":{"type":"boolean"}},"required":["trail","branch_created"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Trail already has a linked branch","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/sessions":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberSessions","tags":["Trails","Sessions"],"summary":"List sessions for a trail","description":"Returns sessions attached to checkpoints on the trail's current or historical commit delta. The session data is read from the entire-api repository sessions endpoint.","parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page's next_cursor.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, defaults to 50, capped at 200.","schema":{"type":"integer","minimum":1,"maximum":200}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"Trail sessions","content":{"application/json":{"schema":{"type":"object","properties":{"trail_id":{"type":"string"},"trail_number":{"type":"number"},"repo_full_name":{"type":"string"},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessions":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"displayName":{"type":"string"},"customName":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPublic":{"type":"boolean"},"agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"type":"string","const":"agent_review"},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstCommitAuthorUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"lastActivityAt":{"type":"string"},"checkpointCount":{"type":"number"},"stepCount":{"type":"number"},"inputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"outputTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"cacheCreationTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"cacheReadTokens":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionAgentLines":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanAdded":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanModified":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionHumanRemoved":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionTotalCommitted":{"anyOf":[{"type":"number"},{"type":"null"}]},"attributionCalculatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["sessionId","displayName","customName","isPublic","agent","model","kind","prompt","firstCommitAuthorUsername","startedAt","lastActivityAt","checkpointCount","stepCount"]}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"app_has_access":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"session_branch_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"history_status":{"anyOf":[{"type":"string","enum":["pending","syncing","complete","error"]},{"type":"null"}]},"history_complete":{"type":"boolean"},"source":{"type":"string","enum":["entire-api","none"]},"upstream_source":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["trail_id","trail_number","repo_full_name","branch","sessions","next_cursor","app_has_access","session_branch_exists","history_status","history_complete","source","upstream_source"]}}}},"400":{"description":"Invalid query","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Trail session delta cannot be computed completely","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"501":{"description":"Trail sessions require a browser session for entire-api access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-api could not read the repository history","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumber","tags":["Trails"],"summary":"Get trail detail","responses":{"200":{"description":"Trail detail","content":{"application/json":{"schema":{"type":"object","properties":{"trail":{"type":"object","properties":{"id":{"type":"string","description":"Stable trail id. Use as :trail_id for trail-scoped review APIs."},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Per-repo sequential identifier. Prefer this for URLs."},"url":{"type":"string","description":"Canonical browser URL for the trail."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"type":"string"},"title":{"type":"string"},"body_document":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"document_key":{"type":"string"},"schema_version":{"type":"number"},"content_json":{},"text_snapshot":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["id","document_key","schema_version","content_json","text_snapshot","updated_at"]},{"type":"null"}]},"status":{"type":"string","enum":["draft","open","merged","closed"]},"type":{"type":"string","enum":["bug","feature","task"]},"phase":{"anyOf":[{"type":"string","enum":["planning","building","reviewing"]},{"type":"null"}],"description":"Phase of an `open` trail: `planning` initially, `building` after code changes, `reviewing` when marked reviewing or when a reviewer is assigned. `null` for draft/merged/closed."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"login":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","login"]},{"type":"null"}]},"assignees":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"merged_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"merge_base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"reviewers":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"},"status":{"type":"string","enum":["approved","changes_requested","pending"]}},"required":["login","status"]}},"requested_reviewers":{"type":"array","items":{"type":"string"}},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"monitors":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"polarity":{"anyOf":[{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]},{"type":"null"}]},"trend_delta":{"anyOf":[{"type":"number"},{"type":"null"}]},"evaluating":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"evaluating":{"type":"boolean"},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["percent_value","size_value","boolean_value","rationale","run_id","head_sha","updated_at"]}},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["key","label","value_type","percent_value","size_value","boolean_value","rationale","polarity","run_id","head_sha","updated_at"]}}},"required":["id","number","url","branch","base","title","status","type","phase","author","assignees","created_at","updated_at","merged_at","priority","reviewers","comment_count","unresolved_count"]},"checkpoints":{"type":"array","items":{"type":"object","properties":{"commitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitSubject":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitAuthorUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"additions":{"anyOf":[{"type":"number"},{"type":"null"}]},"deletions":{"anyOf":[{"type":"number"},{"type":"null"}]},"filesChanged":{"anyOf":[{"type":"number"},{"type":"null"}]},"checkpointId":{"type":"string"}},"required":["commitSha","commitMessage","commitSubject","commitBody","commitAuthor","commitAuthorUsername","commitDate","additions","deletions","filesChanged","checkpointId"]}},"has_write_permission":{"type":"boolean"}},"required":["trail","checkpoints"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]},"patch":{"operationId":"patchApiV1TrailsByHostByOwnerByRepoByNumber","tags":["Trails"],"summary":"Update trail metadata","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Send body by itself to update Trail body Markdown; metadata fields cannot be combined with body.","properties":{"branch":{"type":"string","description":"Git branch name"},"base":{"type":"string","description":"Base branch"},"title":{"type":"string","description":"Trail title"},"body":{"type":"string","description":"Trail body Markdown"},"status":{"type":"string","enum":["draft","open","merged","closed"],"description":"Trail status"},"assignees":{"type":"array","items":{"type":"string"},"description":"GitHub usernames to set as trail assignees"},"type":{"type":"string","enum":["bug","feature","task"],"description":"Trail type"},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"description":"Priority level"},"requested_reviewers":{"type":"array","items":{"type":"string"},"description":"GitHub usernames requested to review"}}}}}},"responses":{"200":{"description":"Updated trail","content":{"application/json":{"schema":{"type":"object","properties":{"trail":{"type":"object","properties":{"id":{"type":"string","description":"Stable trail id. Use as :trail_id for trail-scoped review APIs."},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Per-repo sequential identifier. Prefer this for URLs."},"url":{"type":"string","description":"Canonical browser URL for the trail."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"type":"string"},"title":{"type":"string"},"body_document":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"document_key":{"type":"string"},"schema_version":{"type":"number"},"content_json":{},"text_snapshot":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["id","document_key","schema_version","content_json","text_snapshot","updated_at"]},{"type":"null"}]},"status":{"type":"string","enum":["draft","open","merged","closed"]},"type":{"type":"string","enum":["bug","feature","task"]},"phase":{"anyOf":[{"type":"string","enum":["planning","building","reviewing"]},{"type":"null"}],"description":"Phase of an `open` trail: `planning` initially, `building` after code changes, `reviewing` when marked reviewing or when a reviewer is assigned. `null` for draft/merged/closed."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"login":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","login"]},{"type":"null"}]},"assignees":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"merged_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"merge_base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"reviewers":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"},"status":{"type":"string","enum":["approved","changes_requested","pending"]}},"required":["login","status"]}},"requested_reviewers":{"type":"array","items":{"type":"string"}},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"monitors":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"polarity":{"anyOf":[{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]},{"type":"null"}]},"trend_delta":{"anyOf":[{"type":"number"},{"type":"null"}]},"evaluating":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"percent_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"size_value":{"anyOf":[{"type":"string","enum":["small","medium","large"]},{"type":"null"}]},"boolean_value":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"evaluating":{"type":"boolean"},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["percent_value","size_value","boolean_value","rationale","run_id","head_sha","updated_at"]}},"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["key","label","value_type","percent_value","size_value","boolean_value","rationale","polarity","run_id","head_sha","updated_at"]}}},"required":["id","number","url","branch","base","title","status","type","phase","author","assignees","created_at","updated_at","merged_at","priority","reviewers","comment_count","unresolved_count"]}},"required":["trail"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]},"delete":{"operationId":"deleteApiV1TrailsByHostByOwnerByRepoByNumber","tags":["Trails"],"summary":"Delete a trail","responses":{"200":{"description":"Trail deleted","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"branch_cleanup":{"type":"object","properties":{"status":{"type":"string","enum":["deleted","missing","blocked"]},"message":{"type":"string"}},"required":["status"]}},"required":["ok"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/definitions":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberDefinitions","tags":["Trails"],"summary":"Get trail monitor and gate definitions","responses":{"200":{"description":"Trail definitions","content":{"application/json":{"schema":{"type":"object","properties":{"monitor_definitions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"polarity":{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]},"runner_id":{"type":"string"},"display_name":{"type":"string"},"enabled":{"type":"boolean"},"automation_kind":{"type":"string","enum":["trail_prompt","fix_ci","dispatch"]},"runtime_kind":{"type":"string","enum":["prompt_runner","inline","command_runner"]},"trigger_types":{"type":"array","items":{"type":"string"}},"output":{"type":"object","properties":{"adapter":{"type":"string","enum":["json","last_json_line","markdown","score","none"]},"result_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"score_field":{"anyOf":[{"type":"string"},{"type":"null"}]},"trail_field":{"anyOf":[{"type":"string","enum":["body"]},{"type":"null"}]}},"required":["adapter","result_type","score_field","trail_field"]},"monitor":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["percent","size","boolean"]},"polarity":{"type":"string","enum":["higher_is_better","lower_is_better","neutral"]}},"required":["key","label","value_type","polarity"]}},"required":["key","label","value_type","polarity","runner_id","display_name","enabled","automation_kind","runtime_kind","trigger_types","output","monitor"]}},"gate_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"repo_id":{"type":"string"},"scope_type":{"type":"string"},"scope_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"enabled":{"type":"boolean"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","repo_id","scope_type","scope_id","gate_key","gate_type","blocking","enabled","config","created_by","updated_by","created_at","updated_at"]}},"gates_enabled":{"type":"boolean"}},"required":["monitor_definitions","gate_definitions","gates_enabled"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/contributors":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberContributors","tags":["Trails"],"summary":"Get trail contributors","responses":{"200":{"description":"Trail contributors","content":{"application/json":{"schema":{"type":"object","properties":{"contributors":{"type":"array","items":{"type":"string"}}},"required":["contributors"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/discussions":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberDiscussions","tags":["Trails"],"summary":"List trail discussions","responses":{"200":{"description":"Trail discussions","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"discussion":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"discussion"},"review_comment_id":{"type":"null"},"review_comment":{"type":"null"}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]},{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"code_review"},"review_comment_id":{"type":"string"},"review_comment":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"type":"string"},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location","thread_id","thread_message_count"]}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]}]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"}},"required":["id","author","created_at","body"]}}},"required":["id","author","created_at","body","replies"]}}},"required":["discussion","messages"]}},"event_cursor":{"type":"string"}},"required":["items","event_cursor"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]},"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberDiscussions","tags":["Trails"],"summary":"Create a trail discussion","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"title":{"type":"string","maxLength":512},"body":{"type":"string","maxLength":65536}}}}}},"responses":{"201":{"description":"Discussion created","content":{"application/json":{"schema":{"type":"object","properties":{"discussion":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"discussion"},"review_comment_id":{"type":"null"},"review_comment":{"type":"null"}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]},{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"code_review"},"review_comment_id":{"type":"string"},"review_comment":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"type":"string"},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location","thread_id","thread_message_count"]}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]}]},"message":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"}},"required":["id","author","created_at","body"]}}},"required":["id","author","created_at","body","replies"]},{"type":"null"}]}},"required":["discussion","message"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/discussions/stream":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberDiscussionsStream","tags":["Trails"],"summary":"Stream trail discussion events","description":"Server-sent events for one trail's discussions. Event names are storage-level and unchanged: `message`, `message_deleted`, `thread_updated`, `deleted` (plus the initial `ready`). Payload keys are a verbatim pass-through of the stored event.","parameters":[{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"Last-Event-ID","in":"header","required":false,"description":"SSE resume cursor.","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"SSE stream","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/discussions/{discussionId}":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberDiscussionsByDiscussionId","tags":["Trails"],"summary":"Get trail discussion","responses":{"200":{"description":"Discussion detail","content":{"application/json":{"schema":{"type":"object","properties":{"discussion":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"discussion"},"review_comment_id":{"type":"null"},"review_comment":{"type":"null"}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]},{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"code_review"},"review_comment_id":{"type":"string"},"review_comment":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"type":"string"},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location","thread_id","thread_message_count"]}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]}]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"}},"required":["id","author","created_at","body"]}}},"required":["id","author","created_at","body","replies"]}},"event_cursor":{"type":"string"}},"required":["discussion","messages","event_cursor"]}}}},"404":{"description":"Discussion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"discussionId","required":true}]},"patch":{"operationId":"patchApiV1TrailsByHostByOwnerByRepoByNumberDiscussionsByDiscussionId","tags":["Trails"],"summary":"Update trail discussion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":512},"resolved":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Discussion updated","content":{"application/json":{"schema":{"type":"object","properties":{"discussion":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"discussion"},"review_comment_id":{"type":"null"},"review_comment":{"type":"null"}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]},{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"title":{"type":"string"},"resolved":{"type":"boolean"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_author":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_count":{"type":"number"},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"kind":{"type":"string","const":"code_review"},"review_comment_id":{"type":"string"},"review_comment":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repository_id":{"type":"string"},"review_id":{"type":"string"},"code_version_id":{"type":"string"},"actor_id":{"type":"string"},"actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"status_actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_outcome":{"type":"string","enum":["current","stale"]},"stale_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_checked_code_version_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"client_id_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"location":{"type":"object","properties":{"id":{"type":"string"},"review_comment_id":{"type":"string"},"code_version_id":{"type":"string"},"granularity":{"type":"string","enum":["line","range","file","whole_change"]},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"start_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"start_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_line":{"anyOf":[{"type":"number"},{"type":"null"}]},"end_column":{"anyOf":[{"type":"number"},{"type":"null"}]},"selected_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"nearby_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","review_comment_id","code_version_id","granularity","file_path","start_line","start_column","end_line","end_column","selected_text","nearby_text","language"]},"thread_id":{"type":"string"},"thread_message_count":{"type":"number"}},"required":["id","trail_id","repository_id","review_id","code_version_id","actor_id","body","severity","confidence","status","status_reason","stale_outcome","stale_checked_at","stale_checked_code_version_id","client_id","client_id_hash","created_at","updated_at","location","thread_id","thread_message_count"]}},"required":["id","trail_id","title","resolved","resolved_by","resolved_at","created_by","created_at","updated_at","last_message_at","last_message_author","message_count","participants","kind","review_comment_id","review_comment"]}]}},"required":["discussion"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Discussion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"discussionId","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/discussions/{discussionId}/messages":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberDiscussionsByDiscussionIdMessages","tags":["Trails"],"summary":"Add a message to a trail discussion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","maxLength":65536,"description":"Message text"}}}}}},"responses":{"201":{"description":"Message created","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"}},"required":["id","author","created_at","body"]}}},"required":["id","author","created_at","body","replies"]}},"required":["message"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Discussion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"discussionId","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/discussions/{discussionId}/messages/{messageId}":{"patch":{"operationId":"patchApiV1TrailsByHostByOwnerByRepoByNumberDiscussionsByDiscussionIdMessagesByMessageId","tags":["Trails"],"summary":"Edit a trail discussion message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","maxLength":65536,"description":"Updated message text"}}}}}},"responses":{"200":{"description":"Message updated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"created_at":{"type":"string"},"body":{"type":"string"}},"required":["id","author","created_at","body"]}}},"required":["id","author","created_at","body","replies"]}},"required":["message"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Message not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"discussionId","required":true},{"schema":{"type":"string"},"in":"path","name":"messageId","required":true}]},"delete":{"operationId":"deleteApiV1TrailsByHostByOwnerByRepoByNumberDiscussionsByDiscussionIdMessagesByMessageId","tags":["Trails"],"summary":"Delete a trail discussion message","responses":{"200":{"description":"Message deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Message not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"discussionId","required":true},{"schema":{"type":"string"},"in":"path","name":"messageId","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/approvals":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberApprovals","tags":["Trails"],"summary":"Submit an approval decision on a trail","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event"],"properties":{"event":{"type":"string","enum":["APPROVE","REQUEST_CHANGES"],"description":"Approval action"},"body":{"type":"string","description":"Approval comment (required for REQUEST_CHANGES)"}}}}}},"responses":{"200":{"description":"Approval submitted","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"approval":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"event":{"type":"string"},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_sha":{"type":"string"},"created_at":{"type":"string"}},"required":["id","author","event","body","commit_sha","created_at"]},"gates":{"anyOf":[{"type":"object","properties":{"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"gates_enabled":{"type":"boolean"},"gates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"gate_definition_id":{"type":"string"},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","gate_definition_id","gate_key","gate_type","blocking","status","head_sha","value","rationale","created_at","completed_at"]}},"blocking_failures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"gate_definition_id":{"type":"string"},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","gate_definition_id","gate_key","gate_type","blocking","status","head_sha","value","rationale","created_at","completed_at"]}},"mergeable":{"type":"boolean"},"evaluated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["head_sha","gates_enabled","gates","blocking_failures","mergeable","evaluated_at"]},{"type":"null"}]}},"required":["ok","approval","gates"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]},"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberApprovals","tags":["Trails"],"summary":"Get approval decisions for a trail","responses":{"200":{"description":"Trail approval decisions","content":{"application/json":{"schema":{"type":"object","properties":{"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"event":{"type":"string"},"body":{"anyOf":[{"type":"string"},{"type":"null"}]},"commit_sha":{"type":"string"},"created_at":{"type":"string"}},"required":["id","author","event","body","commit_sha","created_at"]}}},"required":["approvals"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/timeline":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberTimeline","tags":["Trails"],"summary":"Get the composed activity timeline for a trail","description":"Server-composed, newest-first activity feed: trail creation, comments, approvals, lifecycle changes, and a live commit/checkpoint overlay.","parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page's next_cursor.","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"Trail timeline events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_created"}},"required":["id","occurred_at","actor","kind"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_status_changed"},"from_status":{"anyOf":[{"type":"string","enum":["draft","open","merged","closed"]},{"type":"null"}]},"to_status":{"type":"string","enum":["draft","open","merged","closed"]}},"required":["id","occurred_at","actor","kind","from_status","to_status"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_priority_changed"},"from_priority":{"anyOf":[{"type":"string","enum":["urgent","high","medium","low","none"]},{"type":"null"}]},"to_priority":{"type":"string","enum":["urgent","high","medium","low","none"]}},"required":["id","occurred_at","actor","kind","from_priority","to_priority"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_type_changed"},"from_type":{"anyOf":[{"type":"string","enum":["bug","feature","task"]},{"type":"null"}]},"to_type":{"type":"string","enum":["bug","feature","task"]}},"required":["id","occurred_at","actor","kind","from_type","to_type"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"assignee_assignment_changed"},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","added","removed"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"reviewer_assignment_changed"},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","added","removed"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_merged"},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","branch","base"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_updated"},"from_branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_branch":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","from_branch","to_branch"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_pushed"},"branch":{"type":"string"},"forced":{"type":"boolean"},"commit_count":{"type":"number"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","branch","forced","commit_count","head_sha"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_title_changed"},"from_title":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_title":{"type":"string"}},"required":["id","occurred_at","actor","kind","from_title","to_title"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_base_changed"},"from_base":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_base":{"type":"string"}},"required":["id","occurred_at","actor","kind","from_base","to_base"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"review_posted"},"finding_count":{"type":"number"}},"required":["id","occurred_at","actor","kind","finding_count"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"finding_resolved"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","comment_id","thread_id"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"finding_dismissed"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","comment_id","thread_id"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"comment"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"is_reply":{"type":"boolean"}},"required":["id","occurred_at","actor","kind","comment_id","thread_id","is_reply"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"approval"},"approval_status":{"type":"string","enum":["approved","changes_requested","pending"]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","approval_status","body"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"commit"},"title":{"type":"string"},"commit_sha":{"type":"string"},"additions":{"anyOf":[{"type":"number"},{"type":"null"}]},"deletions":{"anyOf":[{"type":"number"},{"type":"null"}]},"files_changed":{"anyOf":[{"type":"number"},{"type":"null"}]},"stats_pending":{"type":"boolean"},"checkpoint_count":{"type":"number"},"session_count":{"type":"number"},"agents":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","title","commit_sha","additions","deletions","files_changed","stats_pending","checkpoint_count","session_count","agents"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"gate_bypassed"},"bypassed_gates":{"type":"array","items":{"type":"object","properties":{"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"gate_key":{"type":"string"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["gate_type","gate_key","status","rationale"]}}},"required":["id","occurred_at","actor","kind","bypassed_gates"]}]}},"event_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"incomplete":{"type":"boolean"}},"required":["events","event_cursor","has_more","next_cursor","incomplete"]}}}},"400":{"description":"Invalid or expired cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Cell timeline continuation is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"501":{"description":"Timeline pagination is not supported for API-token callers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/timeline/trail":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberTimelineTrail","tags":["Trails"],"summary":"Get Trail and membership activity","description":"Trail lifecycle, metadata, assignment, and Discussion events.","parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page's next_cursor.","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"Scoped activity events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_created"}},"required":["id","occurred_at","actor","kind"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_status_changed"},"from_status":{"anyOf":[{"type":"string","enum":["draft","open","merged","closed"]},{"type":"null"}]},"to_status":{"type":"string","enum":["draft","open","merged","closed"]}},"required":["id","occurred_at","actor","kind","from_status","to_status"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_priority_changed"},"from_priority":{"anyOf":[{"type":"string","enum":["urgent","high","medium","low","none"]},{"type":"null"}]},"to_priority":{"type":"string","enum":["urgent","high","medium","low","none"]}},"required":["id","occurred_at","actor","kind","from_priority","to_priority"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_type_changed"},"from_type":{"anyOf":[{"type":"string","enum":["bug","feature","task"]},{"type":"null"}]},"to_type":{"type":"string","enum":["bug","feature","task"]}},"required":["id","occurred_at","actor","kind","from_type","to_type"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"assignee_assignment_changed"},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","added","removed"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"reviewer_assignment_changed"},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","added","removed"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_merged"},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","branch","base"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_updated"},"from_branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_branch":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","from_branch","to_branch"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_pushed"},"branch":{"type":"string"},"forced":{"type":"boolean"},"commit_count":{"type":"number"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","branch","forced","commit_count","head_sha"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_title_changed"},"from_title":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_title":{"type":"string"}},"required":["id","occurred_at","actor","kind","from_title","to_title"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_base_changed"},"from_base":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_base":{"type":"string"}},"required":["id","occurred_at","actor","kind","from_base","to_base"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"review_posted"},"finding_count":{"type":"number"}},"required":["id","occurred_at","actor","kind","finding_count"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"finding_resolved"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","comment_id","thread_id"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"finding_dismissed"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","comment_id","thread_id"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"comment"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"is_reply":{"type":"boolean"}},"required":["id","occurred_at","actor","kind","comment_id","thread_id","is_reply"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"approval"},"approval_status":{"type":"string","enum":["approved","changes_requested","pending"]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","approval_status","body"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"commit"},"title":{"type":"string"},"commit_sha":{"type":"string"},"additions":{"anyOf":[{"type":"number"},{"type":"null"}]},"deletions":{"anyOf":[{"type":"number"},{"type":"null"}]},"files_changed":{"anyOf":[{"type":"number"},{"type":"null"}]},"stats_pending":{"type":"boolean"},"checkpoint_count":{"type":"number"},"session_count":{"type":"number"},"agents":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","title","commit_sha","additions","deletions","files_changed","stats_pending","checkpoint_count","session_count","agents"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"gate_bypassed"},"bypassed_gates":{"type":"array","items":{"type":"object","properties":{"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"gate_key":{"type":"string"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["gate_type","gate_key","status","rationale"]}}},"required":["id","occurred_at","actor","kind","bypassed_gates"]}]}},"event_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"incomplete":{"type":"boolean"}},"required":["events","event_cursor","has_more","next_cursor","incomplete"]}}}},"400":{"description":"Invalid or expired cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Cell timeline continuation is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/timeline/change":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberTimelineChange","tags":["Trails"],"summary":"Get Change and revision activity","description":"Change refs, revisions, reviews, findings, gates, and merge events.","parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page's next_cursor.","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"responses":{"200":{"description":"Scoped activity events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_created"}},"required":["id","occurred_at","actor","kind"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_status_changed"},"from_status":{"anyOf":[{"type":"string","enum":["draft","open","merged","closed"]},{"type":"null"}]},"to_status":{"type":"string","enum":["draft","open","merged","closed"]}},"required":["id","occurred_at","actor","kind","from_status","to_status"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_priority_changed"},"from_priority":{"anyOf":[{"type":"string","enum":["urgent","high","medium","low","none"]},{"type":"null"}]},"to_priority":{"type":"string","enum":["urgent","high","medium","low","none"]}},"required":["id","occurred_at","actor","kind","from_priority","to_priority"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_type_changed"},"from_type":{"anyOf":[{"type":"string","enum":["bug","feature","task"]},{"type":"null"}]},"to_type":{"type":"string","enum":["bug","feature","task"]}},"required":["id","occurred_at","actor","kind","from_type","to_type"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"assignee_assignment_changed"},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","added","removed"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"reviewer_assignment_changed"},"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","added","removed"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_merged"},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"base":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","branch","base"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_updated"},"from_branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_branch":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","from_branch","to_branch"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_branch_pushed"},"branch":{"type":"string"},"forced":{"type":"boolean"},"commit_count":{"type":"number"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","branch","forced","commit_count","head_sha"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_title_changed"},"from_title":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_title":{"type":"string"}},"required":["id","occurred_at","actor","kind","from_title","to_title"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"trail_base_changed"},"from_base":{"anyOf":[{"type":"string"},{"type":"null"}]},"to_base":{"type":"string"}},"required":["id","occurred_at","actor","kind","from_base","to_base"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"review_posted"},"finding_count":{"type":"number"}},"required":["id","occurred_at","actor","kind","finding_count"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"finding_resolved"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","comment_id","thread_id"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"finding_dismissed"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","comment_id","thread_id"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"comment"},"comment_id":{"type":"string"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"is_reply":{"type":"boolean"}},"required":["id","occurred_at","actor","kind","comment_id","thread_id","is_reply"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"approval"},"approval_status":{"type":"string","enum":["approved","changes_requested","pending"]},"body":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurred_at","actor","kind","approval_status","body"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"commit"},"title":{"type":"string"},"commit_sha":{"type":"string"},"additions":{"anyOf":[{"type":"number"},{"type":"null"}]},"deletions":{"anyOf":[{"type":"number"},{"type":"null"}]},"files_changed":{"anyOf":[{"type":"number"},{"type":"null"}]},"stats_pending":{"type":"boolean"},"checkpoint_count":{"type":"number"},"session_count":{"type":"number"},"agents":{"type":"array","items":{"type":"string"}}},"required":["id","occurred_at","actor","kind","title","commit_sha","additions","deletions","files_changed","stats_pending","checkpoint_count","session_count","agents"]},{"type":"object","properties":{"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"}},"required":["login"]},{"type":"null"}]},"kind":{"type":"string","const":"gate_bypassed"},"bypassed_gates":{"type":"array","items":{"type":"object","properties":{"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"gate_key":{"type":"string"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["gate_type","gate_key","status","rationale"]}}},"required":["id","occurred_at","actor","kind","bypassed_gates"]}]}},"event_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"incomplete":{"type":"boolean"}},"required":["events","event_cursor","has_more","next_cursor","incomplete"]}}}},"400":{"description":"Invalid or expired cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Cell timeline continuation is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/mergeability":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberMergeability","tags":["Trails"],"summary":"Get merge readiness for a trail","responses":{"200":{"description":"Trail mergeability","content":{"application/json":{"schema":{"type":"object","properties":{"approval_gate_passed":{"type":"boolean"},"checks_passed":{"type":"boolean"},"checks_status":{"type":"string","enum":["success","failure","pending","none"]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"status":{"type":"string"},"conclusion":{"anyOf":[{"type":"string"},{"type":"null"}]},"html_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"app_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"}},"required":["id","name","status","conclusion","html_url","started_at","completed_at","app_name"]}},"behind_by":{"type":"number"},"comparison_status":{"type":"string","enum":["available","unknown"]},"mergeable":{"type":"boolean"},"bypass_policy":{"type":"string","enum":["nobody","admins","admins_author"]}},"required":["approval_gate_passed","checks_passed","checks_status","head_sha","checks","behind_by","comparison_status","mergeable","bypass_policy"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repository has no GitHub App installation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"GitHub App token temporarily unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/gates":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberGates","tags":["Trails"],"summary":"Get the configurable gate evaluation for a trail","responses":{"200":{"description":"Gate evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"gates_enabled":{"type":"boolean"},"gates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"gate_definition_id":{"type":"string"},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","gate_definition_id","gate_key","gate_type","blocking","status","head_sha","value","rationale","created_at","completed_at"]}},"blocking_failures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"gate_definition_id":{"type":"string"},"gate_key":{"type":"string"},"gate_type":{"type":"string","enum":["approvals","findings","checks","up_to_date","eval"]},"blocking":{"type":"boolean"},"status":{"type":"string","enum":["passed","failed","pending","error","skipped"]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","gate_definition_id","gate_key","gate_type","blocking","status","head_sha","value","rationale","created_at","completed_at"]}},"mergeable":{"type":"boolean"},"evaluated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["head_sha","gates_enabled","gates","blocking_failures","mergeable","evaluated_at"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/checks":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberChecks","tags":["Trails"],"summary":"Get CI check status for a trail","responses":{"200":{"description":"Trail checks","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["success","failure","pending","none"]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"total_count":{"type":"number"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"status":{"type":"string"},"conclusion":{"anyOf":[{"type":"string"},{"type":"null"}]},"html_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"app_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"}},"required":["id","name","status","conclusion","html_url","started_at","completed_at","app_name"]}},"required_check_names":{"type":"array","items":{"type":"string"}},"required_checks_complete":{"type":"boolean"},"permission_error":{"type":"string"},"incomplete_error":{"type":"string"},"conflict":{"type":"boolean"},"ci_pr":{"type":"object","properties":{"number":{"anyOf":[{"type":"number"},{"type":"null"}]},"can_create":{"type":"boolean"}},"required":["number","can_create"]},"automation":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["running","completed"]},"outcome":{"type":"string","enum":["succeeded","failed","canceled"]},"run_id":{"type":"string"},"started_at":{"type":"string"},"started_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"pushed_head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","run_id","started_at","started_at_sha"]},{"type":"null"}]},"fix_ci_available":{"type":"boolean"},"checks_expected":{"type":"boolean"}},"required":["state","total_count","checks","automation"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not authorized to read checks","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Checks are temporarily rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to fetch checks","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Checks upstream failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Checks are temporarily unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/ci-pr":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberCiPr","tags":["Trails"],"summary":"Create or link a CI pull request for a trail","responses":{"200":{"description":"CI pull request ready","content":{"application/json":{"schema":{"type":"object","properties":{"pr_number":{"type":"number"}},"required":["pr_number"]}}}},"409":{"description":"Trail is not eligible for a CI pull request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/merge":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberMerge","tags":["Trails"],"summary":"Merge a trail branch","responses":{"200":{"description":"Trail merged","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"merge_commit_sha":{"type":"string"}},"required":["ok","merge_commit_sha"]}}}},"409":{"description":"Branch changed since readiness was checked","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"expected_head_sha":{"type":"string"},"head_sha":{"type":"string"}},"required":["error","expected_head_sha","head_sha"]}}}},"422":{"description":"Merge gate failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"reason":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/update-branch":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberUpdateBranch","tags":["Trails"],"summary":"Update a trail branch with the latest base branch changes","responses":{"200":{"description":"Branch updated (or already up to date)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"merge_commit_sha":{"type":"string"}},"required":["ok","merge_commit_sha"]}}}},"409":{"description":"Branch has merge conflicts with the base branch","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Update gate failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/runs/{runnerId}":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberRunsByRunnerId","tags":["Trails"],"summary":"Trigger a configured trail runner","responses":{"200":{"description":"Trail runner started or reused","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string"},"existing":{"type":"boolean"}},"required":["runId","status","existing"]}}}},"422":{"description":"Trail runner unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"runnerId","required":true}]},"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberRunsByRunnerId","tags":["Trails"],"summary":"Get the latest configured trail runner result","responses":{"200":{"description":"Trail runner result","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"prompt_status":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status","created_at","updated_at","error_message","prompt_status","head_sha"]},{"type":"null"}]},"result":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"adapter":{"type":"string"},"data":{}},"required":["type","adapter","data"]},{"type":"null"}]}},"required":["run","result"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"runnerId","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/review-rerun":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberReviewRerun","tags":["Trails"],"summary":"Re-run the configured review for the current head","responses":{"200":{"description":"Review re-run started or already running","content":{"application/json":{"schema":{"type":"object","properties":{"launched":{"type":"number"}},"required":["launched"]}}}},"422":{"description":"No push-triggered review runner is configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/files":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberFiles","tags":["Trails"],"summary":"Get changed files for a trail","responses":{"200":{"description":"Changed files","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"previousFilename":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["added","removed","modified","renamed","copied","changed","unchanged"]},"additions":{"type":"number"},"deletions":{"type":"number"},"patch":{"anyOf":[{"type":"string"},{"type":"null"}]},"patchTruncated":{"type":"boolean"}},"required":["filename","status","additions","deletions"]}},"additions":{"type":"number"},"deletions":{"type":"number"},"truncated":{"type":"boolean"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["files","additions","deletions","head_sha"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Changed files unavailable through entire-api","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/attachments":{"post":{"operationId":"postApiV1TrailsByHostByOwnerByRepoByNumberAttachments","tags":["Trails"],"summary":"Upload a trail body attachment (JPEG/PNG, max 10 MB)","parameters":[{"name":"filename","in":"query","required":false,"description":"Original filename; sanitized to a basename for the stored object. Defaults to image.png/image.jpg.","schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"description":"Attachment kind. Only \"image\" is supported in v1.","schema":{"type":"string","enum":["image"],"default":"image"}},{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"Attachment created","content":{"application/json":{"schema":{"type":"object","properties":{"attachment":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repo_id":{"type":"string"},"kind":{"type":"string"},"content_type":{"type":"string"},"filename":{"type":"string"},"size_bytes":{"type":"number"},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"deleted_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","trail_id","repo_id","kind","content_type","filename","size_bytes","width","height","created_by_user_id","created_at","deleted_at"]}},"required":["attachment"]}}}},"400":{"description":"Validation error (bad format, too large, unsupported kind)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberAttachments","tags":["Trails"],"summary":"List a trail's attachments","responses":{"200":{"description":"Attachment list","content":{"application/json":{"schema":{"type":"object","properties":{"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trail_id":{"type":"string"},"repo_id":{"type":"string"},"kind":{"type":"string"},"content_type":{"type":"string"},"filename":{"type":"string"},"size_bytes":{"type":"number"},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"},"deleted_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","trail_id","repo_id","kind","content_type","filename","size_bytes","width","height","created_by_user_id","created_at","deleted_at"]}}},"required":["attachments"]}}}},"404":{"description":"Trail not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/attachments/{id}":{"delete":{"operationId":"deleteApiV1TrailsByHostByOwnerByRepoByNumberAttachmentsById","tags":["Trails"],"summary":"Delete a trail attachment","responses":{"204":{"description":"Attachment deleted"},"403":{"description":"Repository membership required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Attachment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/v1/trails/{host}/{owner}/{repo}/{number}/attachments/{id}/download":{"get":{"operationId":"getApiV1TrailsByHostByOwnerByRepoByNumberAttachmentsByIdDownload","tags":["Trails"],"summary":"Serve a trail attachment's original bytes (cell-backed, flag-gated)","description":"NEW, cell-only capability (ENT-1174) — 302s to a short-lived presigned download URL. Not a byte-for-byte-preserved retrofit of any prior local route: 404s unless the caller's trails-cell-reads flag is on.","responses":{"302":{"description":"Redirect to a presigned download URL"},"404":{"description":"Attachment not found, or the trails-cell-reads flag is off for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"host","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true},{"schema":{"type":"string"},"in":"path","name":"number","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/v1/runs/{host}/{owner}/{repo}":{"get":{"operationId":"getApiV1RunsByHostByOwnerByRepo","tags":["Runs"],"summary":"List Runner runs","parameters":[{"name":"host","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Runner runs","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]},"repo_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"repo_full_name":{"type":"string"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"environment_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"snapshot_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"snapshot_source":{"anyOf":[{"type":"string","enum":["base","warm"]},{"type":"null"}]},"status":{"type":"string","enum":["creating","ready","prompting","succeeded","failed","timeout","canceled","deleted"]},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"automation":{"anyOf":[{"type":"string"},{"type":"null"}]},"trail_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"setup_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"runtime_kind":{"type":"string","enum":["sandbox","inline"]},"scope_type":{"type":"string","enum":["repo","no_repo"]},"scope_json":{"anyOf":[{},{"type":"null"}]},"output_config":{"anyOf":[{"type":"object","properties":{"adapter":{"type":"string","enum":["json","last_json_line","markdown","score","none"]},"resultType":{"anyOf":[{"type":"string"},{"type":"null"}]},"scoreField":{"anyOf":[{"type":"string"},{"type":"null"}]},"trailsReviewEnabled":{"type":"boolean"}},"required":["adapter","resultType","scoreField"]},{"type":"null"}]},"execution_config":{"anyOf":[{"type":"object","properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"thinking_effort":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["model","thinking_effort"]},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"trail":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"gh_pr_id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","number","title","status","branch","gh_pr_id"]},{"type":"null"}]},"setup":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"runner_id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"pinned":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","runner_id","name","pinned","created_at","updated_at"]},{"type":"null"}]}},"required":["id","provider","repo_id","repo_full_name","ref","agent","environment_id","session_id","snapshot_name","snapshot_source","status","error_message","automation","trail_id","head_sha","setup_id","runtime_kind","scope_type","scope_json","output_config","execution_config","created_at","updated_at","deleted_at","trail","setup"]}}},"required":["runs"]}}}},"404":{"description":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/runs/{host}/{owner}/{repo}/{runId}":{"get":{"operationId":"getApiV1RunsByHostByOwnerByRepoByRunId","tags":["Runs"],"summary":"Get a Runner run","parameters":[{"name":"host","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Runner run detail","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]},"repo_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"repo_full_name":{"type":"string"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"environment_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"snapshot_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"snapshot_source":{"anyOf":[{"type":"string","enum":["base","warm"]},{"type":"null"}]},"status":{"type":"string","enum":["creating","ready","prompting","succeeded","failed","timeout","canceled","deleted"]},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"automation":{"anyOf":[{"type":"string"},{"type":"null"}]},"trail_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"setup_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"runtime_kind":{"type":"string","enum":["sandbox","inline"]},"scope_type":{"type":"string","enum":["repo","no_repo"]},"scope_json":{"anyOf":[{},{"type":"null"}]},"output_config":{"anyOf":[{"type":"object","properties":{"adapter":{"type":"string","enum":["json","last_json_line","markdown","score","none"]},"resultType":{"anyOf":[{"type":"string"},{"type":"null"}]},"scoreField":{"anyOf":[{"type":"string"},{"type":"null"}]},"trailsReviewEnabled":{"type":"boolean"}},"required":["adapter","resultType","scoreField"]},{"type":"null"}]},"execution_config":{"anyOf":[{"type":"object","properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"thinking_effort":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["model","thinking_effort"]},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"trail":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"branch":{"anyOf":[{"type":"string"},{"type":"null"}]},"gh_pr_id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","number","title","status","branch","gh_pr_id"]},{"type":"null"}]},"setup":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"runner_id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"pinned":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","runner_id","name","pinned","created_at","updated_at"]},{"type":"null"}]}},"required":["id","provider","repo_id","repo_full_name","ref","agent","environment_id","session_id","snapshot_name","snapshot_source","status","error_message","automation","trail_id","head_sha","setup_id","runtime_kind","scope_type","scope_json","output_config","execution_config","created_at","updated_at","deleted_at","trail","setup"]},"latestPrompt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"run_id":{"type":"string"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stop_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"queued_at":{"type":"string"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","run_id","prompt","status","stop_reason","error_message","queued_at","started_at","completed_at"]},{"type":"null"}]},"prompts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"run_id":{"type":"string"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stop_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"queued_at":{"type":"string"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","run_id","prompt","status","stop_reason","error_message","queued_at","started_at","completed_at"]}},"events":{"type":"array","items":{"type":"object","properties":{"event_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_id":{"type":"string"},"prompt_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string","enum":["session","app"]},"event_type":{"type":"string"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"session_event_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"session_event_index":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"connection_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"sender":{"anyOf":[{"type":"string","enum":["client","agent"]},{"type":"null"}]},"payload":{},"created_at":{"type":"string"}},"required":["event_index","run_id","prompt_id","source","event_type","session_id","session_event_id","session_event_index","connection_id","sender","payload","created_at"]}},"automationResult":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"run_id":{"type":"string"},"automation":{"type":"string"},"result_type":{"type":"string"},"data":{},"created_at":{"type":"string"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","run_id","automation","result_type","data","created_at","updated_at"]},{"type":"null"}]},"previewUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"inspectorUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["run","latestPrompt","prompts","events","automationResult","previewUrl","inspectorUrl"]}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteApiV1RunsByHostByOwnerByRepoByRunId","tags":["Runs"],"summary":"Cancel a Runner run","parameters":[{"name":"host","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Runner run canceled, or already settled on its own"},"404":{"description":"Runner run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The run is still being provisioned; cancelling again succeeds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}},"components":{}}