{"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":"Version control","description":"Version-control connections (GitHub, GitLab, …) and their 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","Version control","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,"description":"Count of standard workspaces in this enterprise — matches what `GET .../workspaces` returns with no `kinds` filter. Excludes template and module workspaces; pass `kinds=STANDARD,TEMPLATE,MODULE` on that endpoint to see the full set."}},"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"}},"version":{"type":"integer","minimum":0,"description":"The ruleset's current published version — the number users cite (\"v7\"). Every approved change to rule content mints the next one; `0` means nothing has been published yet, which is the resting state of a ruleset created with no rules. Ruleset metadata (title, description, tags) is not versioned, so editing it leaves this unchanged."}},"required":["id","slug","title","description","scope","enabled","required","rule_summary","tags","version"]},"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"}},"version":{"type":"integer","minimum":0,"description":"The ruleset's current published version — the number users cite (\"v7\"). Every approved change to rule content mints the next one; `0` means nothing has been published yet, which is the resting state of a ruleset created with no rules. Ruleset metadata (title, description, tags) is not versioned, so editing it leaves this unchanged."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"},"description":"The rules as published in `version`."}},"required":["id","slug","title","description","scope","enabled","required","tags","version","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."},"enabled":{"type":"boolean","description":"Whether this individual rule is currently active. A disabled rule stays in the ruleset (e.g. to re-enable later) but is never evaluated or counted toward a workspace's active rule total."},"order":{"type":"integer"}},"required":["id","slug","title","content","required","enabled","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"]},"EnterpriseResources":{"type":"object","properties":{"rulesets":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseResource"}},"mcp_servers":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseResource"}},"workflows":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseResource"}}},"required":["rulesets","mcp_servers","workflows"]},"EnterpriseResource":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"required":{"type":"boolean","description":"Whether workspaces in this enterprise must attach this resource."}},"required":["id","slug","name","description","required"]},"ModuleList":{"type":"object","properties":{"modules":{"type":"array","items":{"$ref":"#/components/schemas/Module"}}},"required":["modules"]},"Module":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"source_url":{"type":"string","description":"Source URL to reference from IaC. Pin with `?ref=<tag>`.","example":"https://github.com/acme/terraform-aws-vpc"},"versions":{"type":"array","items":{"type":"string"},"description":"Live tag list from the repo's version-control provider at request time."},"latest_version":{"type":["string","null"],"description":"First entry of `versions`, when present."}},"required":["id","name","description","source_url","versions","latest_version"]},"VcsConnection":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0004abcdxyzqwert","description":"Version-control connection identifier (opaque)."},"provider":{"type":"string","example":"gitlab","description":"Provider key: `github` | `gitlab` | … (more providers over time)."},"host":{"type":"string","example":"gitlab.com"},"account":{"type":"string","example":"acme-group","description":"The account/organization/namespace the connection is authenticated as."},"account_type":{"type":["string","null"],"example":"Organization","description":"GitHub connections only: `User` | `Organization`. Null for other providers."}},"required":["id","provider","host","account","account_type"]},"VcsRepo":{"type":"object","properties":{"provider":{"type":"string","example":"gitlab"},"path":{"type":"string","example":"acme-group/platform/infra","description":"Full provider path, including GitLab subgroups. This is the value to link with: split on the LAST slash for `owner`/`name` (`owner` keeps the namespace)."},"name":{"type":"string","example":"infra"},"default_branch":{"type":"string","example":"main"},"visibility":{"type":"string","example":"private"},"web_url":{"type":"string","example":"https://gitlab.com/acme-group/platform/infra"}},"required":["provider","path","name","default_branch","visibility","web_url"]},"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"},"repository_linked":{"anyOf":[{"type":"boolean","enum":[true]},{"type":"boolean","enum":[false]},{"type":"null"}],"description":"true = repo linked successfully. false = a repo was requested but the link failed (see repository_error). null = no repo requested. Callers MUST check this whenever they pass `repository`."},"repository_error":{"type":"string","description":"Set when repository_linked is false. The workspace exists; this explains why the link failed and how to recover (retry via PUT .../repository)."},"warning":{"type":"string","description":"Present when the repo linked but its delivery webhook couldn't be registered — the workspace is connected but has NO push-driven compliance until re-linked. Distinct from repository_error (the link itself succeeded). Surface this to the user."}},"required":["workspace","repository_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"}},"repository":{"type":"object","properties":{"connection_id":{"type":"string","minLength":1,"description":"Version-control connection the repo lives in — any provider (GitHub, GitLab, …). Get this from `/integrations/vcs/connections`."},"path":{"type":"string","minLength":1,"example":"acme-group/platform/infra","description":"Full provider path of the repo, exactly as returned by `/integrations/vcs/connections/{connection_id}/repos`. GitLab subgroups included."},"branch":{"type":"string","minLength":1,"example":"main"}},"required":["connection_id","path","branch"],"description":"Optional repository 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."}}},"WorkspaceResourceUpdateResult":{"type":"object","properties":{"workspace_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"added":{"type":"object","properties":{"rulesets":{"type":"integer","minimum":0},"mcp_servers":{"type":"integer","minimum":0},"workflows":{"type":"integer","minimum":0}},"required":["rulesets","mcp_servers","workflows"],"description":"Count of resources newly attached, by type."},"removed":{"type":"object","properties":{"rulesets":{"type":"integer","minimum":0},"mcp_servers":{"type":"integer","minimum":0},"workflows":{"type":"integer","minimum":0}},"required":["rulesets","mcp_servers","workflows"],"description":"Count of resources detached, by type."}},"required":["workspace_id","added","removed"]},"WorkspaceResourceUpdateRequest":{"type":"object","properties":{"add_ruleset_ids":{"type":"array","items":{"type":"string","minLength":1},"description":"Enterprise resource IDs."},"remove_ruleset_ids":{"type":"array","items":{"type":"string","minLength":1},"description":"Enterprise resource IDs."},"add_mcp_server_ids":{"type":"array","items":{"type":"string","minLength":1},"description":"Enterprise resource IDs."},"remove_mcp_server_ids":{"type":"array","items":{"type":"string","minLength":1},"description":"Enterprise resource IDs."},"add_workflow_ids":{"type":"array","items":{"type":"string","minLength":1},"description":"Enterprise resource IDs."},"remove_workflow_ids":{"type":"array","items":{"type":"string","minLength":1},"description":"Enterprise resource IDs."}}},"WorkspaceContext":{"oneOf":[{"$ref":"#/components/schemas/WorkspaceContextLinked"},{"$ref":"#/components/schemas/WorkspaceContextUnlinked"},{"$ref":"#/components/schemas/WorkspaceContextNoAccess"},{"$ref":"#/components/schemas/WorkspaceContextAmbiguous"}],"discriminator":{"propertyName":"status","mapping":{"linked":"#/components/schemas/WorkspaceContextLinked","unlinked":"#/components/schemas/WorkspaceContextUnlinked","no_access":"#/components/schemas/WorkspaceContextNoAccess","ambiguous":"#/components/schemas/WorkspaceContextAmbiguous"}}},"WorkspaceContextLinked":{"type":"object","properties":{"status":{"type":"string","enum":["linked"]},"workspace":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"created_at":{"type":"string"},"enterprise":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"repo":{"type":["object","null"],"properties":{"owner":{"type":"string"},"name":{"type":"string"}},"required":["owner","name"]}},"required":["id","name","slug","description","created_at","enterprise","repo"]},"coding_guidelines":{"type":"object","properties":{"iac_tool":{"type":["string","null"]},"content":{"type":"string"}},"required":["iac_tool","content"]},"rulesets":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Active rulesets for this workspace. Call get_ruleset_details for full rules."},"governance":{"type":"object","properties":{"ci_blocking_rules_total":{"type":"number"},"notice":{"type":"string"}},"required":["ci_blocking_rules_total","notice"]},"compliance":{"type":"object","properties":{"latest_evaluation":{"type":["object","null"],"additionalProperties":{}}},"required":["latest_evaluation"]},"modules":{"type":"object","properties":{"status":{"type":"string","enum":["ok","unavailable"]},"count":{"type":"number"},"hint":{"type":["string","null"]}},"required":["status","count","hint"]},"next_steps":{"type":"string"}},"required":["status","workspace","coding_guidelines","rulesets","governance","compliance","modules","next_steps"]},"WorkspaceContextUnlinked":{"type":"object","properties":{"status":{"type":"string","enum":["unlinked"]},"owner":{"type":"string"},"name":{"type":"string"},"message":{"type":"string"}},"required":["status","owner","name","message"]},"WorkspaceContextNoAccess":{"type":"object","properties":{"status":{"type":"string","enum":["no_access"]},"owner":{"type":"string"},"name":{"type":"string"},"message":{"type":"string"}},"required":["status","owner","name","message"]},"WorkspaceContextAmbiguous":{"type":"object","properties":{"status":{"type":"string","enum":["ambiguous"]},"owner":{"type":"string"},"name":{"type":"string"},"message":{"type":"string"},"candidates":{"type":"array","items":{"type":"object","properties":{"workspace_id":{"type":"string"},"enterprise":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]}},"required":["workspace_id","enterprise"]}}},"required":["status","owner","name","message","candidates"]},"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":{"provider":{"type":"string","example":"gitlab","description":"Provider key: `github` | `gitlab` | …."},"path":{"type":"string","example":"acme-group/platform/infra","description":"Full provider path, including GitLab subgroups."},"name":{"type":"string","example":"infra"},"branch":{"type":["string","null"],"example":"main","description":"Default branch tracked by the workspace."},"warning":{"type":"string","description":"Present when the repo linked but its delivery webhook couldn't be registered — the workspace is connected but has NO push-driven compliance until re-linked. Surface this to the user; a swallowed failure reads as coverage that isn't there. Only returned by the PUT (link) response."}},"required":["provider","path","name","branch"]},"RepoLinkRequest":{"type":"object","properties":{"connection_id":{"type":"string","minLength":1,"description":"Version-control connection the repo lives in — any provider (GitHub, GitLab, …). Get this from `/integrations/vcs/connections`."},"path":{"type":"string","minLength":1,"example":"acme-group/platform/infra","description":"Full provider path of the repo, exactly as returned by `/integrations/vcs/connections/{connection_id}/repos`. GitLab subgroups included."},"branch":{"type":"string","minLength":1,"example":"main"}},"required":["connection_id","path","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 CI gating enabled — that toggle separately controls webhook auto-run and posting the merge gate to the provider (GitHub check run / GitLab commit status), 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)."},"url":{"type":"string","example":"https://app.infracodebase.com/acme/my-workspace/compliance/cmaxw7q3w0004abcdxyzqwert","description":"Link to this evaluation's results page in the app."},"deduped":{"type":"boolean","example":true,"description":"Present (true) on trigger responses when no new run was started: an existing evaluation covering the requested scope — an in-flight run (a running full evaluation covers any request), or a completed identical run reused by dedup — was adopted and returned instead. Absent on reads and on triggers that started a fresh run."},"requested_scope":{"type":"string","enum":["full","ruleset","rule","rules"],"example":"rules","description":"The scope the trigger asked for. Present only when `deduped` is true."},"effective_scope":{"type":"string","example":"full","description":"The adopted run's actual scope. Present only when `deduped` is true — compare with `requested_scope` to see how the request was widened (e.g. a `rule_ids` batch adopted into a running full push-triggered evaluation)."}},"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","url"]},"EvaluationTriggerRequest":{"type":"object","properties":{"ref":{"type":"string","description":"Commit SHA, branch, or tag to evaluate. Omit to evaluate the workspace's current checkout (its interactively-edited state, with any uncommitted changes committed first), which may lag the remote branch tip. Pass a branch name to evaluate that branch's current pushed commit and record the branch on the run. Pass a commit SHA to evaluate that exact pushed commit; no branch is recorded."},"ruleset_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0002abcdxyzqwert","description":"Scope the run to a single ruleset. Other rules' findings carry forward from the rollforward baseline unchanged. Omit for a full evaluation."},"rule_id":{"type":"string","minLength":1,"example":"cmaxw7q3w0003abcdxyzqwert","description":"Scope the run to a single rule. Mutually exclusive with rule_ids. Omit for a full evaluation."},"rule_ids":{"type":"array","items":{"type":"string","minLength":1,"example":"cmaxw7q3w0003abcdxyzqwert","description":"Rule identifier (opaque)."},"description":"Scope the run to a batch of specific rules, e.g. the rules just fixed in a commit. Mutually exclusive with rule_id. Omit for a full evaluation."}}},"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 repository as `owner/name` (any provider — GitHub, GitLab, …). Null if no repo is linked. Use this when you need the real 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."}]},"stale":{"type":"boolean","description":"True when the branch has moved past the evaluation `latest_evaluation` is based on (the last observed branch tip has no completed evaluation). The result is the best available answer, not a statement about the branch's current code."}},"required":["workspace_id","workspace_slug","workspace_name","default_branch","linked_repo","latest_evaluation","stale"]}},"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}/resources":{"get":{"tags":["Enterprise"],"summary":"List available rulesets, MCP servers, and workflows","description":"Return the rulesets, MCP servers, and workflows available in an enterprise. Each resource has a `required` flag indicating whether workspaces must include it. Use this before creating a workspace to understand what resources to attach.","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":"Available enterprise resources.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseResources"}}}},"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}/modules":{"get":{"tags":["Enterprise"],"summary":"List approved reusable IaC modules","description":"Return the enterprise's approved reusable infrastructure modules — workspaces that have been explicitly marked as a `module` and are referenceable from generated IaC. Each module returns its `source_url` (the repo URL to reference from IaC) and `versions` (live tag list from the repo's version-control provider at request time). Returns only modules the caller has permission to see in this 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"}],"responses":{"200":{"description":"Approved IaC modules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleList"}}}},"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/vcs/connections":{"get":{"tags":["Version control"],"summary":"List version-control connections for an enterprise","description":"Every usable connected source (GitHub orgs/accounts, GitLab connections, …), each addressable by `connection_id`. Optional `?provider=` filters to one provider key.","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":"gitlab"},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"Page of connections.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VcsConnection"}}},"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/vcs/connections/{connection_id}/repos":{"get":{"tags":["Version control"],"summary":"List repositories visible to a connection","description":"Answers identically for every provider. Feeds the `PUT .../repository` linker via each repo's `path`. Optional `?search=` filters by 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":"cmaxw7q3w0004abcdxyzqwert","description":"Version-control connection identifier (opaque)."},"required":true,"description":"Version-control connection identifier (opaque).","name":"connection_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/VcsRepo"}}},"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"},{"schema":{"type":"string","example":"STANDARD,TEMPLATE,MODULE","description":"Comma-separated workspace kinds to include: STANDARD, TEMPLATE, MODULE. Defaults to STANDARD only — templates and modules are platform assets callers must opt in to see."},"required":false,"description":"Comma-separated workspace kinds to include: STANDARD, TEMPLATE, MODULE. Defaults to STANDARD only — templates and modules are platform assets callers must opt in to see.","name":"kinds","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}/workspaces/{wid}/resources":{"patch":{"tags":["Workspace"],"summary":"Add or remove workspace resources","description":"Attach or detach rulesets, MCP servers, and workflows on an existing workspace. Separate from the metadata PATCH because it gates on the per-resource `*.manage` permissions rather than `settings.update`. Each list is optional and additive/subtractive; required resources cannot be removed. The result reports how many of each type actually changed (unknown or non-enterprise IDs are ignored).","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/WorkspaceResourceUpdateRequest"}}}},"responses":{"200":{"description":"Resource changes applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResourceUpdateResult"}}}},"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}/context":{"get":{"tags":["Workspace"],"summary":"Get full workspace context","description":"Return everything needed to write infrastructure code for this workspace: workspace identity, applicable rulesets (metadata only - call GET /enterprises/{eid}/rulesets/{rid} for full rules), coding guidelines, latest compliance state, and approved module catalog summary. The response shape varies by status: `linked` when the workspace is accessible, `unlinked` when no workspace is linked to the repo, `no_access` when the workspace exists but the caller lacks permission, or `ambiguous` when multiple workspaces match the repo URL.","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","enum":["terraform","pulumi","cloudformation","bicep","kubernetes","ansible"],"description":"Optional IaC tool to include tool-specific coding guidelines for."},"required":false,"description":"Optional IaC tool to include tool-specific coding guidelines for.","name":"iac_tool","in":"query"}],"responses":{"200":{"description":"Workspace context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceContext"}}}},"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/workspace-context":{"get":{"tags":["Workspace"],"summary":"Resolve a repo URL (or workspace ID) to full workspace context","description":"Same response shape as GET /enterprises/{eid}/workspaces/{wid}/context, but doesn't require already knowing the enterprise or workspace ID. Pass `repo_url` (from the repo's git remote) to resolve by repo, or `workspace_id` directly if already known. Exactly one is required.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"https://github.com/acme/infra","description":"Git remote URL of the repo — any provider. Examples: https://github.com/owner/name, https://gitlab.com/group/subgroup/project, git@gitlab.com:group/subgroup/project.git, or a bare path like owner/name. Provide this or workspace_id."},"required":false,"description":"Git remote URL of the repo — any provider. Examples: https://github.com/owner/name, https://gitlab.com/group/subgroup/project, git@gitlab.com:group/subgroup/project.git, or a bare path like owner/name. Provide this or workspace_id.","name":"repo_url","in":"query"},{"schema":{"type":"string","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace ID, if already known. Provide this or repo_url."},"required":false,"description":"Workspace ID, if already known. Provide this or repo_url.","name":"workspace_id","in":"query"},{"schema":{"type":"string","enum":["terraform","pulumi","cloudformation","bicep","kubernetes","ansible"],"description":"Optional IaC tool to include tool-specific coding guidelines for."},"required":false,"description":"Optional IaC tool to include tool-specific coding guidelines for.","name":"iac_tool","in":"query"}],"responses":{"200":{"description":"Workspace context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceContext"}}}},"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 its 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":{"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","description":"With no `ref` or `branch`, resolves to the most recent completed evaluation for the workspace's current branch — falling back to the workspace's default branch, then to the most recent completed evaluation on any 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","minLength":1,"example":"cmaxw7q3w0001abcdxyzqwert","description":"Workspace identifier (opaque)."},"required":true,"description":"Workspace identifier (opaque).","name":"wid","in":"path"},{"schema":{"type":"string","description":"Evaluation id or commit SHA override."},"required":false,"description":"Evaluation id or commit SHA override.","name":"ref","in":"query"},{"schema":{"type":"string","description":"Scope 'latest' to this branch. Falls back to the workspace's default branch, then to the most recent completed evaluation on any branch. Ignored if `ref` is given."},"required":false,"description":"Scope 'latest' to this branch. Falls back to the workspace's default branch, then to the most recent completed evaluation on any branch. Ignored if `ref` is given.","name":"branch","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/latest/findings":{"get":{"tags":["Compliance"],"summary":"List findings for the latest evaluation","description":"Findings for the workspace's latest completed evaluation. Mirrors `evaluations/latest` so clients that don't already hold an evaluation id can fetch findings in one request instead of resolving the id 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"},{"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/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":{}}