{"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"},"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_by_repo":{"type":"string"}},"required":["update_settings","list","create","detail","update","delete","discussions","discussion","discussion_messages","discussion_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_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":{"anyOf":[{"type":"string"},{"type":"null"}]},"attached_providers":{"type":"array","items":{"type":"string","minLength":1}},"attached_providers_unavailable_reason":{"type":"string","enum":["timeout","upstream","no_session"]},"github_attached_login":{"anyOf":[{"type":"string"},{"type":"null"}]},"github_attached_unavailable_reason":{"type":"string","enum":["timeout","upstream","no_session"]},"provider":{"type":"string"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"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","provider","display_name","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"}]},"provider":{"type":"string","enum":["github","entire"]},"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/{forge}/{org}/{repo}/commits":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoCommits","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":"forge","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/{forge}/{org}/{repo}/branches":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoBranches","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/checkpoint-status":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoCheckpointStatus","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/sessions":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoSessions","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":"forge","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/{forge}/{org}/{repo}/session/{sessionId}/display-name":{"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoSessionBySessionIdDisplayName","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":"forge","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/{forge}/{org}/{repo}/permissions":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoPermissions","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/settings/public-sharing":{"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoSettingsPublicSharing","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/settings/secrets":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoSettingsSecrets","tags":["Repo Settings"],"summary":"List which model provider API keys are configured","description":"Which repository secrets (customer model provider API keys) are configured and when each was last set or rotated — metadata only, never the values. There is no endpoint that returns a stored secret value. Requires the caller to be a repo admin: `permissions.admin` per GitHub for a mirrored repo, or `permission: admin` on the cell's repo record for an Entire-native one.","responses":{"200":{"description":"Configured secrets metadata","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"secretKey":{"type":"string"},"updatedAt":{"type":"string"}},"required":["secretKey","updatedAt"]}},"nextPageToken":{"type":"string"}},"required":["items"]}}}},"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 not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/settings/secrets/{secretKey}":{"put":{"operationId":"putApiV1CacheByForgeByOrgByRepoSettingsSecretsBySecretKey","tags":["Repo Settings"],"summary":"Set or rotate a model provider API key","description":"Stores a repository secret (a customer model provider API key such as `api_key_anthropic` or `api_key_openai`) encrypted at rest in the repo's home cell. Write-only: no endpoint ever returns the stored value — it can only be rotated (by setting it again), deleted, or consumed by the runner runtime. Requires the caller to be a repo admin: `permissions.admin` per GitHub for a mirrored repo, or `permission: admin` on the cell's repo record for an Entire-native one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"type":"string","minLength":1,"maxLength":4096,"description":"The secret value (e.g. an Anthropic or OpenAI API key). Stored encrypted; never returned by any endpoint."}}}}}},"responses":{"204":{"description":"Secret stored"},"400":{"description":"Malformed secret key or 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":"Repository not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"forge","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":"secretKey","required":true}]},"delete":{"operationId":"deleteApiV1CacheByForgeByOrgByRepoSettingsSecretsBySecretKey","tags":["Repo Settings"],"summary":"Delete a model provider API key","description":"Deletes a repository secret from the repo's home cell. The ciphertext and its key live in the same row, so this is ordinary deletion, not crypto-shredding: a database restore from before the delete brings the value back until backups age out. Accepts any well-formed key, not only the ones this build can store, so a key held by a newer deploy can still be cleared. Idempotent. Requires the caller to be a repo admin: `permissions.admin` per GitHub for a mirrored repo, or `permission: admin` on the cell's repo record for an Entire-native one.","responses":{"204":{"description":"Secret deleted (or was not configured)"},"400":{"description":"Malformed secret key","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 not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"entire-api not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"forge","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":"secretKey","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/settings/runner-settings":{"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoSettingsRunnerSettings","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/settings/trail-settings":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoSettingsTrailSettings","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]},"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoSettingsTrailSettings","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/gates":{"get":{"operationId":"getApiV1CacheByForgeByOrgByRepoGates","tags":["Repo Settings"],"summary":"List repository gate definitions","responses":{"200":{"description":"Gate definitions","content":{"application/json":{"schema":{"type":"object","properties":{"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","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/gates/{id}":{"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoGatesById","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":"forge","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/{forge}/{org}/{repo}/settings/gate-bypass-policy":{"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoSettingsGateBypassPolicy","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/settings/gate-forge-check-run":{"patch":{"operationId":"patchApiV1CacheByForgeByOrgByRepoSettingsGateForgeCheckRun","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/cache/{forge}/{org}/{repo}/session/{sessionId}/share":{"post":{"operationId":"postApiV1CacheByForgeByOrgByRepoSessionBySessionIdShare","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":"forge","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":"deleteApiV1CacheByForgeByOrgByRepoSessionBySessionIdShare","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":"forge","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/mirror-requests/{jurisdiction}/{requestId}":{"get":{"operationId":"getApiV1MirrorRequestsByJurisdictionByRequestId","tags":["Mirrors"],"summary":"Get an asynchronous mirror creation request","parameters":[{"name":"jurisdiction","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Mirror creation request","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","processing","succeeded","failed"]},"failure":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"]},"result":{"type":"object","properties":{"mirrorId":{"type":"string"},"mirrorUrl":{"type":"string"},"publicUrl":{"type":"string"}},"required":["mirrorId","mirrorUrl","publicUrl"]}},"required":["requestId","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":"Request access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Mirror request not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Mirror request unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Mirror request temporarily 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/mirror-requests/{owner}/{repo}":{"post":{"operationId":"postApiV1RepositoriesAvailableMirrorRequestsByOwnerByRepo","tags":["Repositories"],"summary":"Submit an asynchronous onboarding mirror request","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clusterHost":{"type":"string","minLength":1}},"required":["clusterHost"]}}}},"responses":{"202":{"description":"Mirror creation request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","processing","succeeded","failed"]},"pollUrl":{"type":"string"}},"required":["requestId","status","pollUrl"]}}}},"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"},"reconnect_required":{"type":"boolean"}},"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 submit mirror request","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/{forge}/{org}/{repo}/members":{"post":{"operationId":"addRepositoryMember","tags":["Repositories"],"summary":"Add a native repository member","description":"Resolves an Entire-native repository and grants an account direct access to it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/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"]}}}},"responses":{"201":{"description":"Member added","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"400":{"description":"Invalid request or non-native repository forge","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 access cannot be managed by this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository or account not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repository is not ready to accept grants; retry later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Repository grant is not valid","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"org","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]},"get":{"operationId":"getApiV1RepositoriesByForgeByOrgByRepoMembers","tags":["Repositories"],"summary":"List repository members","description":"Resolves the forge-qualified repository and returns its effective account access from Core. GitHub collaborators are paginated; native repository grants are returned as a complete roster. 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":"forge","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"},"has_direct_grant":{"type":"boolean"}},"required":["id","name","handle","role","has_direct_grant"]}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["repository","members","next_page_token"]}}}},"400":{"description":"Invalid repository forge 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/repositories/{forge}/{org}/{repo}/members/{accountId}":{"delete":{"operationId":"removeRepositoryMember","tags":["Repositories"],"summary":"Remove a native repository member","description":"Resolves an Entire-native repository and revokes an account's direct access to it.","responses":{"204":{"description":"Member removed"},"400":{"description":"Invalid request or non-native repository forge","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 access cannot be managed by this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Repository or member not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Repository is not ready to revoke grants; retry later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Repository grant revocation is not valid","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":"forge","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":"accountId","required":true}]}},"/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-ids":{"post":{"operationId":"postApiV1ReposResolveIds","tags":["Repositories"],"summary":"Resolve repository IDs","responses":{"200":{"description":"Resolved repository references or unavailable IDs","content":{"application/json":{"schema":{"type":"object","properties":{"resolutions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"resolved"},"repoId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"provider":{"type":"string","enum":["github","entire"]},"fullName":{"type":"string","maxLength":256}},"required":["status","repoId","provider","fullName"]},{"type":"object","properties":{"status":{"type":"string","const":"unavailable"},"repoId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},"required":["status","repoId"]}]}}},"required":["resolutions"]}}}},"400":{"description":"Repository resolution failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Repository resolution failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Repository resolution failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Repository resolution failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Repository resolution failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Repository resolution failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repoIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}},"required":["repoIds"]}}}}}},"/api/v1/repos/resolve":{"get":{"operationId":"getApiV1ReposResolve","tags":["Repositories"],"summary":"Resolve exact repositories","description":"Resolves forge-qualified repository names to routing and activation state without listing all repositories.","parameters":[{"name":"forge","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"},"status":{"type":"string","enum":["processing","ready","failed","suspended"]}},"required":["id","jurisdiction","cell","clusterSlug","mirror","status"],"additionalProperties":{}}},"primaries":{"type":"object","properties":{"git_data":{"type":"string"},"processing":{"type":"string"},"data_primary":{"type":"object","properties":{"forge":{"type":"string","enum":["github","entire"]},"repo_id":{"type":"string"}},"required":["forge","repo_id"]},"processing_primary":{"type":"object","properties":{"forge":{"type":"string","enum":["github","entire"]},"repo_id":{"type":"string"}},"required":["forge","repo_id"]}},"required":["git_data","processing","data_primary"],"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":{"put":{"operationId":"putApiV1EntireReposByRepoIdVisibility","tags":["Entire","Repo Settings"],"summary":"Set a repository's visibility","description":"Sets an Entire-native repository's visibility in entire-core.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"visibility":{"type":"string","enum":["public","private"]}},"required":["visibility"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated repository visibility","content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["public","private"]}},"required":["visibility"],"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"]}}}},"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"]}}}},"422":{"description":"Repository visibility could not be changed","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}]},"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"],"additionalProperties":false}}}},"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/repos/{repoId}/branch-protection":{"get":{"operationId":"getRepositoryBranchProtection","tags":["Entire","Repo Settings"],"summary":"Get a native repository's branch protection rules","description":"Returns the complete rule list the data plane enforces for the repository. Readers may inspect it; a native-mirror id reports its primary's rules; a GitHub mirror always reports an empty list because its protection is governed upstream.","responses":{"200":{"description":"Branch protection rules","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","description":"HEAD follows the default branch; otherwise use a full refs/heads/ name. The * and ? wildcards are supported."},"serverSideMergeOnly":{"description":"Require server-side merges through Entire. Omitted means false.","type":"boolean"}},"required":["ref"],"additionalProperties":{}}}},"required":["rules"],"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 unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"repoId","required":true}]},"patch":{"operationId":"updateRepositoryBranchProtection","tags":["Entire","Repo Settings"],"summary":"Add, change, or remove a native repository's protected branches","description":"Edits the rule list in place. `addRules` upserts by ref (an existing rule keeps its position; omitting `serverSideMergeOnly` preserves its level, while a new rule defaults to false) and `removeRefs` drops rules by ref; the data plane applies each edit atomically, preserving concurrent changes to different refs. For conflicting edits to the same ref, the last applied edit wins. Requires repository admin. A GitHub mirror or a native-mirror id is refused with 409.","responses":{"200":{"description":"The resulting branch protection rules","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","description":"HEAD follows the default branch; otherwise use a full refs/heads/ name. The * and ? wildcards are supported."},"serverSideMergeOnly":{"description":"Require server-side merges through Entire. Omitted means false.","type":"boolean"}},"required":["ref"],"additionalProperties":{}}}},"required":["rules"],"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 unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addRules":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","description":"HEAD follows the default branch; otherwise use a full refs/heads/ name. The * and ? wildcards are supported."},"serverSideMergeOnly":{"description":"Require server-side merges through Entire. Omit to preserve an existing rule's level; a new rule defaults to false.","type":"boolean"}},"required":["ref"],"additionalProperties":{}}},"removeRefs":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"repoId","required":true}]}},"/api/v1/entire/ci-webhooks/{forge}/{owner}/{repo}":{"get":{"operationId":"getApiV1EntireCiWebhooksByForgeByOwnerByRepo","tags":["Entire"],"summary":"List a repo's CI webhooks","description":"Lists the CI-webhook subscriptions for a repo, read from the repo's cell. Requires repo#list or repo#manage_ci on the repo (enforced by entire-ci-webhooks).","parameters":[{"name":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"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"]}}}},"400":{"description":"Unknown git forge","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":"Repo has no ready processing primary in Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-api upstream error","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"]}}}}}},"post":{"operationId":"postApiV1EntireCiWebhooksByForgeByOwnerByRepo","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.","parameters":[{"name":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"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 or git forge","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"]}}}}}}},"/api/v1/entire/ci-webhooks/{forge}/{owner}/{repo}/audit":{"get":{"operationId":"getApiV1EntireCiWebhooksByForgeByOwnerByRepoAudit","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.","parameters":[{"name":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"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"]}}}},"400":{"description":"Unknown git forge","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":"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/{forge}/{owner}/{repo}/builds":{"get":{"operationId":"getApiV1EntireCiWebhooksByForgeByOwnerByRepoBuilds","tags":["Entire"],"summary":"List a repo's recent Buildkite builds","description":"Lists a 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":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"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"]}}}},"400":{"description":"Unknown git forge","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":"Repo has no ready processing primary in Entire","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"entire-api upstream error","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/entire/ci-webhooks/{forge}/{owner}/{repo}/providers":{"get":{"operationId":"getApiV1EntireCiWebhooksByForgeByOwnerByRepoProviders","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.","parameters":[{"name":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"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"]}}}},"400":{"description":"Unknown git forge","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"]}}}}}}},"/api/v1/entire/ci-webhooks/{forge}/{owner}/{repo}/{id}":{"patch":{"operationId":"patchApiV1EntireCiWebhooksByForgeByOwnerByRepoById","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.","parameters":[{"name":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"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}],"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 or git forge","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"]}}}}}},"delete":{"operationId":"deleteApiV1EntireCiWebhooksByForgeByOwnerByRepoById","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.","parameters":[{"name":"forge","in":"path","required":true,"description":"Git forge: gh for a GitHub mirror, et for an Entire-native repo.","schema":{"type":"string","enum":["gh","et"]}},{"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}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Unknown git forge","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"]}}}}}}},"/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}/mirror-requests":{"post":{"operationId":"postApiV1EntireReposByOwnerByRepoMirrorRequests","tags":["Entire"],"summary":"Submit an asynchronous repository mirror request","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"region":{"type":"string","minLength":1},"cell":{"type":"string","minLength":1}},"required":["region"]}}}},"responses":{"202":{"description":"Mirror creation request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"string"},"cell":{"type":"string"},"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","processing","succeeded","failed"]},"pollUrl":{"type":"string"}},"required":["region","cell","requestId","status","pollUrl"]}}}},"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"},"reconnect_required":{"type":"boolean"}},"required":["error"]}}}},"403":{"description":"Repository access 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":"Repository cannot be mirrored or selected region is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to submit mirror request","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":"Repository admin access 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/accounts/lookup":{"get":{"operationId":"lookupMemberAccounts","tags":["Management"],"summary":"Look up an account that can be added as a member","description":"Resolves an exact GitHub handle to an existing global Entire account. Common pasted GitHub handle formats are normalized.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"targetType","in":"query","required":true,"schema":{"type":"string","enum":["organization","project","repository"]}},{"name":"targetId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"targetOwner","in":"query","required":false,"description":"Repository owner; required for repository targets.","schema":{"type":"string","minLength":1}},{"name":"targetRepo","in":"query","required":false,"description":"Repository name; required for repository targets.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Matching accounts","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"handle":{"type":"string"}},"required":["provider","handle"]}}},"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 unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/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"},"capabilities":{"type":"object","properties":{"canCreateProject":{"type":"boolean"},"canManageMembers":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canCreateProject","canManageMembers","canDelete"]}},"required":["id","name","region","createdAt","capabilities"]}},"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 unavailable","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"},"capabilities":{"type":"object","properties":{"canCreateProject":{"type":"boolean"},"canManageMembers":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canCreateProject","canManageMembers","canDelete"]}},"required":["id","name","region","createdAt","capabilities"]}}}},"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 unavailable","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"},"capabilities":{"type":"object","properties":{"canCreateProject":{"type":"boolean"},"canManageMembers":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canCreateProject","canManageMembers","canDelete"]}},"required":["id","name","region","createdAt","capabilities"]}}}},"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 unavailable","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 unavailable","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 unavailable","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 unavailable","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}/people":{"get":{"operationId":"listOrganizationPeople","tags":["Management"],"summary":"List organization members and collaborators with grant levels","description":"Returns grants at their assigned organization, project, or repository level, without inherited expansion or strongest-role collapsing. Membership status applies only to organization membership, not independent resource grants.","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"membership","in":"query","required":false,"schema":{"type":"string","enum":["member","invited","collaborator"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive","pending"]}},{"name":"role","in":"query","required":false,"schema":{"type":"string","enum":["owner","admin","member","reader","writer","mirror_source_admin"]}},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Organization people page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"handle":{"type":"string"},"provider":{"type":"string"},"avatarUrl":{"type":"string"},"membership":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","role","status","createdAt"]},{"type":"null"}]},"grants":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","enum":["organization","project","repository"]},"resourceId":{"type":"string"},"resourceName":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","reader","writer","mirror_source_admin"]},"source":{"type":"string","enum":["membership","direct","team","github"]}},"required":["resourceType","resourceId","resourceName","role","source"]}}},"required":["accountId","membership","grants"]}},"totalCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"nextPageToken":{"type":"string"}},"required":["items","totalCount"]}}}},"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 unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/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 unavailable","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","description":"Public project name. GitHub mirror projects use the owner namespace instead of Core's internal gh:mirrors:* storage name."},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"provider":{"type":"string","enum":["github","entire"],"description":"Namespace provider. Reserved GitHub mirror projects use github."},"reference":{"description":"Canonical public route identity. Omitted when a provider owner is unresolved.","type":"object","properties":{"forge":{"type":"string","enum":["gh","et"]},"project":{"type":"string"}},"required":["forge","project"]},"region":{"type":"string"},"createdAt":{"type":"string"},"capabilities":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canManageAccess":{"type":"boolean"},"canCreateRepository":{"type":"boolean"}},"required":["canDelete","canManageAccess","canCreateRepository"]}},"required":["id","name","ownerId","ownerType","provider","region","createdAt","capabilities"]}},"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 unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/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","description":"Public project name. GitHub mirror projects use the owner namespace instead of Core's internal gh:mirrors:* storage name."},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"provider":{"type":"string","enum":["github","entire"],"description":"Namespace provider. Reserved GitHub mirror projects use github."},"reference":{"description":"Canonical public route identity. Omitted when a provider owner is unresolved.","type":"object","properties":{"forge":{"type":"string","enum":["gh","et"]},"project":{"type":"string"}},"required":["forge","project"]},"region":{"type":"string"},"createdAt":{"type":"string"},"capabilities":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canManageAccess":{"type":"boolean"},"canCreateRepository":{"type":"boolean"}},"required":["canDelete","canManageAccess","canCreateRepository"]}},"required":["id","name","ownerId","ownerType","provider","region","createdAt","capabilities"]}},"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 unavailable","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","description":"Public project name. GitHub mirror projects use the owner namespace instead of Core's internal gh:mirrors:* storage name."},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"provider":{"type":"string","enum":["github","entire"],"description":"Namespace provider. Reserved GitHub mirror projects use github."},"reference":{"description":"Canonical public route identity. Omitted when a provider owner is unresolved.","type":"object","properties":{"forge":{"type":"string","enum":["gh","et"]},"project":{"type":"string"}},"required":["forge","project"]},"region":{"type":"string"},"createdAt":{"type":"string"},"capabilities":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canManageAccess":{"type":"boolean"},"canCreateRepository":{"type":"boolean"}},"required":["canDelete","canManageAccess","canCreateRepository"]}},"required":["id","name","ownerId","ownerType","provider","region","createdAt","capabilities"]}}}},"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 unavailable","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","description":"Public project name. GitHub mirror projects use the owner namespace instead of Core's internal gh:mirrors:* storage name."},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"provider":{"type":"string","enum":["github","entire"],"description":"Namespace provider. Reserved GitHub mirror projects use github."},"reference":{"description":"Canonical public route identity. Omitted when a provider owner is unresolved.","type":"object","properties":{"forge":{"type":"string","enum":["gh","et"]},"project":{"type":"string"}},"required":["forge","project"]},"region":{"type":"string"},"createdAt":{"type":"string"},"capabilities":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canManageAccess":{"type":"boolean"},"canCreateRepository":{"type":"boolean"}},"required":["canDelete","canManageAccess","canCreateRepository"]}},"required":["id","name","ownerId","ownerType","provider","region","createdAt","capabilities"]}}}},"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 unavailable","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 unavailable","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/resolve/{forge}/{project}":{"get":{"operationId":"getProjectByReference","tags":["Management"],"summary":"Get a project by its public route reference","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}}],"responses":{"200":{"description":"Project","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Public project name. GitHub mirror projects use the owner namespace instead of Core's internal gh:mirrors:* storage name."},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"ownerType":{"type":"string","enum":["org","account"]},"provider":{"type":"string","enum":["github","entire"],"description":"Namespace provider. Reserved GitHub mirror projects use github."},"reference":{"description":"Canonical public route identity. Omitted when a provider owner is unresolved.","type":"object","properties":{"forge":{"type":"string","enum":["gh","et"]},"project":{"type":"string"}},"required":["forge","project"]},"region":{"type":"string"},"createdAt":{"type":"string"},"capabilities":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canManageAccess":{"type":"boolean"},"canCreateRepository":{"type":"boolean"}},"required":["canDelete","canManageAccess","canCreateRepository"]}},"required":["id","name","ownerId","ownerType","provider","region","createdAt","capabilities"]}}}},"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 unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/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 unavailable","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 unavailable","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 unavailable","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":{"forge":{"type":"string","enum":["gh","et"]},"owner":{"type":"string"},"repo":{"type":"string"}},"required":["forge","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 unavailable","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":{"forge":{"type":"string","enum":["gh","et"]},"owner":{"type":"string"},"repo":{"type":"string"}},"required":["forge","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 unavailable","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/{forge}/{owner}/{repo}/{number}/reviews/comments":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberReviewsComments","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":"forge","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/{forge}/{owner}/{repo}/{number}/events":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberEvents","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":"forge","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}/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/{forge}/{owner}/{repo}/{number}/reviews":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberReviews","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":"forge","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/{forge}/{owner}/{repo}/{number}/reviews/{id}/comments":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberReviewsByIdComments","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":"forge","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/{forge}/{owner}/{repo}/attachments/{id}/{variant}":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoAttachmentsByIdByVariant","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":"forge","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/{forge}/{owner}/{repo}":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepo","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":"forge","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"}},"ready_for_review":{"type":"boolean"},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"runners":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"runner_id":{"type":"string"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","runner_id","run_id","started_at"]}},"gates":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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"]}},"mergeability":{"anyOf":[{"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"]},{"type":"null"}]},"config_source":{"type":"string","enum":["live","snapshot","live_fallback","unavailable"]},"actions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"disabled_reason":{"type":"string","enum":["already_approved","self_approval_not_allowed"]}},"required":["kind"]}},"monitors":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"last_failed_attempt":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"failed_at":{"type":"string"}},"required":["run_id","head_sha","failed_at"]},{"type":"null"}]},"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","ready_for_review","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":"postApiV1TrailsByForgeByOwnerByRepo","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)"},"ready_for_review":{"type":"boolean","description":"Explicit review readiness (defaults to false). Only open Trails may set true."},"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"}},"ready_for_review":{"type":"boolean"},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"runners":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"runner_id":{"type":"string"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","runner_id","run_id","started_at"]}},"gates":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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"]}},"mergeability":{"anyOf":[{"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"]},{"type":"null"}]},"config_source":{"type":"string","enum":["live","snapshot","live_fallback","unavailable"]},"actions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"disabled_reason":{"type":"string","enum":["already_approved","self_approval_not_allowed"]}},"required":["kind"]}},"monitors":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"last_failed_attempt":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"failed_at":{"type":"string"}},"required":["run_id","head_sha","failed_at"]},{"type":"null"}]},"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","ready_for_review","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/trails/{forge}/{owner}/{repo}/stats":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoStats","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/trails/{forge}/{owner}/{repo}/linked-branches":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoLinkedBranches","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":"forge","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}]}},"/api/v1/trails/{forge}/{owner}/{repo}/{number}/branch":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberBranch","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"}},"ready_for_review":{"type":"boolean"},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"runners":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"runner_id":{"type":"string"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","runner_id","run_id","started_at"]}},"gates":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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"]}},"mergeability":{"anyOf":[{"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"]},{"type":"null"}]},"config_source":{"type":"string","enum":["live","snapshot","live_fallback","unavailable"]},"actions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"disabled_reason":{"type":"string","enum":["already_approved","self_approval_not_allowed"]}},"required":["kind"]}},"monitors":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"last_failed_attempt":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"failed_at":{"type":"string"}},"required":["run_id","head_sha","failed_at"]},{"type":"null"}]},"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","ready_for_review","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":"forge","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/{forge}/{owner}/{repo}/{number}/sessions":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberSessions","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":"forge","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/{forge}/{owner}/{repo}/{number}":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumber","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"}},"ready_for_review":{"type":"boolean"},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"runners":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"runner_id":{"type":"string"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","runner_id","run_id","started_at"]}},"gates":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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"]}},"mergeability":{"anyOf":[{"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"]},{"type":"null"}]},"config_source":{"type":"string","enum":["live","snapshot","live_fallback","unavailable"]},"actions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"disabled_reason":{"type":"string","enum":["already_approved","self_approval_not_allowed"]}},"required":["kind"]}},"monitors":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"last_failed_attempt":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"failed_at":{"type":"string"}},"required":["run_id","head_sha","failed_at"]},{"type":"null"}]},"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","ready_for_review","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":"forge","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":"patchApiV1TrailsByForgeByOwnerByRepoByNumber","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 lifecycle status."},"ready_for_review":{"type":"boolean","description":"Explicit review readiness. Only open Trails may set true; false clears readiness."},"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"}},"ready_for_review":{"type":"boolean"},"comment_count":{"type":"number"},"unresolved_count":{"type":"number"},"checkpoint_count":{"type":"number"},"has_code_changes":{"type":"boolean"},"runners":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"runner_id":{"type":"string"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","runner_id","run_id","started_at"]}},"gates":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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"]}},"mergeability":{"anyOf":[{"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"]},{"type":"null"}]},"config_source":{"type":"string","enum":["live","snapshot","live_fallback","unavailable"]},"actions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"disabled_reason":{"type":"string","enum":["already_approved","self_approval_not_allowed"]}},"required":["kind"]}},"monitors":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"last_failed_attempt":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"failed_at":{"type":"string"}},"required":["run_id","head_sha","failed_at"]},{"type":"null"}]},"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","ready_for_review","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":"forge","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":"deleteApiV1TrailsByForgeByOwnerByRepoByNumber","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":"forge","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/{forge}/{owner}/{repo}/{number}/contributors":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberContributors","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":"forge","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/{forge}/{owner}/{repo}/{number}/discussions":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberDiscussions","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":"forge","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":"postApiV1TrailsByForgeByOwnerByRepoByNumberDiscussions","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":"forge","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/{forge}/{owner}/{repo}/{number}/discussions/stream":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberDiscussionsStream","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":"forge","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/{forge}/{owner}/{repo}/{number}/discussions/{discussionId}":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberDiscussionsByDiscussionId","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":"forge","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":"patchApiV1TrailsByForgeByOwnerByRepoByNumberDiscussionsByDiscussionId","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":"forge","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/{forge}/{owner}/{repo}/{number}/discussions/{discussionId}/messages":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberDiscussionsByDiscussionIdMessages","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":"forge","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/{forge}/{owner}/{repo}/{number}/discussions/{discussionId}/messages/{messageId}":{"patch":{"operationId":"patchApiV1TrailsByForgeByOwnerByRepoByNumberDiscussionsByDiscussionIdMessagesByMessageId","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":"forge","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":"deleteApiV1TrailsByForgeByOwnerByRepoByNumberDiscussionsByDiscussionIdMessagesByMessageId","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":"forge","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/{forge}/{owner}/{repo}/{number}/approvals":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberApprovals","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":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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","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":"forge","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":"getApiV1TrailsByForgeByOwnerByRepoByNumberApprovals","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":"forge","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/{forge}/{owner}/{repo}/{number}/timeline":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberTimeline","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":"forge","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/{forge}/{owner}/{repo}/{number}/timeline/trail":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberTimelineTrail","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":"forge","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/{forge}/{owner}/{repo}/{number}/timeline/change":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberTimelineChange","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":"forge","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/{forge}/{owner}/{repo}/{number}/mergeability":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberMergeability","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":"forge","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/{forge}/{owner}/{repo}/{number}/gates":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberGates","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":{"type":"array","items":{"type":"object","properties":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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":{"runner_ids":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["not_run","running","evaluated","stale","disabled","not_applicable","configuration_error"]},"outcome":{"anyOf":[{"type":"string","enum":["passed","failed","errored"]},{"type":"null"}]},"evaluated_at_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"stale_reason":{"anyOf":[{"type":"string","enum":["head_moved","config_changed"]},{"type":"null"}]},"finding_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"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","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":"forge","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/{forge}/{owner}/{repo}/{number}/checks":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberChecks","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":"forge","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/{forge}/{owner}/{repo}/{number}/ci-pr":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberCiPr","tags":["Trails"],"summary":"Create or link a CI pull request for a trail","responses":{"201":{"description":"CI pull request created or linked","headers":{"Location":{"schema":{"type":"string"}}},"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":"forge","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/{forge}/{owner}/{repo}/{number}/merge":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberMerge","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":"forge","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/{forge}/{owner}/{repo}/{number}/update-branch":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberUpdateBranch","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":"forge","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/{forge}/{owner}/{repo}/{number}/runs/{runnerId}":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberRunsByRunnerId","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":"forge","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":"getApiV1TrailsByForgeByOwnerByRepoByNumberRunsByRunnerId","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":"forge","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/{forge}/{owner}/{repo}/{number}/review-rerun":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberReviewRerun","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":"forge","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/{forge}/{owner}/{repo}/{number}/files":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberFiles","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":"forge","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/{forge}/{owner}/{repo}/{number}/attachments":{"post":{"operationId":"postApiV1TrailsByForgeByOwnerByRepoByNumberAttachments","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":"forge","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":"getApiV1TrailsByForgeByOwnerByRepoByNumberAttachments","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":"forge","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/{forge}/{owner}/{repo}/{number}/attachments/{id}":{"delete":{"operationId":"deleteApiV1TrailsByForgeByOwnerByRepoByNumberAttachmentsById","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":"forge","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/{forge}/{owner}/{repo}/{number}/attachments/{id}/download":{"get":{"operationId":"getApiV1TrailsByForgeByOwnerByRepoByNumberAttachmentsByIdDownload","tags":["Trails"],"summary":"Serve a trail attachment's original bytes (cell-backed)","description":"Cell-only capability (ENT-1174) that redirects to a short-lived presigned download URL.","responses":{"302":{"description":"Redirect to a presigned download URL"},"404":{"description":"Attachment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"forge","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/{forge}/{project}/trails/{trailId}/discussions":{"get":{"operationId":"listProjectTrailDiscussions","tags":["Project Trails"],"summary":"List project Trail discussions","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"pageToken","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Discussion response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"title":{"type":"string"},"kind":{"type":"string","const":"discussion"},"etag":{"type":"string"},"resolved":{"type":"boolean"},"resolvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastMessageAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessageAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"reviewCommentId":{"type":"null"},"reviewComment":{"type":"null"}},"required":["id","trailId","title","kind","resolved","resolvedBy","resolvedAt","createdBy","createdAt","updatedAt","lastMessageAt","lastMessageAuthor","messageCount","participants","reviewCommentId","reviewComment"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventCursor":{"type":"string","pattern":"^[0-9]+$","description":"Non-negative decimal event ID, serialized as a string to preserve 64-bit precision."}},"required":["items","nextPageToken","eventCursor"]}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}},"post":{"operationId":"createProjectTrailDiscussion","tags":["Project Trails"],"summary":"Start a project Trail discussion","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":512},"body":{"type":"string","minLength":1,"maxLength":65536}},"additionalProperties":false}}}},"responses":{"201":{"description":"Discussion response","content":{"application/json":{"schema":{"type":"object","properties":{"discussion":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"title":{"type":"string"},"kind":{"type":"string","const":"discussion"},"etag":{"type":"string"},"resolved":{"type":"boolean"},"resolvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastMessageAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessageAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"reviewCommentId":{"type":"null"},"reviewComment":{"type":"null"}},"required":["id","trailId","title","kind","resolved","resolvedBy","resolvedAt","createdBy","createdAt","updatedAt","lastMessageAt","lastMessageAuthor","messageCount","participants","reviewCommentId","reviewComment"]},"message":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"},"etag":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"}},"required":["id","author","createdAt","body"]}}},"required":["id","author","createdAt","body","replies"]},{"type":"null"}]}},"required":["discussion","message"]}}},"headers":{"ETag":{"description":"Version of the discussion or message, not the parent Trail","schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}}},"/api/v1/{forge}/{project}/trails/{trailId}/discussions/stream":{"get":{"operationId":"streamProjectTrailDiscussions","tags":["Project Trails"],"summary":"Read or stream project Trail discussion events","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"after","in":"query","schema":{"type":"string","pattern":"^[0-9]+$","description":"Non-negative decimal event ID (not an opaque page token)."}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"Accept","in":"header","schema":{"type":"string"}},{"name":"Last-Event-ID","in":"header","schema":{"type":"string","pattern":"^[0-9]+$","description":"Non-negative decimal event ID (not an opaque page token)."}}],"responses":{"200":{"description":"JSON events or resumable SSE","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9]+$","description":"Non-negative decimal event ID, serialized as a string to preserve 64-bit precision."},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"discussionId":{"anyOf":[{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},{"type":"null"}]},"actorId":{"type":"string"},"eventType":{"type":"string"},"targetId":{"type":"string"},"payload":{},"createdAt":{"type":"string"}},"required":["id","trailId","discussionId","actorId","eventType","targetId","payload","createdAt"]}}},"required":["events"]}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}}},"/api/v1/{forge}/{project}/trails/{trailId}/discussions/{discussionId}":{"get":{"operationId":"getProjectTrailDiscussion","tags":["Project Trails"],"summary":"Read a project Trail discussion","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}],"responses":{"200":{"description":"Discussion response","content":{"application/json":{"schema":{"type":"object","properties":{"discussion":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"title":{"type":"string"},"kind":{"type":"string","const":"discussion"},"etag":{"type":"string"},"resolved":{"type":"boolean"},"resolvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastMessageAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessageAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"reviewCommentId":{"type":"null"},"reviewComment":{"type":"null"}},"required":["id","trailId","title","kind","resolved","resolvedBy","resolvedAt","createdBy","createdAt","updatedAt","lastMessageAt","lastMessageAuthor","messageCount","participants","reviewCommentId","reviewComment"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"},"etag":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"}},"required":["id","author","createdAt","body"]}}},"required":["id","author","createdAt","body","replies"]}},"eventCursor":{"type":"string","pattern":"^[0-9]+$","description":"Non-negative decimal event ID, serialized as a string to preserve 64-bit precision."}},"required":["discussion","messages","eventCursor"]}}},"headers":{"ETag":{"description":"Version of the discussion or message, not the parent Trail","schema":{"type":"string"}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}},"patch":{"operationId":"updateProjectTrailDiscussion","tags":["Project Trails"],"summary":"Rename or resolve/reopen a project Trail discussion","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Discussion or message ETag, never the parent Trail ETag"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":512},"resolved":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Discussion response","content":{"application/json":{"schema":{"type":"object","properties":{"discussion":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"title":{"type":"string"},"kind":{"type":"string","const":"discussion"},"etag":{"type":"string"},"resolved":{"type":"boolean"},"resolvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastMessageAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessageAuthor":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"participants":{"type":"array","items":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"reviewCommentId":{"type":"null"},"reviewComment":{"type":"null"}},"required":["id","trailId","title","kind","resolved","resolvedBy","resolvedAt","createdBy","createdAt","updatedAt","lastMessageAt","lastMessageAuthor","messageCount","participants","reviewCommentId","reviewComment"]}},"required":["discussion"]}}},"headers":{"ETag":{"description":"Version of the discussion or message, not the parent Trail","schema":{"type":"string"}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}}},"/api/v1/{forge}/{project}/trails/{trailId}/discussions/{discussionId}/messages":{"post":{"operationId":"createProjectTrailDiscussionMessage","tags":["Project Trails"],"summary":"Reply to a project Trail discussion","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":65536}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"Discussion response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"},"etag":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"}},"required":["id","author","createdAt","body"]}}},"required":["id","author","createdAt","body","replies"]}},"required":["message"]}}},"headers":{"ETag":{"description":"Version of the discussion or message, not the parent Trail","schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}}},"/api/v1/{forge}/{project}/trails/{trailId}/discussions/{discussionId}/messages/{messageId}":{"patch":{"operationId":"updateProjectTrailDiscussionMessage","tags":["Project Trails"],"summary":"Edit your project Trail discussion message","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Discussion or message ETag, never the parent Trail ETag"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":65536}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Discussion response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"},"etag":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"author":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"}},"required":["id","author","createdAt","body"]}}},"required":["id","author","createdAt","body","replies"]}},"required":["message"]}}},"headers":{"ETag":{"description":"Version of the discussion or message, not the parent Trail","schema":{"type":"string"}}}},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}},"delete":{"operationId":"deleteProjectTrailDiscussionMessage","tags":["Project Trails"],"summary":"Delete your project Trail discussion message","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["et","gh"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string"}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Discussion or message ETag, never the parent Trail ETag"}],"responses":{"204":{"description":"Message deleted"},"400":{"description":"Request refused or upstream unavailable"},"401":{"description":"Request refused or upstream unavailable"},"403":{"description":"Request refused or upstream unavailable"},"404":{"description":"Request refused or upstream unavailable"},"409":{"description":"Request refused or upstream unavailable"},"412":{"description":"Request refused or upstream unavailable"},"422":{"description":"Request refused or upstream unavailable"},"429":{"description":"Request refused or upstream unavailable"},"502":{"description":"Request refused or upstream unavailable"},"503":{"description":"Request refused or upstream unavailable"}}}},"/api/v1/{forge}/{project}/trails/context":{"get":{"operationId":"getProjectTrailContext","tags":["Project Trails"],"summary":"Resolve an accessible project for project Trails","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}}],"responses":{"200":{"description":"Project context","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"canManageTrails":{"type":"boolean"}},"required":["id","name","canManageTrails"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}}},"/api/v1/{forge}/{project}/trails":{"get":{"operationId":"listProjectTrails","tags":["Project Trails"],"summary":"List a project's Trails","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"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":"Trail page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"projectId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["draft","open","closed"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assignees":{"type":"array","items":{"type":"string"}},"assigneeAccountIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null"}]}},"repoIds":{"type":"array","items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},"authorAccountId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repository":{"type":"string"},"branch":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"type":"string"},"hasCodeChanges":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","repositoryId","repository","branch","number","title","status","hasCodeChanges","createdAt","updatedAt"]}},"isPossiblyPartial":{"type":"boolean"}},"required":["id","projectId","number","title","body","status","metadata","type","priority","assignees","assigneeAccountIds","repoIds","authorAccountId","createdAt","updatedAt","closedAt"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","nextPageToken"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}},"post":{"operationId":"createProjectTrail","tags":["Project Trails"],"summary":"Create a project Trail","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","minLength":1,"maxLength":500},"body":{"type":"string","maxLength":1048576},"status":{"type":"string","enum":["draft","open","closed"]},"metadata":{"type":"object","additionalProperties":true},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assignees":{"type":"array","maxItems":100,"items":{"type":"string"}},"repoIds":{"type":"array","maxItems":100,"items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}}}}}},"responses":{"201":{"description":"Trail created","headers":{"Location":{"schema":{"type":"string"}},"ETag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"projectId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["draft","open","closed"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assignees":{"type":"array","items":{"type":"string"}},"assigneeAccountIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null"}]}},"repoIds":{"type":"array","items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},"authorAccountId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repository":{"type":"string"},"branch":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"type":"string"},"hasCodeChanges":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","repositoryId","repository","branch","number","title","status","hasCodeChanges","createdAt","updatedAt"]}},"isPossiblyPartial":{"type":"boolean"}},"required":["id","projectId","number","title","body","status","metadata","type","priority","assignees","assigneeAccountIds","repoIds","authorAccountId","createdAt","updatedAt","closedAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}}},"/api/v1/{forge}/{project}/trails/{trailId}":{"get":{"operationId":"getProjectTrail","tags":["Project Trails"],"summary":"Get a project Trail","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}],"responses":{"200":{"description":"Trail","headers":{"ETag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"projectId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["draft","open","closed"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assignees":{"type":"array","items":{"type":"string"}},"assigneeAccountIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null"}]}},"repoIds":{"type":"array","items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},"authorAccountId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repository":{"type":"string"},"branch":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"type":"string"},"hasCodeChanges":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","repositoryId","repository","branch","number","title","status","hasCodeChanges","createdAt","updatedAt"]}},"isPossiblyPartial":{"type":"boolean"}},"required":["id","projectId","number","title","body","status","metadata","type","priority","assignees","assigneeAccountIds","repoIds","authorAccountId","createdAt","updatedAt","closedAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}},"patch":{"operationId":"updateProjectTrail","tags":["Project Trails"],"summary":"Update a project Trail","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"properties":{"title":{"type":"string","minLength":1,"maxLength":500},"body":{"type":"string","maxLength":1048576},"status":{"type":"string","enum":["draft","open","closed"]},"metadata":{"type":"object","additionalProperties":true},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assignees":{"type":"array","maxItems":100,"items":{"type":"string"}},"repoIds":{"type":"array","maxItems":100,"items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}}}}}},"responses":{"200":{"description":"Trail updated","headers":{"ETag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"projectId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["draft","open","closed"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assignees":{"type":"array","items":{"type":"string"}},"assigneeAccountIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null"}]}},"repoIds":{"type":"array","items":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},"authorAccountId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repository":{"type":"string"},"branch":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"type":"string"},"hasCodeChanges":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","repositoryId","repository","branch","number","title","status","hasCodeChanges","createdAt","updatedAt"]}},"isPossiblyPartial":{"type":"boolean"}},"required":["id","projectId","number","title","body","status","metadata","type","priority","assignees","assigneeAccountIds","repoIds","authorAccountId","createdAt","updatedAt","closedAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}}},"/api/v1/{forge}/{project}/trails/{trailId}/changes":{"post":{"operationId":"createProjectTrailChange","tags":["Project Trails"],"summary":"Create or link branch-backed work under a Trail","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["repositoryId","title","branchName"],"properties":{"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"title":{"type":"string"},"body":{"type":"string"},"branchName":{"type":"string","minLength":1},"branchAction":{"type":"string","enum":["create","link"]},"base":{"type":"string"},"status":{"type":"string","enum":["draft","open","closed","merged"]},"readyForReview":{"type":"boolean"},"assignees":{"type":"array","maxItems":100,"items":{"type":"string"}},"type":{"type":"string","enum":["bug","feature","task"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]}}}}}},"responses":{"201":{"description":"Created or reused Change; ETag is the parent version","headers":{"ETag":{"schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},"required":["id","trailId","repositoryId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}}},"/api/v1/{forge}/{project}/trails/{trailId}/changes/{changeId}":{"get":{"operationId":"getProjectTrailChange","tags":["Project Trails"],"summary":"Get a Trail's Change","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}}],"responses":{"200":{"description":"Change","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trailId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repository":{"type":"string"}},"required":["id","number","trailId","repositoryId","repository"],"additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}},"put":{"operationId":"attachProjectTrailChange","tags":["Project Trails"],"summary":"Attach a Change to a Trail","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Change attached","headers":{"Location":{"schema":{"type":"string"}},"ETag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repositoryId":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"},"repository":{"type":"string"},"branch":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"status":{"type":"string"},"hasCodeChanges":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","repositoryId","repository","branch","number","title","status","hasCodeChanges","createdAt","updatedAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}},"delete":{"operationId":"detachProjectTrailChange","tags":["Project Trails"],"summary":"Detach a Change from a Trail","parameters":[{"name":"forge","in":"path","required":true,"schema":{"type":"string","enum":["gh","et"]}},{"name":"project","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":39}},{"name":"trailId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-7][0-9A-HJKMNP-TV-Z]{25}$"}},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Change detached","headers":{"ETag":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"403":{"description":"Feature disabled or access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"404":{"description":"Project, Trail, or Change not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"412":{"description":"ETag precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"502":{"description":"Project cell unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}},"503":{"description":"Project Trails unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"status":{"type":"number"}},"additionalProperties":{}}}}}}}},"/api/v1/runs/{forge}/{owner}/{repo}":{"get":{"operationId":"getApiV1RunsByForgeByOwnerByRepo","tags":["Runs"],"summary":"List Runner runs","parameters":[{"name":"forge","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"}]},"credential_source":{"anyOf":[{"type":"string","enum":["platform","repo"]},{"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","credential_source","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/{forge}/{owner}/{repo}/{runId}":{"get":{"operationId":"getApiV1RunsByForgeByOwnerByRepoByRunId","tags":["Runs"],"summary":"Get a Runner run","parameters":[{"name":"forge","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"}]},"credential_source":{"anyOf":[{"type":"string","enum":["platform","repo"]},{"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","credential_source","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":"deleteApiV1RunsByForgeByOwnerByRepoByRunId","tags":["Runs"],"summary":"Cancel a Runner run","parameters":[{"name":"forge","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"]}}}}}}},"/auth/providers":{"get":{"operationId":"getAuthProviders","tags":["Auth"],"summary":"List the providers entire-core will accept for this session","responses":{"200":{"description":"Configured login providers for the session's issuing core, or the default core when anonymous","content":{"application/json":{"schema":{"type":"object","properties":{"default_provider":{"type":"string"},"providers":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"display_name":{"type":"string","minLength":1},"device_flow":{"type":"boolean"},"direct_exchange":{"type":"boolean"}},"required":["id","display_name"]}}},"required":["providers"]}}}},"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"]}}}}}}}},"components":{}}