{"openapi":"3.1.0","info":{"title":"infracodebase API","version":"1.0.0-preview","description":"Public REST API for infracodebase. Authenticate with a personal or enterprise access token.\n\nEndpoints marked `not_implemented` (501) are documented but pending internal work."},"servers":[{"url":"/","description":"This deployment"}],"tags":[{"name":"Identity","description":"The authenticated identity: who the token belongs to and which enterprises they're a member of."},{"name":"Personal rulesets","description":"Rulesets owned by the calling user."},{"name":"Enterprise","description":"Top-level organizational unit."},{"name":"Enterprise rulesets","description":"Rulesets owned by an enterprise. Inherited by every workspace in the enterprise."},{"name":"GitHub","description":"GitHub App installations and accessible repositories. Enterprise-scoped. Workspaces pick one connected repo from this pool."},{"name":"Enterprise compliance","description":"Cross-workspace compliance snapshots. Designed for dashboards and CI gates that need one summary call instead of fanning out per workspace."},{"name":"Workspace","description":"A governed repository tree inside an enterprise."},{"name":"Repository","description":"The Git repository connected 1:1 to a workspace."},{"name":"Workspace rulesets","description":"Rulesets attached to a workspace. The workspace's effective ruleset set is whatever is attached here, including inherited enterprise rulesets."},{"name":"Compliance","description":"Compliance evaluations and findings for a workspace."}],"x-tagGroups":[{"name":"User","tags":["Identity","Personal rulesets"]},{"name":"Enterprise","tags":["Enterprise","Enterprise rulesets","GitHub","Enterprise compliance"]},{"name":"Workspace","tags":["Workspace","Repository","Workspace rulesets","Compliance"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal access token (`icb_pat_…`) or enterprise access token (`icb_eat_…`)."}},"schemas":{"Me":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"user_abc123","description":"User identifier."},"email":{"type":"string","format":"email","example":"ada@example.com"},"name":{"type":["string","null"]},"enterprises":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseMembership"}}},"required":["id","email","name","enterprises"]},"EnterpriseMembership":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string","example":"ADMIN","description":"Caller's role in the enterprise. `TOKEN` for enterprise PATs."},"workspace_count":{"type":"integer","minimum":0}},"required":["id","name","slug","role","workspace_count"]},"Error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error"],"description":"High-level category. Branch on this in client code, not the message."},"code":{"type":"string","example":"not_an_enterprise_member","description":"Stable machine-readable error code."},"message":{"type":"string","description":"Human-readable explanation. Safe to surface to end users."},"param":{"type":"string","example":"body.merge_target_branch","description":"Path to the offending field, when applicable."},"doc_url":{"type":"string","format":"uri","description":"Link to docs for this error code."},"request_id":{"type":"string","description":"Echoes the X-Request-Id response header. Quote this in support tickets."}},"required":["type","code","message","request_id"]},"RulesetSummary":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"scope":{"type":"string","enum":["enterprise","workspace","user"],"description":"Where this ruleset lives in the ownership hierarchy."},"enabled":{"type":"boolean","description":"Whether the ruleset is published at its owning scope. Enterprise rulesets with `enabled: false` are visible to enterprise admins for management but invisible to workspaces."},"required":{"type":"boolean","description":"Whether the ruleset is mandatory and cannot be toggled at the workspace level. Only meaningful for enterprise rulesets; workspace and user rulesets are always `false`."},"rule_summary":{"$ref":"#/components/schemas/RuleSummary"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","slug","title","description","scope","enabled","required","rule_summary","tags"]},"RuleSummary":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"ci_blocking":{"type":"integer","minimum":0,"description":"Rules whose failure blocks CI."},"advisory":{"type":"integer","minimum":0,"description":"Rules that affect score but do not block CI."}},"required":["total","ci_blocking","advisory"]},"Ruleset":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"scope":{"type":"string","enum":["enterprise","workspace","user"],"description":"Where this ruleset lives in the ownership hierarchy."},"enabled":{"type":"boolean","description":"Whether the ruleset is published at its owning scope. Enterprise rulesets with `enabled: false` are invisible to workspaces."},"required":{"type":"boolean","description":"Whether the ruleset is mandatory. Only meaningful for enterprise rulesets; workspace and user rulesets are always `false`."},"tags":{"type":"array","items":{"type":"string"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}}},"required":["id","slug","title","description","scope","enabled","required","tags","rules"]},"Rule":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0003abcdxyzqwert","description":"Rule identifier (opaque)."},"slug":{"type":"string"},"title":{"type":"string"},"content":{"type":"string","description":"Full rule body in markdown."},"required":{"type":"boolean","description":"True if a `fail` finding on this rule blocks CI."},"order":{"type":"integer"}},"required":["id","slug","title","content","required","order"]},"PersonalRulesetCreateRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"tags":{"type":"array","items":{"type":"string"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleCreateRequest"},"description":"Optional list of rules to create atomically with the ruleset. If omitted or empty, the ruleset is created with no rules and rules can be added later."}},"required":["title"]},"RuleCreateRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"string","minLength":1,"maxLength":10000,"description":"Full rule body in markdown."},"required":{"type":"boolean","description":"True if a `fail` finding on this rule blocks CI. Defaults to false."},"order":{"type":"integer","minimum":0,"description":"Position within the ruleset (0-based). If omitted, rules are placed in the order they appear in the array."}},"required":["title","content"]},"PersonalRulesetUpdateRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"tags":{"type":"array","items":{"type":"string"}}}},"Enterprise":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":["string","null"],"description":"Pricing plan identifier."}},"required":["id","name","slug","plan"]},"Installation":{"type":"object","properties":{"id":{"type":"string","description":"Our internal installation row id."},"installation_id":{"type":"integer","description":"GitHub's numeric installation id."},"account_login":{"type":"string"},"account_type":{"type":"string","example":"Organization"}},"required":["id","installation_id","account_login","account_type"]},"Repo":{"type":"object","properties":{"name":{"type":"string"},"full_name":{"type":"string"},"owner":{"type":"string"},"default_branch":{"type":"string"},"private":{"type":"boolean"}},"required":["name","full_name","owner","default_branch","private"]},"Workspace":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"slug":{"type":"string","description":"URL-safe identifier, unique within the enterprise."},"name":{"type":"string"},"description":{"type":["string","null"]},"enterprise":{"$ref":"#/components/schemas/EnterpriseRef"},"linked_repository":{"$ref":"#/components/schemas/LinkedRepoRef"},"created_at":{"type":"string","format":"date-time","example":"2026-05-26T14:00:00.000Z","description":"ISO 8601 timestamp (UTC)."}},"required":["id","slug","name","description","enterprise","linked_repository","created_at"]},"EnterpriseRef":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"slug":{"type":"string","example":"onwardplatforms"}},"required":["id","slug"],"description":"Owning enterprise. Embedded as a ref; full object available via ?include=enterprise (not yet implemented)."},"LinkedRepoRef":{"type":["object","null"],"properties":{"owner":{"type":"string","example":"onwardplatforms"},"name":{"type":"string","example":"infracodebase"}},"required":["owner","name"]},"WorkspaceCreateResult":{"type":"object","properties":{"workspace":{"$ref":"#/components/schemas/Workspace"},"github_linked":{"anyOf":[{"type":"boolean","enum":[true]},{"type":"boolean","enum":[false]},{"type":"null"}],"description":"true = github linked successfully. false = github requested but link failed (see github_error). null = github not requested."},"github_error":{"type":"string"}},"required":["workspace","github_linked"]},"WorkspaceCreateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":2000},"ruleset_ids":{"type":"array","items":{"type":"string"},"description":"Enterprise ruleset IDs to attach."},"mcp_server_ids":{"type":"array","items":{"type":"string"}},"workflow_ids":{"type":"array","items":{"type":"string"}},"github":{"type":"object","properties":{"installation_id":{"type":"string","example":"12345678"},"owner":{"type":"string"},"repo":{"type":"string"},"branch":{"type":"string"}},"required":["installation_id","owner","repo","branch"],"description":"Optional GitHub repo to link at creation time."}},"required":["name"]},"WorkspaceUpdateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":["string","null"],"maxLength":2000},"merge_target_branch":{"type":"string","description":"Default branch for PR creation."}}},"EnterpriseRulesetCreateRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"tags":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"required":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleCreateRequest"},"description":"Optional list of rules to create atomically with the ruleset. If omitted or empty, the ruleset is created with no rules and rules can be added later."}},"required":["title"]},"EnterpriseRulesetUpdateRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"tags":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"required":{"type":"boolean"}}},"WorkspaceRulesetSummary":{"allOf":[{"$ref":"#/components/schemas/RulesetSummary"},{"type":"object","properties":{"workspace_setting":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"description":"The workspace's stored opinion about this ruleset (from `WorkspaceRulesetSetting`), or `null` if the workspace has never opted in or out. Only meaningful for inheritable (enterprise) rulesets — always `null` for workspace- and user-owned rulesets."},"effective_enabled":{"type":"boolean","description":"Whether the ruleset is currently active for this workspace. For enterprise rulesets: `required: true` forces on; otherwise the workspace's `workspace_setting.enabled` wins, defaulting to off when null. For workspace- and user-owned rulesets: equal to `enabled`."}},"required":["workspace_setting","effective_enabled"]}]},"WorkspaceRulesetSetting":{"type":"object","properties":{"ruleset_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"enabled":{"type":"boolean","description":"The workspace's stated opinion about this ruleset."},"effective_enabled":{"type":"boolean","description":"Whether the ruleset is currently active for this workspace. Equal to `enabled` for non-required rulesets after this endpoint succeeds."},"required":{"type":"boolean","description":"Whether the ruleset is enterprise-`required`. Required rulesets can never be toggled at the workspace level; always returned as `false` from this endpoint since toggling a required ruleset is itself an error."}},"required":["ruleset_id","enabled","effective_enabled","required"]},"WorkspaceRulesetSettingUpdateRequest":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether this enterprise ruleset is active in this workspace."}},"required":["enabled"]},"LinkedRepository":{"type":"object","properties":{"owner":{"type":"string","example":"onwardplatforms"},"name":{"type":"string","example":"infracodebase"},"branch":{"type":["string","null"],"example":"main","description":"Default branch tracked by the workspace."},"installation_id":{"type":["string","null"],"description":"ID of the GitHub installation that owns this link."}},"required":["owner","name","branch","installation_id"]},"RepoLinkRequest":{"type":"object","properties":{"installation_id":{"type":"string","minLength":1,"description":"GitHub installation that has access to the repo. Get this from `/integrations/github/installations`."},"owner":{"type":"string","minLength":1,"example":"onwardplatforms"},"name":{"type":"string","minLength":1,"example":"infracodebase"},"branch":{"type":"string","minLength":1,"example":"main"}},"required":["installation_id","owner","name","branch"]},"Evaluation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0004abcdxyzqwert","description":"Compliance evaluation identifier (opaque)."},"commit_sha":{"type":["string","null"]},"branch":{"type":["string","null"]},"trigger":{"type":"string","example":"manual","description":"What kicked off the evaluation."},"status":{"type":"string","example":"completed"},"result":{"type":["string","null"],"enum":["pass","fail",null],"example":"pass","description":"Pass/fail result for this compliance evaluation against the threshold snapshotted on the run. `pass` when the score meets `threshold` and no required rule failed. `fail` when any required rule failed or the score is below `threshold`. `null` when the evaluation has not completed, or when it completed with no scorable findings (all NA/inconclusive) and no required rule failed. Computed for every completed evaluation regardless of whether the enterprise has GitHub CI gating enabled — that toggle separately controls webhook auto-run and GitHub Check Run posting, not whether the result exists. Note: 'required' here refers to rule-level `required`; ruleset-level `required` is a coverage concern and does not gate the result."},"error_message":{"type":["string","null"]},"score":{"type":["number","null"],"description":"passes / (passes + fails). Null while running or on error."},"pass_count":{"type":"integer","minimum":0},"fail_count":{"type":"integer","minimum":0},"inconclusive_count":{"type":"integer","minimum":0},"not_applicable_count":{"type":"integer","minimum":0},"not_code_verifiable_count":{"type":"integer","minimum":0},"total_count":{"type":"integer","minimum":0},"duration_ms":{"type":["integer","null"]},"skip_bypass":{"type":"boolean","example":false,"description":"True when the IaC-aware skip gate bypassed the per-ruleset agent fan-out for this evaluation. The enterprise had the toggle on, a baseline existed, the diff was captured, and the customer's configured patterns classified every changed file as non-IaC. Findings on the row were carried forward from the baseline unchanged; score and verdict still apply to the carried set."},"skip_reasoning":{"type":["string","null"],"example":null,"description":"Human-readable per-file enumeration recording the IaC classifier's decision when `skip_bypass` is true. Format is a headline summary, a blank line, then `<path>  → <reason>` per file. Null on non-bypassed runs."},"created_at":{"type":"string","format":"date-time","example":"2026-05-26T14:00:00.000Z","description":"ISO 8601 timestamp (UTC)."},"completed_at":{"type":["string","null"],"format":"date-time","example":"2026-05-26T14:00:00.000Z","description":"ISO 8601 timestamp (UTC)."}},"required":["id","commit_sha","branch","trigger","status","result","error_message","score","pass_count","fail_count","inconclusive_count","not_applicable_count","not_code_verifiable_count","total_count","duration_ms","skip_bypass","skip_reasoning","created_at","completed_at"]},"EvaluationTriggerRequest":{"type":"object","properties":{"ref":{"type":"string","description":"Commit SHA or branch to evaluate. Defaults to the workspace's default branch."}}},"FindingsResult":{"type":"object","properties":{"evaluation_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0004abcdxyzqwert","description":"Compliance evaluation identifier (opaque)."},"commit_sha":{"type":["string","null"]},"branch":{"type":["string","null"]},"score":{"type":["number","null"]},"baseline_evaluation_id":{"type":["string","null"],"minLength":1,"example":"cmaxw7q3w0004abcdxyzqwert","description":"Evaluation whose findings served as the rollforward baseline for this run. Null on cold start."},"baseline_commit_sha":{"type":["string","null"],"description":"Commit SHA the baseline evaluation was run against. Null on cold start."},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}}},"required":["evaluation_id","commit_sha","branch","score","baseline_evaluation_id","baseline_commit_sha","findings"]},"Finding":{"type":"object","properties":{"ruleset_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"ruleset_slug":{"type":"string"},"ruleset_title":{"type":"string"},"rule_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0003abcdxyzqwert","description":"Rule identifier (opaque)."},"rule_title":{"type":"string"},"rule_required":{"type":"boolean"},"status":{"type":"string","enum":["pass","fail","not_applicable","inconclusive","not_code_verifiable"],"description":"Four-step decision ladder: not_code_verifiable -> not_applicable -> inconclusive -> pass|fail. Only pass and fail count toward the score."},"justification":{"type":"string","description":"Audit-voice explanation citing file:line evidence."},"evidence":{"description":"Structured evidence payload. Shape depends on the rule."},"prior_verdict":{"type":["string","null"],"enum":["pass","fail","not_applicable","inconclusive","not_code_verifiable",null],"description":"Prior workpaper's verdict for this rule. Null on cold start and pre-overlay rows."},"change_type":{"type":["string","null"],"enum":["held","changed","new","rule_changed",null],"description":"Outcome of the rollforward comparison vs the prior workpaper. Null on pre-overlay rows."},"delta_justification":{"type":["string","null"],"description":"Audit-voice explanation of why the verdict held, moved, or was re-derived under a changed rule. Null when there was no prior to compare against."}},"required":["ruleset_id","ruleset_slug","ruleset_title","rule_id","rule_title","rule_required","status","justification","prior_verdict","change_type","delta_justification"]},"EvalSpec":{"type":"object","properties":{"system_prompt":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}},"required":["system_prompt","notes"]},"EnterpriseComplianceLatestResult":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceComplianceLatest"}}},"required":["data"]},"WorkspaceComplianceLatest":{"type":"object","properties":{"workspace_id":{"type":"string"},"workspace_slug":{"type":"string"},"workspace_name":{"type":"string"},"default_branch":{"type":["string","null"],"description":"The workspace's default branch. Null if no repo is linked."},"linked_repo":{"type":["string","null"],"example":"acme-corp/so284-k8s-fleet","description":"The linked GitHub repository as `owner/name`. Null if no repo is linked. Use this when you need the real GitHub repo name and the workspace name is not a reliable proxy."},"latest_evaluation":{"allOf":[{"$ref":"#/components/schemas/Evaluation"},{"type":["object","null"],"description":"Null when the workspace has no matching evaluation."}]}},"required":["workspace_id","workspace_slug","workspace_name","default_branch","linked_repo","latest_evaluation"]}},"parameters":{}},"paths":{"/api/v1/me":{"get":{"tags":["Identity"],"summary":"Get the authenticated identity","description":"Identity for the calling token: user id, email, name, and list of enterprise memberships.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Caller identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/rulesets":{"get":{"tags":["Personal rulesets"],"summary":"List personal rulesets","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"Page of rulesets.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RulesetSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Personal rulesets"],"summary":"Create a personal ruleset","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalRulesetCreateRequest"}}}},"responses":{"201":{"description":"Ruleset created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/rulesets/{rid}":{"get":{"tags":["Personal rulesets"],"summary":"Get a personal ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"responses":{"200":{"description":"Ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Personal rulesets"],"summary":"Update a personal ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalRulesetUpdateRequest"}}}},"responses":{"200":{"description":"Updated ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Personal rulesets"],"summary":"Delete a personal ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises":{"get":{"tags":["Enterprise"],"summary":"List enterprises the caller can access","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"A page of enterprise memberships.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseMembership"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}":{"get":{"tags":["Enterprise"],"summary":"Get enterprise details","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"}],"responses":{"200":{"description":"Enterprise.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Enterprise"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/integrations/github/installations":{"get":{"tags":["GitHub"],"summary":"List GitHub installations for an enterprise","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"Page of installations.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Installation"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/integrations/github/installations/{installation_id}/repos":{"get":{"tags":["GitHub"],"summary":"List repositories visible to an installation","description":"Feeds the `PUT .../repository` linker. Optional `?search=` filters by repo name.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"12345678","description":"Numeric GitHub installation id, as a string."},"required":true,"description":"Numeric GitHub installation id, as a string.","name":"installation_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Page of repositories.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Repo"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces":{"get":{"tags":["Workspace"],"summary":"List workspaces in an enterprise","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","example":"platform-team","description":"Filter to a single workspace by slug."},"required":false,"description":"Filter to a single workspace by slug.","name":"slug","in":"query"}],"responses":{"200":{"description":"A page of workspaces.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Workspace"],"summary":"Create a workspace","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreateRequest"}}}},"responses":{"201":{"description":"Workspace created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreateResult"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}":{"get":{"tags":["Workspace"],"summary":"Get workspace","description":"Workspace context (identity, linked repo). Use related endpoints for compliance, rulesets, etc.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"responses":{"200":{"description":"Workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Workspace"],"summary":"Update workspace metadata","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdateRequest"}}}},"responses":{"200":{"description":"Updated workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workspace"],"summary":"Delete a workspace","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/rulesets":{"get":{"tags":["Enterprise rulesets"],"summary":"List enterprise rulesets","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tag","in":"query"}],"responses":{"200":{"description":"Page of rulesets.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RulesetSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Enterprise rulesets"],"summary":"Create a ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseRulesetCreateRequest"}}}},"responses":{"201":{"description":"Ruleset created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/rulesets/{rid}":{"get":{"tags":["Enterprise rulesets"],"summary":"Get an enterprise ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"responses":{"200":{"description":"Ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Enterprise rulesets"],"summary":"Update an enterprise ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseRulesetUpdateRequest"}}}},"responses":{"200":{"description":"Updated ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Enterprise rulesets"],"summary":"Delete an enterprise ruleset","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/rulesets":{"get":{"tags":["Workspace rulesets"],"summary":"List rulesets relevant to a workspace, with current state","description":"Returns every ruleset relevant to the workspace — enterprise rulesets (both required and optional, even if the workspace hasn't opted into the optional ones), workspace-owned rulesets, and the calling user's rulesets (when authenticated as a user). Each row carries the workspace's stored opinion (`workspace_setting`) and the computed active state (`effective_enabled`). Use the PATCH endpoint at `/{rid}` to flip an optional enterprise ruleset's `workspace_setting`.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"Ruleset set for the workspace, with state.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceRulesetSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/rulesets/{rid}":{"patch":{"tags":["Workspace rulesets"],"summary":"Enable or disable an enterprise ruleset for a workspace","description":"Set the workspace's opinion about an enterprise ruleset. Workspaces can only toggle enterprise rulesets that are published (`enabled: true` at the enterprise level) and not marked `required` by the enterprise. The opinion is persisted: disabling a previously-enabled ruleset records an explicit opt-out (different from `never opted in`), so audit history is preserved.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":true,"description":"Ruleset identifier (opaque).","name":"rid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRulesetSettingUpdateRequest"}}}},"responses":{"200":{"description":"Updated workspace ruleset setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRulesetSetting"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/repository":{"get":{"tags":["Repository"],"summary":"Get the connected repository","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"responses":{"200":{"description":"Connected repository.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedRepository"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Repository"],"summary":"Disconnect the workspace from GitHub","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"responses":{"204":{"description":"Disconnected."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Repository"],"summary":"Connect a repository to this workspace","description":"Idempotent: PUT with the same body has no effect. Replacing an existing connection with a different repo is not currently supported. Disconnect first.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoLinkRequest"}}}},"responses":{"200":{"description":"Connected repository.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedRepository"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/compliance/evaluations":{"post":{"tags":["Compliance"],"summary":"Run a compliance evaluation","description":"Returns 202 with a queued evaluation. Poll the resource for status.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationTriggerRequest"}}}},"responses":{"202":{"description":"Queued evaluation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Compliance"],"summary":"List evaluations","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Page size (1-100). Defaults to 50."},"required":false,"description":"Page size (1-100). Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Filter to a single branch."},"required":false,"description":"Filter to a single branch.","name":"branch","in":"query"},{"schema":{"type":"string","example":"completed","description":"Filter by evaluation status (e.g. running, completed, error)."},"required":false,"description":"Filter by evaluation status (e.g. running, completed, error).","name":"status","in":"query"}],"responses":{"200":{"description":"Page of evaluations.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}}},"required":["data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/compliance/evaluations/latest":{"get":{"tags":["Compliance"],"summary":"Latest evaluation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"string","description":"Branch or commit SHA override."},"required":false,"description":"Branch or commit SHA override.","name":"ref","in":"query"}],"responses":{"200":{"description":"Latest evaluation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/compliance/evaluations/{eval_id}":{"get":{"tags":["Compliance"],"summary":"Get a specific evaluation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0004abcdxyzqwert","description":"Compliance evaluation identifier (opaque)."},"required":true,"description":"Compliance evaluation identifier (opaque).","name":"eval_id","in":"path"}],"responses":{"200":{"description":"Evaluation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/compliance/evaluations/{eval_id}/findings":{"get":{"tags":["Compliance"],"summary":"List findings for an evaluation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0004abcdxyzqwert","description":"Compliance evaluation identifier (opaque)."},"required":true,"description":"Compliance evaluation identifier (opaque).","name":"eval_id","in":"path"},{"schema":{"type":"string","enum":["pass","fail","not_applicable","inconclusive","not_code_verifiable"],"description":"Four-step decision ladder: not_code_verifiable -> not_applicable -> inconclusive -> pass|fail. Only pass and fail count toward the score."},"required":false,"description":"Four-step decision ladder: not_code_verifiable -> not_applicable -> inconclusive -> pass|fail. Only pass and fail count toward the score.","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Ruleset identifier (opaque)."},"required":false,"description":"Ruleset identifier (opaque).","name":"ruleset_id","in":"query"}],"responses":{"200":{"description":"Findings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingsResult"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/workspaces/{wid}/compliance/eval-spec":{"get":{"tags":["Compliance"],"summary":"Get the current evaluation spec","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"}],"responses":{"200":{"description":"Eval spec.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalSpec"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/enterprises/{eid}/compliance/latest":{"get":{"tags":["Enterprise compliance"],"summary":"Get latest scores for all workspaces","description":"Returns the latest compliance evaluation for every workspace you can see in this enterprise, in a single call. Built for dashboards and CI gates that need a full compliance snapshot without fanning out one request per workspace.\n\nUse `branch=default` to get each workspace's score on its own default branch (the common case). Pass a literal branch name to filter every workspace to that branch, or omit `branch` for the most recent evaluation regardless of branch.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0000abcdxyzqwert","description":"Enterprise identifier (opaque)."},"required":true,"description":"Enterprise identifier (opaque).","name":"eid","in":"path"},{"schema":{"type":"string","example":"default","description":"`default` resolves to each workspace's own default branch. Any other value is a literal branch name applied to every workspace."},"required":false,"description":"`default` resolves to each workspace's own default branch. Any other value is a literal branch name applied to every workspace.","name":"branch","in":"query"}],"responses":{"200":{"description":"Latest evaluation per accessible workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseComplianceLatestResult"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Endpoint is documented but not yet implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}