openapi: 3.1.0
info:
  title: PlatPhorm Sandbox API
  version: 2.0.0-phase2
  description: "Safe execution, MCP tool testing, API testing, JSON-RPC replay, OpenAPI import, schema validation, webhook replay, dry-run, artifact capture, and pre-production experimentation for PlatPhormNews."
servers:
  - url: https://sandbox.platphormnews.com
    description: Production
components:
  securitySchemes:
    PlatPhormApiKey:
      type: apiKey
      in: header
      name: X-PlatPhorm-API-Key
      description: "Protected actions also accept Authorization: Bearer $PLATPHORM_API_KEY."
  schemas:
    ApiSuccess:
      type: object
      required:
        - ok
        - data
      properties:
        ok:
          const: true
        data:
          type: object
    ApiError:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
paths:
  /api/health:
    get:
      summary: Read Sandbox health summary
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/health:
    get:
      summary: Read versioned Sandbox health summary
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/docs:
    get:
      summary: Read this OpenAPI document as JSON
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /openapi.yaml:
    get:
      summary: Read this OpenAPI document as YAML
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /openapi.json:
    get:
      summary: Read this OpenAPI document as JSON
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /asyncapi.yaml:
    get:
      summary: Read the Sandbox lifecycle AsyncAPI document as YAML
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/request-access:
    get:
      summary: Read request-access dry-run and protected generation policy
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
    post:
      summary: Dry-run an access request publicly or generate a key with PLATPHORM_API_KEY authorization
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/status:
    get:
      summary: Read Sandbox lifecycle and Web4 status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/provider-status:
    get:
      summary: Read honest Vercel Sandbox provider status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/database-status:
    get:
      summary: Read honest persistence status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/templates:
    get:
      summary: List deterministic Sandbox templates
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/templates/{id}:
    get:
      summary: Read one deterministic Sandbox template
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/runs:
    get:
      summary: List public-safe Sandbox runs or degraded persistence state
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/runs/{id}:
    get:
      summary: Read one public-safe run or degraded persistence state
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/runs/{id}/events:
    get:
      summary: Stream or poll lifecycle events for a run
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/create:
    post:
      summary: Dry-run or request provider-backed sandbox creation
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/write-files:
    post:
      summary: Dry-run or write bounded files into a provider sandbox
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/exec:
    post:
      summary: Dry-run or execute a bounded provider command
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/receive-handoff:
    post:
      summary: Validate and preview an inbound handoff envelope
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/send-handoff:
    post:
      summary: Dry-run or protected-send public-safe evidence to another PlatPhorm tool
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/suite:
    get:
      summary: Read Sandbox suite integration registry
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/sandbox/evidence:
    get:
      summary: Read declared route evidence and public-safe Web4 evidence
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/web4/status:
    get:
      summary: Read Web4 status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/web4/manifest:
    get:
      summary: Read Web4 manifest JSON
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/web4/scorecard:
    get:
      summary: Read Web4 scorecard
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/web4/fingerprints:
    get:
      summary: Read public-safe fingerprint summaries
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/provenance/lookup:
    get:
      summary: Lookup public provenance records
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/provenance/verify:
    get:
      summary: Verify public provenance records
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/mcp:
    get:
      summary: Read Sandbox MCP metadata
      tags:
        - MCP
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
    post:
      summary: Call Sandbox MCP JSON-RPC methods
      tags:
        - MCP
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/templates:
    get:
      summary: List public Sandbox templates
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/templates:
    get:
      summary: List public lifecycle templates
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/templates/{id}:
    get:
      summary: Read one public lifecycle template
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/run:
    post:
      summary: Start a public-safe lifecycle run record
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/runs:
    get:
      summary: List lifecycle runs when persistence is configured
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/runs/{id}:
    get:
      summary: Read a lifecycle run when persistence is configured
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/runs/{id}/next:
    post:
      summary: Advance a lifecycle run step using supplied evidence
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/runs/{id}/send-to/{service}:
    post:
      summary: Prepare or execute an integration send without faking delivery
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/lifecycle/runs/{id}/evidence:
    get:
      summary: Read lifecycle evidence references
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/provider/status:
    get:
      summary: Read Vercel Sandbox provider status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/database/status:
    get:
      summary: Read database status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/rate-limits:
    get:
      summary: Read public rate-limit policy
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes:
    get:
      summary: List public-safe or operator sandboxes
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
    post:
      summary: Dry-run or create a protected provider-backed Sandbox workspace
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}:
    get:
      summary: Read a sandbox workspace by id
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/execute:
    post:
      summary: Dry-run or execute protected code in a provider sandbox
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/stop:
    post:
      summary: Dry-run or stop a protected provider sandbox
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/extend-timeout:
    post:
      summary: Dry-run or extend a protected provider sandbox timeout
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/network-policy:
    post:
      summary: Dry-run or update a protected provider sandbox network policy
      tags:
        - Network
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/commands:
    post:
      summary: Dry-run or execute a protected bounded command in a provider sandbox
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/commands/{commandId}/logs:
    get:
      summary: Read command logs
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/files/read:
    post:
      summary: Dry-run or read a protected file from a provider sandbox workspace
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/files/write:
    post:
      summary: Dry-run or write protected files to a provider sandbox workspace
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/files/mkdir:
    post:
      summary: Dry-run or create a protected provider sandbox directory
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/sandboxes/{id}/snapshots:
    post:
      summary: Dry-run or create a protected Vercel Sandbox snapshot
      tags:
        - Sandbox
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/execute:
    post:
      summary: Execute code through the public-safe Sandbox execution adapter
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/api-tests:
    post:
      summary: Run a trusted-domain API request test
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/json-rpc/replay:
    post:
      summary: Validate or replay a JSON-RPC request
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/openapi/import:
    post:
      summary: Import and validate an OpenAPI document
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/schema/validate:
    post:
      summary: Validate JSON against a JSON schema
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/schema/generate-example:
    post:
      summary: Generate a small JSON example from schema
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/status:
    get:
      summary: Read integration matrix status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/json/validate:
    post:
      summary: Validate JSON artifacts
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/xml/validate:
    post:
      summary: Validate XML artifacts
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/markdown/validate:
    post:
      summary: Validate Markdown report artifacts
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/agentui/render:
    post:
      summary: Validate an AgentUI tool render payload locally
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/phorm/prototype:
    post:
      summary: Request a Phorm prototype when configured
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/fingerprint/check:
    post:
      summary: Check JA4/fingerprint redaction policy
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/trace/span-completion:
    post:
      summary: Complete a trace span payload locally and report export status
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/integrations/cli/dry-run:
    post:
      summary: Generate platphormctl dry-run commands
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/webhooks/replay:
    post:
      summary: Replay a webhook through the PlatPhorm webhook service when configured
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/agent-policy:
    get:
      summary: Read public agent policy summary
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/agent-policy/platforms:
    get:
      summary: List agent platform policy entries
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/agent-policy/robots:
    get:
      summary: Read robots policy projection
      tags:
        - Sandbox
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/network/graph:
    get:
      summary: Read discovered PlatPhorm network graph status
      tags:
        - Network
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/network/trusted-domains:
    get:
      summary: Read trusted domain policy
      tags:
        - Network
      security: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/v1/network/graph/sync:
    post:
      summary: Refresh network graph state
      tags:
        - Network
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
  /api/network/register:
    post:
      summary: Register Sandbox network metadata with PLATPHORM_API_KEY authorization
      tags:
        - Network
      security:
        - PlatPhormApiKey: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiSuccess"
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
        401:
          description: PLATPHORM_API_KEY required
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"