Mogplex Docs
Reference

Sandboxes

GET /api/v1/mogplex/sandboxes lists the cloud sandboxes owned by the authenticated user, with optional filters for repo and status.

GET /api/v1/mogplex/sandboxes

Lists cloud sandboxes the caller owns. Useful for cleanup scripts, dashboards, or scoping a run to an existing branch.

v1 sandbox lifecycle routes (stop / pause / resume / get-by-id) are not yet exposed. They will land alongside the sandbox-lifecycle refactor. Until then, use the web UI at mogplex.com/sandboxes/{id} for lifecycle actions.

Scope

read — see Authentication → Scopes.

Query parameters

ParamTypeDefaultNotes
repo_idstringUUID; restrict to sandboxes for a single repo
statusstringe.g. running, paused, stopped, error
limitinteger1001–200

Example

export MOGPLEX_BASE_URL="https://www.mogplex.com"
export MOGPLEX_TOKEN="mog_..."

curl -sS \
  -H "Authorization: Bearer $MOGPLEX_TOKEN" \
  "$MOGPLEX_BASE_URL/api/v1/mogplex/sandboxes?status=running&limit=20"

Representative response:

{
  "ok": true,
  "data": {
    "sandboxes": [
      {
        "id": "sandbox-uuid",
        "sandbox_id": "vsb_acme_web_main",
        "repo_id": "8f3a2b1c-1234-4abc-9def-1234567890ab",
        "status": "running",
        "base_branch": "main",
        "working_branch": "feat/refactor-auth",
        "root_directory": null,
        "preview_url": "https://abc123.sandbox.mogplex.com",
        "created_at": "2026-05-17T10:14:00.000Z",
        "last_active_at": "2026-05-17T10:42:00.000Z"
      }
    ]
  }
}

Filter by repo:

curl -sS \
  -H "Authorization: Bearer $MOGPLEX_TOKEN" \
  "$MOGPLEX_BASE_URL/api/v1/mogplex/sandboxes?repo_id=8f3a2b1c-..."

Response shape

type MogplexApiSandbox = {
  id: string;                          // Mogplex sandbox record UUID
  sandbox_id: string | null;           // Underlying provider sandbox ID (may be null pre-allocation)
  repo_id: string;
  status: string;                       // e.g. "running", "paused", "stopped", "error"
  base_branch: string;
  working_branch: string;
  root_directory: string | null;        // Monorepo subpath
  preview_url: string | null;           // HTTPS URL to the running preview when applicable
  created_at: string;                   // ISO 8601
  last_active_at: string;               // ISO 8601 — most recent observed activity
};

Sandboxes are ordered by last_active_at desc (server-side default).

Errors

CodeHTTPCause
UNAUTHORIZED401Missing/invalid/expired PAT
RATE_LIMITED42960 req/min per PAT exceeded
INTERNAL_ERROR500Unexpected server error

See Errors for retry guidance.

CLI equivalent

mogplex sandboxes list                                  # pretty table
mogplex sandboxes list --json                           # NDJSON
mogplex sandboxes list --repo <repo-id> --status running

mogplex sandboxes stop <id> is a placeholder until the v1 lifecycle routes land. Today it points users at the web UI.

  • Repos — list repo_id values
  • Runs — sandboxes are created/used as runs execute
Edit on GitHub

On this page