{
  "openapi": "3.1.0",
  "info": {
    "title": "ModernCI API",
    "version": "pre-release (32cae87556)",
    "description": "Pre-launch. Generated from the operation table in the ModernCI source (crates/mci-api/src/ops.rs), which drives the REST API, MCP tools and CLI. The base URL is your region's API; paths and fields may change before launch."
  },
  "servers": [
    {
      "url": "https://{region}",
      "variables": {
        "region": {
          "default": "your-region.example",
          "description": "The API host of the region that holds your project"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API token created by a tenant admin (mci tokens create)"
      }
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health.get",
        "summary": "Is this install up",
        "security": [],
        "x-modernci-auth": "public",
        "x-modernci-status": "available",
        "x-cli": "mci health",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/health/detail": {
      "get": {
        "operationId": "health.detail",
        "summary": "Health with the engine lease holder, server version and standing alarms",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci health detail",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/auth/methods": {
      "get": {
        "operationId": "auth.methods",
        "summary": "Which sign-in methods this install offers",
        "security": [],
        "x-modernci-auth": "public",
        "x-modernci-status": "available",
        "x-cli": "mci auth methods",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/probe/canned": {
      "post": {
        "operationId": "probe.canned",
        "summary": "Run the canned PR request end to end for the outside prober",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/tokens": {
      "post": {
        "operationId": "tokens.create",
        "summary": "Create a person or agent with a token (shown once)",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci tokens create",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/support-access": {
      "post": {
        "operationId": "support.grant",
        "summary": "Let the platform operator support this tenant for a limited time",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci support grant",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/support-access/{tenant}": {
      "delete": {
        "operationId": "support.revoke",
        "summary": "End operator support access to this tenant",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci support revoke",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/audit": {
      "get": {
        "operationId": "audit.list",
        "summary": "Read a tenant's audit log",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci audit",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/delegated-approval": {
      "put": {
        "operationId": "delegated.set",
        "summary": "Turn delegated-approval mode on or off for the named tenant",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci delegated set",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/repos/{repo}/prs": {
      "get": {
        "operationId": "prs.list",
        "summary": "List PRs with their status and wait reason",
        "parameters": [
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "queue_status",
        "x-cli": "mci prs list",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}": {
      "get": {
        "operationId": "prs.get",
        "summary": "Show one PR: diff, checks, logs, approvals, cost, wait reason",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci prs show",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs": {
      "post": {
        "operationId": "prs.done",
        "summary": "Submit a pushed branch as a PR and leave",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "done",
        "x-cli": "mci prs done",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      },
      "get": {
        "operationId": "prs.search",
        "summary": "Search PRs across the repos I can see",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci prs search",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/claim": {
      "post": {
        "operationId": "prs.claim",
        "summary": "Claim an unclaimed PR",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci prs claim",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/work": {
      "get": {
        "operationId": "work.mine",
        "summary": "My open work: reds, conflicts, approvals",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "my_work",
        "x-cli": "mci work",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/work/{item}/claim": {
      "post": {
        "operationId": "work.claim",
        "summary": "Claim a work item",
        "parameters": [
          {
            "name": "item",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "claim",
        "x-cli": "mci work claim",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/work/{item}/report": {
      "post": {
        "operationId": "work.report",
        "summary": "Report progress and agent spend",
        "parameters": [
          {
            "name": "item",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "report",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/work/{item}/ask": {
      "post": {
        "operationId": "work.ask",
        "summary": "Ask a person a question about a work item",
        "parameters": [
          {
            "name": "item",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "ask",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/work/{item}/release": {
      "post": {
        "operationId": "work.release",
        "summary": "Let go of a claimed work item",
        "parameters": [
          {
            "name": "item",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "release",
        "x-cli": "mci work release",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/dequeue": {
      "post": {
        "operationId": "prs.dequeue",
        "summary": "Take my PR out of the merge queue",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "dequeue",
        "x-cli": "mci prs dequeue",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/queue-exits": {
      "get": {
        "operationId": "prs.queue_exits",
        "summary": "Why a PR left the merge queue",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "why_left_queue",
        "x-cli": "mci prs why-left",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/activity": {
      "get": {
        "operationId": "prs.activity",
        "summary": "Activity log of a PR: pushes, checks, approvals, queue exits",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "activity",
        "x-cli": "mci prs activity",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/requests/pause": {
      "post": {
        "operationId": "requests.pause",
        "summary": "Ask a person to pause or resume runs in a project",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "pause_request",
        "x-cli": "mci request pause",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/config/check": {
      "post": {
        "operationId": "config.check",
        "summary": "Check .ci files: schema errors with file and line",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "config_check",
        "x-cli": "mci config check",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/config/simulate": {
      "post": {
        "operationId": "config.simulate",
        "summary": "What a .ci change would run, and whether it changes the gate",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "config_simulate",
        "x-cli": "mci config simulate",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects/{project}/savings": {
      "get": {
        "operationId": "savings.get",
        "summary": "Spend, waste and agent spend for a project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "savings",
        "x-cli": "mci savings",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/agents/bundle": {
      "get": {
        "operationId": "agents.bundle",
        "summary": "The agent skill bundle for a client, generated from this table",
        "security": [],
        "x-modernci-auth": "public",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/agents/errors": {
      "get": {
        "operationId": "agents.errors",
        "summary": "The closed agent error catalogue",
        "security": [],
        "x-modernci-auth": "public",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events.watch",
        "summary": "Stream my events with replay from a sequence number",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "watch",
        "x-cli": "mci watch",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/log": {
      "get": {
        "operationId": "runs.log",
        "summary": "Read a run's log",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "log",
        "x-cli": "mci log",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/checks/{check}/rerun": {
      "post": {
        "operationId": "checks.rerun",
        "summary": "Re-run a check with a stated reason",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "check",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "coming",
        "x-cli": "mci checks rerun",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/approvals": {
      "post": {
        "operationId": "approvals.create",
        "summary": "Approve or reject a guarded change with a passkey",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "passkey",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/signer/keys": {
      "get": {
        "operationId": "signer.keys.pending",
        "summary": "Signer keys waiting for owner approval: each key's purpose, kind, rotation and new public key",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/signer/keys/challenge": {
      "post": {
        "operationId": "signer.keys.challenge",
        "summary": "Get a passkey challenge bound to the exact signer key request",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/signer/keys/approve": {
      "post": {
        "operationId": "signer.keys.approve",
        "summary": "Approve the signer key request with a passkey; the signer verifies it itself",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/passkeys": {
      "get": {
        "operationId": "passkeys.list",
        "summary": "My passkeys in this region and whether each is confirmed; for a tenant admin, members' passkeys waiting for confirmation",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci passkeys list",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/passkeys/bind/challenge": {
      "post": {
        "operationId": "passkeys.bind.challenge",
        "summary": "Get a passkey challenge that confirms one passkey here (cosigned by another of mine, confirmed by a tenant admin, enrolled with a code from the operator) or proves I hold it",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/passkeys/bind": {
      "post": {
        "operationId": "passkeys.bind",
        "summary": "Confirm a passkey here with an assertion by a passkey already confirmed here (mine, or a tenant admin's for a member)",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/passkeys/enrol": {
      "post": {
        "operationId": "passkeys.enrol",
        "summary": "Confirm my first passkey here with the one-time code from the operator and an assertion by that passkey",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/passkeys/revoke": {
      "post": {
        "operationId": "passkeys.revoke",
        "summary": "Revoke a passkey here (mine, or a member's as a tenant admin): it never approves again",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/settings/{level}/{scope}/{setting}": {
      "get": {
        "operationId": "settings.get",
        "summary": "Effective value of a setting, where it comes from, and its lock",
        "parameters": [
          {
            "name": "level",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "setting",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci settings get",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      },
      "put": {
        "operationId": "settings.set",
        "summary": "Set or lock a setting at a level",
        "parameters": [
          {
            "name": "level",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "setting",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci settings set",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/tenants": {
      "post": {
        "operationId": "tenants.create",
        "summary": "Create a tenant",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci tenants create",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects": {
      "post": {
        "operationId": "projects.create",
        "summary": "Create a project",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci projects create",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects/{project}/repos": {
      "post": {
        "operationId": "repos.create",
        "summary": "Add a repo to a project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci repos add",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/forges": {
      "post": {
        "operationId": "forges.connect",
        "summary": "Choose the forge plugin for a tenant or project, with its config",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci forges connect",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/computes": {
      "post": {
        "operationId": "computes.connect",
        "summary": "Choose the compute plugin for a tenant or project, with its config and overflow classes",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci computes connect",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/roles": {
      "post": {
        "operationId": "roles.grant",
        "summary": "Grant a role",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci roles grant",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/roles/revoke": {
      "post": {
        "operationId": "roles.revoke",
        "summary": "Take a role away",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci roles revoke",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/members": {
      "get": {
        "operationId": "members.list",
        "summary": "List a tenant's people and agents with their roles",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci members",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects/{project}/secrets/{name}": {
      "put": {
        "operationId": "secrets.put",
        "summary": "Write a secret (write-only)",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "coming",
        "x-cli": "mci secrets put",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/pause": {
      "post": {
        "operationId": "runs.pause",
        "summary": "Pause new runs at a scope",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci pause",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/resume": {
      "post": {
        "operationId": "runs.resume",
        "summary": "Resume runs at a scope",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci resume",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/stop": {
      "post": {
        "operationId": "runs.stop",
        "summary": "Stop: pause and cancel running jobs",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci stop",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/plan": {
      "get": {
        "operationId": "runs.plan",
        "summary": "Jobs and worst-case cost that would start now",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "coming",
        "x-cli": "mci plan",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "me.get",
        "summary": "Who I am: identity, tenant, roles, passkeys",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci me",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/users/link": {
      "post": {
        "operationId": "users.link",
        "summary": "Link a globally signed-in user to an identity of this tenant",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci users link",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/repos": {
      "get": {
        "operationId": "repos.list",
        "summary": "Repos I can see, with open and red PR counts",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci repos list",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/diff": {
      "get": {
        "operationId": "prs.diff",
        "summary": "A PR's diff against its target, guarded files marked",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci prs diff",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/prs/{pr}/approvals/challenge": {
      "post": {
        "operationId": "approvals.challenge",
        "summary": "Get a passkey challenge bound to a PR's exact head and guarded files",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/repos/{repo}/promotions": {
      "get": {
        "operationId": "promotions.list",
        "summary": "List promotion, revert and reconcile PRs: kind, source, target, promoted commit, hold reason, checks",
        "parameters": [
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "promotions",
        "x-cli": "mci promotion list",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/promotions/{pr}": {
      "get": {
        "operationId": "promotions.get",
        "summary": "Show one promotion, revert or reconcile PR with its checks, approvals and hold reason",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci promotion show",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/repos/{repo}/promotion-status": {
      "get": {
        "operationId": "promotion.status",
        "summary": "Each promotion pair of a repo (dev -> qa -> main): tips, what is ahead, held and why",
        "parameters": [
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "promotion_status",
        "x-cli": "mci promotion status",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/promotions/{pr}/challenge": {
      "post": {
        "operationId": "promotion.challenge",
        "summary": "Start a passkey ceremony bound to a promotion's exact commit and the guarded files it changes",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/promotions/{pr}/approvals": {
      "post": {
        "operationId": "promotion.approve",
        "summary": "Approve a promotion, or reject it with a reason (which opens the revert), with a person's passkey",
        "parameters": [
          {
            "name": "pr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "passkey",
        "x-modernci-status": "available",
        "x-cli": "mci promotion approve",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/settings/{level}/{scope}": {
      "get": {
        "operationId": "settings.list",
        "summary": "Every setting and feature at a level, with value, source and lock",
        "parameters": [
          {
            "name": "level",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci settings list",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/stats": {
      "get": {
        "operationId": "stats.flow",
        "summary": "Merge queue flow: PRs arrived, landed and red, cost, time to land",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci stats",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/events/ack": {
      "post": {
        "operationId": "events.ack",
        "summary": "Acknowledge my events up to a sequence number",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-mcp-tool": "ack",
        "x-cli": "mci ack",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects/{project}/runs": {
      "get": {
        "operationId": "runs.list",
        "summary": "Runs started with `mci run`, newest first, by status and requester",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      },
      "post": {
        "operationId": "run.create",
        "summary": "Start an on-demand run, or reuse an identical earlier result of yours",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects/{project}/runs/quote": {
      "post": {
        "operationId": "run.quote",
        "summary": "Estimate the cost and duration of an on-demand run",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/projects/{project}/workspace/sync": {
      "post": {
        "operationId": "workspace.sync",
        "summary": "Find the nearest commit the region already has, to send only a diff",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/context": {
      "put": {
        "operationId": "run.upload",
        "summary": "Upload an on-demand run's working tree",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      },
      "get": {
        "operationId": "run.context",
        "summary": "A runner downloads the working tree of the on-demand run it runs",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-modernci-auth": "job token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/events": {
      "get": {
        "operationId": "run.attach",
        "summary": "Stream an on-demand run's output and result",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/cancel": {
      "post": {
        "operationId": "run.cancel",
        "summary": "Stop an on-demand run (Ctrl-C)",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute": {
      "get": {
        "operationId": "compute.overview",
        "summary": "Runners, pools, cloud accounts, placement and spend at a glance",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci compute",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/runners/enrol": {
      "post": {
        "operationId": "runners.enrol",
        "summary": "Add a runner from the console: the commands to run and an enrolment to watch",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "passkey",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/runners/enrol/{code}": {
      "get": {
        "operationId": "runners.enrolment",
        "summary": "A runner enrolment by its code: the machine, its scope and status",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci runners enrolment",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/runners/enrol/{code}/approve": {
      "post": {
        "operationId": "runners.approve",
        "summary": "Approve or deny a machine that asked to become a runner",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "passkey",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/runners/tokens": {
      "post": {
        "operationId": "runners.tokens.create",
        "summary": "Create a one-time registration token for unattended runners (shown once)",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "passkey",
        "x-modernci-status": "available",
        "x-cli": "mci runners token",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/machines/{machine}": {
      "get": {
        "operationId": "runners.status",
        "summary": "One runner: health, jobs, capabilities, policy",
        "parameters": [
          {
            "name": "machine",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci runners show",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      },
      "put": {
        "operationId": "runners.update",
        "summary": "Set a runner's labels and which jobs may use it",
        "parameters": [
          {
            "name": "machine",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      },
      "delete": {
        "operationId": "runners.deregister",
        "summary": "Remove a runner (it must be idle)",
        "parameters": [
          {
            "name": "machine",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci runners remove",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/machines/{machine}/drain": {
      "post": {
        "operationId": "runners.drain",
        "summary": "Let a runner finish its jobs and take no new ones",
        "parameters": [
          {
            "name": "machine",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci runners drain",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/machines/{machine}/resume": {
      "post": {
        "operationId": "runners.resume",
        "summary": "Let a drained runner take jobs again",
        "parameters": [
          {
            "name": "machine",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci runners resume",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/compute/pools/{pool}/spill": {
      "put": {
        "operationId": "pools.spill",
        "summary": "When a pool's jobs wait too long, run them on another pool within a daily spend",
        "parameters": [
          {
            "name": "pool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/live": {
      "get": {
        "operationId": "runs.live",
        "summary": "A running job live: phases, log, tests, resources, then the result",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/log/search": {
      "get": {
        "operationId": "runs.log_search",
        "summary": "Search a run's whole log",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-modernci-auth": "token",
        "x-modernci-status": "available",
        "x-cli": "mci log search",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/runs/{run}/report": {
      "post": {
        "operationId": "runs.report",
        "summary": "A runner reports a job's result",
        "parameters": [
          {
            "name": "run",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-modernci-auth": "job token",
        "x-modernci-status": "available",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    },
    "/v1/hooks/push/{forge}": {
      "post": {
        "operationId": "hooks.push",
        "summary": "Push notification from a git host",
        "parameters": [
          {
            "name": "forge",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-modernci-auth": "forge hook",
        "x-modernci-status": "coming",
        "responses": {
          "default": {
            "description": "JSON response"
          }
        }
      }
    }
  }
}
