{
  "openapi": "3.1.0",
  "info": {
    "title": "Porthole implemented HTTP API",
    "version": "1.0.0",
    "description": "Implemented OTLP intake, bounded telemetry queries, configuration definitions and dashboards. Native session security uses the installation session cookie; development cookie names vary by local origin. All requests remain subject to configured origin checks and current scope. This document contains no installation settings. It does not advertise complete vendor language or transport compatibility."
  },
  "paths": {
    "/api/porthole/v1/fleet": {
      "get": {
        "summary": "Read owner-visible install observations and retained eBPF coverage",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Current native owner only. Authorization headers refuse even with an owner cookie. No query parameters. At most 200 installs, with explicit incomplete listing. Includes Collector and OBI versions, node kernel and runtime limits, requested and observed privileges, named gaps and next actions. Reports are not health or full-traffic proof. Stopped, revoked, expired and inactive restored installs are stale. Credentials and bindings are never returned.",
        "responses": {
          "200": {
            "description": "Fleet observations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "installs",
                    "complete",
                    "meaning"
                  ],
                  "properties": {
                    "installs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "meaning": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/fleet/report": {
      "post": {
        "summary": "Submit a scoped authenticated collector observation",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "Ingest credential with telemetry.write and logs permission for the exact service, environment and team. Installation identity is bound to its first credential. Strictly increasing sequence prevents stale replay from refreshing observation time. Inactive restored bindings cannot reactivate. JSON only; credentials belong in the Authorization header, never the body or URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "service",
                  "environment",
                  "team",
                  "state",
                  "report"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "service": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "team": {
                    "type": "string"
                  },
                  "state": {
                    "enum": [
                      "active",
                      "stopped"
                    ]
                  },
                  "report": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted observation with explicit gaps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/handoffs": {
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "summary": "Read configured external handoffs",
        "responses": {
          "200": {
            "description": "Fixed product responsibilities and active destinations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/handoffs/{product}": {
      "parameters": [
        {
          "name": "product",
          "in": "path",
          "required": true,
          "schema": {
            "enum": [
              "vane",
              "linen",
              "evidence",
              "vantage",
              "cloudzero",
              "splunk-es",
              "datadog-cloud-siem",
              "datadog-ci-visibility",
              "datadog-test-optimization",
              "datadog-data-jobs",
              "datadog-data-streams",
              "stream-specialist"
            ]
          }
        }
      ],
      "post": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Review an exact owner handoff revision",
        "description": "Current native owner and proof within five minutes. HTTPS destinations only, no credentials, userinfo, controls or fragments. Optional same-origin templates declare only service, environment, from, through. No provider call.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "destination",
                  "confirm"
                ],
                "properties": {
                  "revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "destination": {
                    "type": "string",
                    "format": "uri"
                  },
                  "template": {
                    "type": "string"
                  },
                  "confirm": {
                    "const": "save-handoff"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New immutable privately audited revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/service-evidence": {
      "post": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Preview one scoped service evidence packet",
        "description": "Current native owner with fresh proof. Explicit approved field allowlist and external system reference; no detached telemetry or invented price.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "serviceId",
                  "from",
                  "through",
                  "metadataRevision",
                  "externalReference",
                  "fields"
                ],
                "properties": {
                  "serviceId": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{32}$"
                  },
                  "from": {
                    "type": "string",
                    "pattern": "^[0-9]{1,20}$"
                  },
                  "through": {
                    "type": "string",
                    "pattern": "^[0-9]{1,20}$"
                  },
                  "metadataRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "externalReference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "fields": {
                    "type": "array",
                    "minItems": 1,
                    "uniqueItems": true,
                    "items": {
                      "enum": [
                        "identity",
                        "metadata",
                        "observedRed",
                        "coverage",
                        "freshness",
                        "traceReferences",
                        "logReferences"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Exact packet and SHA-256 digest over canonical packet JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/service-evidence/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "summary": "Review a packet using current scoped readers",
        "responses": {
          "200": {
            "description": "Current preview or approved packet, or cancelled receipt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/service-evidence/{id}/approve": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Approve an exact digest-bound packet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "confirm",
                  "digest"
                ],
                "properties": {
                  "confirm": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "digest": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited packet state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/service-evidence/{id}/cancel": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Cancel a preview or approval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "confirm",
                  "digest"
                ],
                "properties": {
                  "confirm": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "digest": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audited packet state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/service-evidence/{id}/download": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "summary": "Download an approved service packet",
        "description": "Native approving owner only. Current authority, metadata, retained inputs, export exclusions, digest and approval are checked again. Bearer credentials refuse, including with an owner cookie. Restored history is inactive.",
        "responses": {
          "200": {
            "description": "Attachment containing packet and digest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/read": {
      "post": {
        "summary": "Bounded Prometheus remote-read v1 SAMPLES",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "Raw Snappy protobuf with inclusive millisecond range and label matchers. Existing telemetry.read only; live scope, custody, quotas, erasure and portable exclusions apply. No PromQL evaluation. Unsupported metric mapping or exhausted scan refuses the whole result. Maximum 2000 scanned records, 1 MiB and 8 queries. See the standard signal API guide for the pinned mapping profile.",
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "required": true,
            "schema": {
              "const": "snappy"
            }
          },
          {
            "name": "X-Prometheus-Remote-Read-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "0.1.0"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-protobuf": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "prometheus.ReadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Snappy-compressed prometheus.ReadResponse using SAMPLES",
            "content": {
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/traces/{traceID}": {
      "get": {
        "summary": "Bounded Tempo 2.8.2 trace-by-ID v1",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "Authorized retained OTLP spans only. Every response explicitly declares partial trace evidence in headers; connected topology does not imply complete original trace. No search or TraceQL.",
        "parameters": [
          {
            "name": "traceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-fA-F0-9]{32}$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Optional paired inclusive Unix-second bounds."
          },
          {
            "name": "end",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Optional paired inclusive Unix-second bounds."
          }
        ],
        "responses": {
          "200": {
            "description": "Tempo Trace, with OTLP ResourceSpans in batches",
            "headers": {
              "X-Porthole-Trace-Completeness": {
                "schema": {
                  "const": "partial"
                }
              },
              "X-Porthole-Trace-Evidence": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batches": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              },
              "application/protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/network-messaging": {
      "get": {
        "summary": "Read scoped native network and messaging evidence, version 1",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Native session only. Current service, environment and team scope applies before counting. Server and consumer spans supply observed requests; client and producer spans do not add requests. Percentiles are nearest rank on original nanosecond durations. Upstream sampling and loss remain unknown; this is never full-traffic RED. Revoked sessions and erased source records cannot release accumulated results. Unknown or repeated query parameters refuse. Traces and scalar metrics share one completed intake watermark and absolute window. Correlation requires explicitly declared container.id, host.id and identical service, environment and team scope. Broker metrics additionally require the declared broker container identity and topic or queue. Missing, stale, ambiguous and incomplete samples remain unknown. Namespace counters are not per-edge loss rates. No detached aggregate is stored; every source record is fenced again before release. No collection or external probing is started by this read.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive Unix nanoseconds; default is 24 hours before now.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "through",
            "in": "query",
            "description": "Inclusive Unix nanoseconds; default is now.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "description": "Completed intake sequence watermark.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "budget",
            "in": "query",
            "description": "Maximum retained records scanned per signal, in pages of 200. A remaining page makes coverage partial.",
            "schema": {
              "type": "integer",
              "minimum": 200,
              "maximum": 2000,
              "multipleOf": 200,
              "default": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Version 1 evidence with retained DNS and connection timings, namespace counters, broker samples, trace context links and explicit coverage gaps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/services": {
      "get": {
        "summary": "Discover scoped runtime services and observed dependencies",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Native session only. Current service, environment and team scope applies before counting. Server and consumer spans supply observed requests; client and producer spans do not add requests. Percentiles are nearest rank on original nanosecond durations. Upstream sampling and loss remain unknown; this is never full-traffic RED. Revoked sessions and erased source records cannot release accumulated results. Unknown or repeated query parameters refuse.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive Unix nanoseconds; default is 24 hours before now.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "through",
            "in": "query",
            "description": "Inclusive Unix nanoseconds; default is now.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "description": "Completed intake sequence watermark.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "budget",
            "in": "query",
            "description": "Maximum retained records scanned per signal, in pages of 200. A remaining page makes coverage partial.",
            "schema": {
              "type": "integer",
              "minimum": 200,
              "maximum": 2000,
              "multipleOf": 200,
              "default": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bounded catalog with explicit coverage, freshness, fixed watermark, metadata history and observed endpoint summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/services/{id}": {
      "get": {
        "summary": "Read one scoped service and reviewed metadata history",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Native session only. Current service, environment and team scope applies before counting. Server and consumer spans supply observed requests; client and producer spans do not add requests. Percentiles are nearest rank on original nanosecond durations. Upstream sampling and loss remain unknown; this is never full-traffic RED. Revoked sessions and erased source records cannot release accumulated results. Unknown or repeated query parameters refuse. Explicit resource identities and database and messaging semantic attributes supply observed associations, with unknown targets preserved. Each association includes one original trace and span identity at its last observation; trace reads independently apply current scope and the completed watermark. Unresolved firing episodes of current active monitors include the service metadata at first firing and its current reviewed revision. The entire monitor scope must also be readable. Historical context grants no membership, infrastructure, database or document access, and requests no delivery. Inactive restored monitors contribute no active firing context.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive Unix nanoseconds; default is 24 hours before now.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "through",
            "in": "query",
            "description": "Inclusive Unix nanoseconds; default is now.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "description": "Completed intake sequence watermark.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "budget",
            "in": "query",
            "description": "Maximum retained records scanned per signal, in pages of 200. A remaining page makes coverage partial.",
            "schema": {
              "type": "integer",
              "minimum": 200,
              "maximum": 2000,
              "multipleOf": 200,
              "default": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service with current metadata, immutable revisions, observed associations, unresolved firing context and explicit coverage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save an exact reviewed service metadata revision",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Fresh native owner session only, within current scope. Assignee must already be an active eligible member with matching scope; attribution never grants membership or document access. A revision mismatch or revoked authority changes no metadata. Restore leaves revisions quarantined until a new native review. Links are HTTPS without embedded credentials; no destination is fetched.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "ownerRef",
                  "repository",
                  "runbook",
                  "criticality",
                  "confirm"
                ],
                "properties": {
                  "revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "ownerRef": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Existing eligible member ID, or an empty string for explicit unassignment."
                  },
                  "repository": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "runbook": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "criticality": {
                    "enum": [
                      "unclassified",
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  },
                  "confirm": {
                    "const": "save-service-metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New immutable metadata revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/events": {
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped event page and complete matching snapshot facets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "snapshot",
                    "cursor",
                    "pageCursor",
                    "facets"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "type": "object"
                      }
                    },
                    "snapshot": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pageCursor": {
                      "type": "string"
                    },
                    "facets": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "scope",
                        "totalEvents",
                        "counts"
                      ],
                      "properties": {
                        "scope": {
                          "const": "snapshot"
                        },
                        "totalEvents": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "counts": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "source",
                            "service",
                            "environment",
                            "team",
                            "severity",
                            "resource",
                            "tag"
                          ],
                          "properties": {
                            "source": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            },
                            "service": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            },
                            "environment": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            },
                            "team": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            },
                            "severity": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            },
                            "resource": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            },
                            "tag": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "value",
                                  "count"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "summary": "Search native custom events",
        "description": "Native sessions only. Current service, environment and team scopes apply before search. Events are ordered by original occurrence time and event ID, at a receipt sequence snapshot. The opaque cursor is bound to the exact filter, native session and current member revision. Late arrivals enter a fresh search. pageCursor reopens the displayed page at its original receipt snapshot, including the first page. Facet counts and totalEvents cover every matching event at the same receipt snapshot, independent of page position. Current authority and erasure fences apply to every contributing event. Resource and tag predicates match exact values. No provider or event-monitor authority is supplied.",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "team",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "text",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "correlationKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "through",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ]
      },
      "post": {
        "summary": "Create immutable custom evidence as a current native owner",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "At most 8192 bytes. Identical source and sourceId retries by the original actor return the same event and original receipt. Conflicting identities refuse. Server provenance is native-custom; provider attribution, actor impersonation and side-effect fields refuse. No monitor, outbound or publication action occurs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "source",
                  "sourceId",
                  "title",
                  "service",
                  "environment",
                  "team",
                  "severity",
                  "occurredAt"
                ],
                "properties": {
                  "sourceType": {
                    "const": "custom"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "sourceId": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "service": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "team": {
                    "type": "string"
                  },
                  "resource": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "tags": {
                    "type": "array",
                    "maxItems": 30,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "maxLength": 120
                    }
                  },
                  "severity": {
                    "enum": [
                      "info",
                      "warning",
                      "error"
                    ]
                  },
                  "occurredAt": {
                    "type": "string",
                    "pattern": "^[0-9]{1,20}$",
                    "description": "Original Unix nanoseconds; returned padded to 20 digits."
                  },
                  "correlationKey": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Original event receipt with replayed flag",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/events/export": {
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bounded page, empty when no current event matches. Continue until the next cursor is empty.",
            "headers": {
              "x-porthole-records": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-porthole-snapshot": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-porthole-next-cursor": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "summary": "Download one currently authorized native event page",
        "description": "NDJSON of the same immutable event representations and occurrence order as search. Use the identical predicates, private filter, limit and cursor as search; the signed cursor fixes the receipt snapshot. Follow x-porthole-next-cursor until empty. Each request rechecks native membership, scope and erased actors; no export job, detached cache, provider permission or delegated credential action is created.",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "team",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "text",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "correlationKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "through",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ]
      }
    },
    "/api/porthole/v1/events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Currently authorized private custom-event evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "summary": "Read an authorized immutable custom event"
      }
    },
    "/api/porthole/v1/events/filters": {
      "get": {
        "security": [
          {
            "NativeSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Currently authorized private custom-event evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "summary": "List only this native member’s private saved filters"
      },
      "post": {
        "summary": "Save or revise a private filter",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "definition"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "definition": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "source": {
                        "type": "string"
                      },
                      "sourceId": {
                        "type": "string"
                      },
                      "service": {
                        "type": "string"
                      },
                      "environment": {
                        "type": "string"
                      },
                      "team": {
                        "type": "string"
                      },
                      "severity": {
                        "type": "string"
                      },
                      "resource": {
                        "type": "string"
                      },
                      "tag": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "correlationKey": {
                        "type": "string"
                      },
                      "from": {
                        "type": "string"
                      },
                      "through": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Private saved filter receipt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/traces": {
      "post": {
        "summary": "Accept OTLP traces",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "OTLP over HTTP, version 1.9.0. Accepts JSON or protobuf with identity or gzip encoding. Success records durable acceptance, not completed processing. Each resource needs service, environment and team within the credential grants; missing dimensions inherit only a single explicit grant. Resource attributes take precedence over scope headers. Empty export objects are supported. No raw gRPC transport.",
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip"
              ],
              "default": "identity"
            }
          },
          {
            "name": "x-porthole-batch-id",
            "in": "header",
            "description": "Optional stable batch identity. Without it the server hashes the wire payload and scope headers. Reuse with different contents refuses.",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,119}$"
            }
          },
          {
            "name": "x-porthole-service",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-environment",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-team",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The official OTLP ExportRequest for this signal. This envelope schema is intentionally not the full OTLP message schema. Use official signal-specific messages. Required trace IDs, span IDs, metric names, numeric data points, timestamps and profile dictionary references are validated by intake. Additional fields remain subject to decoder and normalizer validation.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resourceSpans": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "additionalProperties": true
              }
            },
            "application/x-protobuf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or duplicate export; empty JSON object or empty protobuf ExportResponse.",
            "headers": {
              "x-porthole-batch": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Durable intake batch identifier."
              },
              "x-porthole-accepted": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Accepted normalized records."
              },
              "x-porthole-duplicate": {
                "schema": {
                  "type": "boolean"
                },
                "description": "Whether this envelope was already accepted."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "maxProperties": 0
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Correct malformed payload, timestamps, IDs, resource attributes or batch identity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "401": {
            "description": "Supply a valid live bearer credential.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "403": {
            "description": "Grant telemetry.write, the requested signal and each resource scope dimension.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "405": {
            "description": "Use POST.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "409": {
            "description": "Use a fresh batch identity for different contents; erased batches cannot be resubmitted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "413": {
            "description": "Reduce wire bytes, decompressed bytes and normalized bytes to at most 1 MiB each and normalized records to at most 5000.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "415": {
            "description": "Use the documented media type and identity or gzip encoding. Raw gRPC is unsupported.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "503": {
            "description": "Restore intake storage availability and retry; honor Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          }
        }
      }
    },
    "/v1/metrics": {
      "post": {
        "summary": "Accept OTLP metrics",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "OTLP over HTTP, version 1.9.0. Accepts JSON or protobuf with identity or gzip encoding. Success records durable acceptance, not completed processing. Each resource needs service, environment and team within the credential grants; missing dimensions inherit only a single explicit grant. Resource attributes take precedence over scope headers. Empty export objects are supported. No raw gRPC transport.",
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip"
              ],
              "default": "identity"
            }
          },
          {
            "name": "x-porthole-batch-id",
            "in": "header",
            "description": "Optional stable batch identity. Without it the server hashes the wire payload and scope headers. Reuse with different contents refuses.",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,119}$"
            }
          },
          {
            "name": "x-porthole-service",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-environment",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-team",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The official OTLP ExportRequest for this signal. This envelope schema is intentionally not the full OTLP message schema. Use official signal-specific messages. Required trace IDs, span IDs, metric names, numeric data points, timestamps and profile dictionary references are validated by intake. Additional fields remain subject to decoder and normalizer validation.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resourceMetrics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "additionalProperties": true
              }
            },
            "application/x-protobuf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or duplicate export; empty JSON object or empty protobuf ExportResponse.",
            "headers": {
              "x-porthole-batch": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Durable intake batch identifier."
              },
              "x-porthole-accepted": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Accepted normalized records."
              },
              "x-porthole-duplicate": {
                "schema": {
                  "type": "boolean"
                },
                "description": "Whether this envelope was already accepted."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "maxProperties": 0
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Correct malformed payload, timestamps, IDs, resource attributes or batch identity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "401": {
            "description": "Supply a valid live bearer credential.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "403": {
            "description": "Grant telemetry.write, the requested signal and each resource scope dimension.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "405": {
            "description": "Use POST.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "409": {
            "description": "Use a fresh batch identity for different contents; erased batches cannot be resubmitted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "413": {
            "description": "Reduce wire bytes, decompressed bytes and normalized bytes to at most 1 MiB each and normalized records to at most 5000.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "415": {
            "description": "Use the documented media type and identity or gzip encoding. Raw gRPC is unsupported.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "503": {
            "description": "Restore intake storage availability and retry; honor Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          }
        }
      }
    },
    "/v1/logs": {
      "post": {
        "summary": "Accept OTLP logs",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "OTLP over HTTP, version 1.9.0. Accepts JSON or protobuf with identity or gzip encoding. Success records durable acceptance, not completed processing. Each resource needs service, environment and team within the credential grants; missing dimensions inherit only a single explicit grant. Resource attributes take precedence over scope headers. Empty export objects are supported. No raw gRPC transport.",
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip"
              ],
              "default": "identity"
            }
          },
          {
            "name": "x-porthole-batch-id",
            "in": "header",
            "description": "Optional stable batch identity. Without it the server hashes the wire payload and scope headers. Reuse with different contents refuses.",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,119}$"
            }
          },
          {
            "name": "x-porthole-service",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-environment",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-team",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The official OTLP ExportRequest for this signal. This envelope schema is intentionally not the full OTLP message schema. Use official signal-specific messages. Required trace IDs, span IDs, metric names, numeric data points, timestamps and profile dictionary references are validated by intake. Additional fields remain subject to decoder and normalizer validation.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resourceLogs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "additionalProperties": true
              }
            },
            "application/x-protobuf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or duplicate export; empty JSON object or empty protobuf ExportResponse.",
            "headers": {
              "x-porthole-batch": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Durable intake batch identifier."
              },
              "x-porthole-accepted": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Accepted normalized records."
              },
              "x-porthole-duplicate": {
                "schema": {
                  "type": "boolean"
                },
                "description": "Whether this envelope was already accepted."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "maxProperties": 0
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Correct malformed payload, timestamps, IDs, resource attributes or batch identity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "401": {
            "description": "Supply a valid live bearer credential.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "403": {
            "description": "Grant telemetry.write, the requested signal and each resource scope dimension.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "405": {
            "description": "Use POST.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "409": {
            "description": "Use a fresh batch identity for different contents; erased batches cannot be resubmitted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "413": {
            "description": "Reduce wire bytes, decompressed bytes and normalized bytes to at most 1 MiB each and normalized records to at most 5000.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "415": {
            "description": "Use the documented media type and identity or gzip encoding. Raw gRPC is unsupported.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "503": {
            "description": "Restore intake storage availability and retry; honor Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          }
        }
      }
    },
    "/v1/profiles": {
      "post": {
        "summary": "Accept OTLP profiles",
        "security": [
          {
            "ScopedCredential": []
          }
        ],
        "description": "OTLP over HTTP, version 1.9.0; profiles use the development profile message and request dictionary. Accepts JSON or protobuf with identity or gzip encoding. Success records durable acceptance, not completed processing. Each resource needs service, environment and team within the credential grants; missing dimensions inherit only a single explicit grant. Resource attributes take precedence over scope headers. Empty export objects are supported. No raw gRPC transport.",
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip"
              ],
              "default": "identity"
            }
          },
          {
            "name": "x-porthole-batch-id",
            "in": "header",
            "description": "Optional stable batch identity. Without it the server hashes the wire payload and scope headers. Reuse with different contents refuses.",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,119}$"
            }
          },
          {
            "name": "x-porthole-service",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-environment",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          },
          {
            "name": "x-porthole-team",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Resource scope when not supplied by resource attributes."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The official OTLP ExportRequest for this signal. This envelope schema is intentionally not the full OTLP message schema. Use official signal-specific messages. Required trace IDs, span IDs, metric names, numeric data points, timestamps and profile dictionary references are validated by intake. Additional fields remain subject to decoder and normalizer validation.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resourceProfiles": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "dictionary": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "additionalProperties": true
              }
            },
            "application/x-protobuf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or duplicate export; empty JSON object or empty protobuf ExportResponse.",
            "headers": {
              "x-porthole-batch": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Durable intake batch identifier."
              },
              "x-porthole-accepted": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Accepted normalized records."
              },
              "x-porthole-duplicate": {
                "schema": {
                  "type": "boolean"
                },
                "description": "Whether this envelope was already accepted."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "maxProperties": 0
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Correct malformed payload, timestamps, IDs, resource attributes or batch identity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "401": {
            "description": "Supply a valid live bearer credential.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "403": {
            "description": "Grant telemetry.write, the requested signal and each resource scope dimension.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "405": {
            "description": "Use POST.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "409": {
            "description": "Use a fresh batch identity for different contents; erased batches cannot be resubmitted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "413": {
            "description": "Reduce wire bytes, decompressed bytes and normalized bytes to at most 1 MiB each and normalized records to at most 5000.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "415": {
            "description": "Use the documented media type and identity or gzip encoding. Raw gRPC is unsupported.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          },
          "503": {
            "description": "Restore intake storage availability and retry; honor Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "description": "Stable rejection code."
                    }
                  }
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Encoded google.rpc.Status; HTTP status is retained."
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Optional seconds to wait on throttling or temporary unavailability."
              },
              "x-porthole-error": {
                "schema": {
                  "type": "string"
                },
                "description": "Stable rejection code for protobuf errors."
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/logs/clusters": {
      "post": {
        "summary": "Group retained log patterns and page original members",
        "description": "Version 1. Read-only, bounded complete scan at one completion watermark, with final authority and retained custody checks. Partial scans return no patterns, counts or members. No detached telemetry cache. Resubmit all filters, snapshot and limit with an opaque cursor. Stale custody or changed filters invalidate a cursor.",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "service": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                  },
                  "environment": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                  },
                  "team": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                  },
                  "from": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Inclusive unsigned 64-bit Unix nanoseconds. Use decimal strings to avoid numeric precision loss."
                  },
                  "through": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Inclusive Unix nanoseconds, at least from."
                  },
                  "snapshot": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Nonnegative safe integer completion watermark; defaults to latest completed batch."
                  },
                  "dialect": {
                    "enum": [
                      "visual",
                      "promql",
                      "sql",
                      "lucene"
                    ],
                    "default": "visual"
                  },
                  "expression": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "Visual requires empty text. PromQL supports one bare metric selector with exact scope labels. SQL supports COUNT(*) on logs, AVG(value) on metrics with one exact metric, or discrete p95 duration on traces, with exact scope equalities. Lucene supports exact log scope terms joined by AND. No general query-language execution; unsupported syntax refuses."
                  },
                  "signal": {
                    "const": "logs"
                  },
                  "scanLimit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "default": 10000
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "default": 50
                  },
                  "cluster": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$",
                    "description": "Return this pattern’s original members."
                  },
                  "cursor": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Complete scoped patterns or member page; explicit partial scan otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "state",
                    "snapshot",
                    "parameters",
                    "scanned",
                    "scanLimit",
                    "limit",
                    "totalRecords",
                    "totalClusters",
                    "clusters",
                    "records",
                    "cursor"
                  ],
                  "properties": {
                    "version": {
                      "const": 1
                    },
                    "state": {
                      "enum": [
                        "complete",
                        "partial"
                      ]
                    },
                    "snapshot": {
                      "type": "integer"
                    },
                    "parameters": {
                      "type": "object"
                    },
                    "scanned": {
                      "type": "integer"
                    },
                    "scanLimit": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalRecords": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "totalClusters": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "reason": {
                      "enum": [
                        "scan_limit",
                        "byte_limit"
                      ]
                    },
                    "cluster": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "clusters": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "pattern",
                          "count"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "pattern": {
                            "type": "object"
                          },
                          "count": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Original scoped row and native Explore pivot, without copied storage.",
                        "additionalProperties": true
                      }
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/query": {
      "post": {
        "summary": "Query retained telemetry",
        "description": "No URL query parameters. Requires telemetry.read on a bearer credential, or a native session. Native POST requests require a same-origin Origin header. Full vendor query languages are not supported.",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scoped snapshot page; current authorization is rechecked on every request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResult"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/query/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Replay stored native filters at their completion watermark",
        "description": "No URL query parameters. Rechecks current authority. Replay retains native scope, visual gauge range settings, cursor, limit, trace and metric filters. Current unit and custody checks still apply.",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped snapshot page; current authorization is rechecked on every request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResult"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/configuration/monitors": {
      "get": {
        "summary": "List scoped monitors",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "description": "Bearer credentials require definitions.read. Monitors also require their signal grant. No unknown or repeated query parameters.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "cursor"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Definition"
                      }
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an inactive definition",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,120}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "JSON object, at most 8192 bytes. Scope requires nonempty services and environments within current grants.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scope",
                  "body"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "scope": {
                    "$ref": "#/components/schemas/Scope"
                  },
                  "body": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "type",
                          "signal",
                          "hosts",
                          "missedAfterSeconds",
                          "pendingSeconds",
                          "recoverySeconds"
                        ],
                        "properties": {
                          "type": {
                            "const": "host-heartbeat"
                          },
                          "signal": {
                            "enum": [
                              "logs",
                              "metrics",
                              "traces",
                              "profiles"
                            ]
                          },
                          "hosts": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 100,
                            "uniqueItems": true,
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$"
                            }
                          },
                          "missedAfterSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 86400
                          },
                          "pendingSeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 86400
                          },
                          "recoverySeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 86400
                          }
                        }
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "signal",
                          "operator",
                          "threshold",
                          "windowSeconds"
                        ],
                        "properties": {
                          "signal": {
                            "enum": [
                              "logs",
                              "metrics",
                              "traces"
                            ]
                          },
                          "operator": {
                            "enum": [
                              "above",
                              "below"
                            ]
                          },
                          "threshold": {
                            "type": "number"
                          },
                          "windowSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 86400
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/configuration/monitors/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read definition and revision ETag",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Replace an exact revision with an inactive definition",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,120}$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact quoted revision ETag returned by GET.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "JSON object, at most 8192 bytes. Scope requires nonempty services and environments within current grants.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scope",
                  "body"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "scope": {
                    "$ref": "#/components/schemas/Scope"
                  },
                  "body": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "type",
                          "signal",
                          "hosts",
                          "missedAfterSeconds",
                          "pendingSeconds",
                          "recoverySeconds"
                        ],
                        "properties": {
                          "type": {
                            "const": "host-heartbeat"
                          },
                          "signal": {
                            "enum": [
                              "logs",
                              "metrics",
                              "traces",
                              "profiles"
                            ]
                          },
                          "hosts": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 100,
                            "uniqueItems": true,
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$"
                            }
                          },
                          "missedAfterSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 86400
                          },
                          "pendingSeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 86400
                          },
                          "recoverySeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 86400
                          }
                        }
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "signal",
                          "operator",
                          "threshold",
                          "windowSeconds"
                        ],
                        "properties": {
                          "signal": {
                            "enum": [
                              "logs",
                              "metrics",
                              "traces"
                            ]
                          },
                          "operator": {
                            "enum": [
                              "above",
                              "below"
                            ]
                          },
                          "threshold": {
                            "type": "number"
                          },
                          "windowSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 86400
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Archive an exact revision while retaining history",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,120}$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact quoted revision ETag returned by GET.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archived definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/configuration/repairs": {
      "get": {
        "summary": "List scoped repairs",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "description": "Bearer credentials require definitions.read. Monitors also require their signal grant. No unknown or repeated query parameters.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "cursor"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Definition"
                      }
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an inactive definition",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,120}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "JSON object, at most 8192 bytes. Scope requires nonempty services and environments within current grants.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scope",
                  "body"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "scope": {
                    "$ref": "#/components/schemas/Scope"
                  },
                  "body": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "steps",
                      "expiresAt"
                    ],
                    "properties": {
                      "expiresAt": {
                        "type": "integer"
                      },
                      "steps": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 20,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "kind",
                            "target",
                            "revision"
                          ],
                          "properties": {
                            "kind": {
                              "enum": [
                                "restart",
                                "rollback"
                              ]
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                            },
                            "revision": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/configuration/repairs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read definition and revision ETag",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Replace an exact revision with an inactive definition",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,120}$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact quoted revision ETag returned by GET.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "JSON object, at most 8192 bytes. Scope requires nonempty services and environments within current grants.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scope",
                  "body"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "scope": {
                    "$ref": "#/components/schemas/Scope"
                  },
                  "body": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "steps",
                      "expiresAt"
                    ],
                    "properties": {
                      "expiresAt": {
                        "type": "integer"
                      },
                      "steps": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 20,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "kind",
                            "target",
                            "revision"
                          ],
                          "properties": {
                            "kind": {
                              "enum": [
                                "restart",
                                "rollback"
                              ]
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                            },
                            "revision": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Archive an exact revision while retaining history",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,120}$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact quoted revision ETag returned by GET.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archived definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Definition"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current revision."
              },
              "idempotency-replayed": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Read the current definition and retry with its ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Read the definition and supply its ETag in If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/dashboards": {
      "get": {
        "summary": "List whole dashboard definitions within current scope and signal grants",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "revision",
                          "name",
                          "scope",
                          "body",
                          "state"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "name": {
                            "type": "string",
                            "maxLength": 120
                          },
                          "scope": {
                            "$ref": "#/components/schemas/Scope"
                          },
                          "body": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "panels",
                              "variables",
                              "range",
                              "annotations"
                            ],
                            "properties": {
                              "panels": {
                                "type": "array",
                                "maxItems": 30,
                                "items": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "id",
                                    "title",
                                    "service",
                                    "signal",
                                    "aggregate",
                                    "unit"
                                  ],
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "title": {
                                      "type": "string",
                                      "maxLength": 120
                                    },
                                    "service": {
                                      "type": "string"
                                    },
                                    "signal": {
                                      "enum": [
                                        "metrics",
                                        "logs",
                                        "traces"
                                      ]
                                    },
                                    "aggregate": {
                                      "enum": [
                                        "average",
                                        "count",
                                        "p95"
                                      ]
                                    },
                                    "metric": {
                                      "type": "string",
                                      "description": "Required for metrics; exact metric name"
                                    },
                                    "unit": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "compareWeek": {
                                      "type": "boolean"
                                    },
                                    "functions": {
                                      "type": "array",
                                      "maxItems": 8,
                                      "description": "Ordered numeric metric transformations; see the documented dashboard function semantics.",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                              "kind",
                                              "seconds",
                                              "operation"
                                            ],
                                            "properties": {
                                              "kind": {
                                                "const": "rollup"
                                              },
                                              "seconds": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 604800
                                              },
                                              "operation": {
                                                "enum": [
                                                  "average",
                                                  "sum"
                                                ]
                                              }
                                            }
                                          },
                                          {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                              "kind",
                                              "limit"
                                            ],
                                            "properties": {
                                              "kind": {
                                                "const": "rank"
                                              },
                                              "limit": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 2000
                                              }
                                            }
                                          },
                                          {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                              "kind",
                                              "window"
                                            ],
                                            "properties": {
                                              "kind": {
                                                "const": "smooth"
                                              },
                                              "window": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 2000
                                              }
                                            }
                                          },
                                          {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                              "kind"
                                            ],
                                            "properties": {
                                              "kind": {
                                                "const": "rate"
                                              }
                                            }
                                          }
                                        ]
                                      }
                                    },
                                    "widget": {
                                      "enum": [
                                        "query_value",
                                        "timeseries",
                                        "table",
                                        "top_list",
                                        "distribution",
                                        "heatmap",
                                        "pie",
                                        "treemap",
                                        "list",
                                        "log_stream",
                                        "notes"
                                      ]
                                    },
                                    "note": {
                                      "type": "string",
                                      "maxLength": 5000
                                    }
                                  }
                                }
                              },
                              "variables": {
                                "type": "object",
                                "required": [
                                  "team",
                                  "environment"
                                ],
                                "properties": {
                                  "team": {
                                    "type": "string"
                                  },
                                  "environment": {
                                    "type": "string"
                                  }
                                }
                              },
                              "range": {
                                "type": "object",
                                "required": [
                                  "from",
                                  "through"
                                ],
                                "properties": {
                                  "from": {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                  },
                                  "through": {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                  }
                                }
                              },
                              "eventOverlays": {
                                "type": "array",
                                "maxItems": 50,
                                "uniqueItems": true,
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "Private authorized custom-event references; resolved at read time. Definition credentials do not gain event access."
                              },
                              "annotations": {
                                "type": "array",
                                "maxItems": 100,
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "at",
                                    "label"
                                  ],
                                  "properties": {
                                    "at": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 300
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "state": {
                            "enum": [
                              "active",
                              "archived",
                              "quarantined"
                            ]
                          },
                          "versions": {
                            "type": "array",
                            "items": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ]
      },
      "post": {
        "summary": "Create or replace a dashboard using a native session",
        "description": "Updates require id and the exact current revision in the body. A scoped read credential cannot mutate. Idempotency-Key is optional and makes repeated identical native writes durable. Native writes require owner, admin or maintainer role and a same-origin Origin header. JSON bodies are limited to 8192 bytes.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scope",
                  "body"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "scope": {
                    "$ref": "#/components/schemas/Scope"
                  },
                  "body": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "panels",
                      "variables",
                      "range",
                      "annotations"
                    ],
                    "properties": {
                      "panels": {
                        "type": "array",
                        "maxItems": 30,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "title",
                            "service",
                            "signal",
                            "aggregate",
                            "unit"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "service": {
                              "type": "string"
                            },
                            "signal": {
                              "enum": [
                                "metrics",
                                "logs",
                                "traces"
                              ]
                            },
                            "aggregate": {
                              "enum": [
                                "average",
                                "count",
                                "p95"
                              ]
                            },
                            "metric": {
                              "type": "string",
                              "description": "Required for metrics; exact metric name"
                            },
                            "unit": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "compareWeek": {
                              "type": "boolean"
                            },
                            "functions": {
                              "type": "array",
                              "maxItems": 8,
                              "description": "Ordered numeric metric transformations; see the documented dashboard function semantics.",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                      "kind",
                                      "seconds",
                                      "operation"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "const": "rollup"
                                      },
                                      "seconds": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 604800
                                      },
                                      "operation": {
                                        "enum": [
                                          "average",
                                          "sum"
                                        ]
                                      }
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                      "kind",
                                      "limit"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "const": "rank"
                                      },
                                      "limit": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 2000
                                      }
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                      "kind",
                                      "window"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "const": "smooth"
                                      },
                                      "window": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 2000
                                      }
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                      "kind"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "const": "rate"
                                      }
                                    }
                                  }
                                ]
                              }
                            },
                            "widget": {
                              "enum": [
                                "query_value",
                                "timeseries",
                                "table",
                                "top_list",
                                "distribution",
                                "heatmap",
                                "pie",
                                "treemap",
                                "list",
                                "log_stream",
                                "notes"
                              ]
                            },
                            "note": {
                              "type": "string",
                              "maxLength": 5000
                            }
                          }
                        }
                      },
                      "variables": {
                        "type": "object",
                        "required": [
                          "team",
                          "environment"
                        ],
                        "properties": {
                          "team": {
                            "type": "string"
                          },
                          "environment": {
                            "type": "string"
                          }
                        }
                      },
                      "range": {
                        "type": "object",
                        "required": [
                          "from",
                          "through"
                        ],
                        "properties": {
                          "from": {
                            "type": "string",
                            "pattern": "^[0-9]+$"
                          },
                          "through": {
                            "type": "string",
                            "pattern": "^[0-9]+$"
                          }
                        }
                      },
                      "eventOverlays": {
                        "type": "array",
                        "maxItems": 50,
                        "uniqueItems": true,
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "description": "Private authorized custom-event references; resolved at read time. Definition credentials do not gain event access."
                      },
                      "annotations": {
                        "type": "array",
                        "maxItems": 100,
                        "items": {
                          "type": "object",
                          "required": [
                            "at",
                            "label"
                          ],
                          "properties": {
                            "at": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "maxLength": 300
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Committed revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "revision",
                    "state"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "NativeSession": []
          }
        ]
      }
    },
    "/api/porthole/v1/dashboards/{id}": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Read current or historical dashboard with ETag",
        "parameters": [
          {
            "in": "query",
            "name": "version",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized definition and visible revision numbers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "revision",
                    "name",
                    "scope",
                    "body",
                    "state"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "scope": {
                      "$ref": "#/components/schemas/Scope"
                    },
                    "body": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "panels",
                        "variables",
                        "range",
                        "annotations"
                      ],
                      "properties": {
                        "panels": {
                          "type": "array",
                          "maxItems": 30,
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "id",
                              "title",
                              "service",
                              "signal",
                              "aggregate",
                              "unit"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string",
                                "maxLength": 120
                              },
                              "service": {
                                "type": "string"
                              },
                              "signal": {
                                "enum": [
                                  "metrics",
                                  "logs",
                                  "traces"
                                ]
                              },
                              "aggregate": {
                                "enum": [
                                  "average",
                                  "count",
                                  "p95"
                                ]
                              },
                              "metric": {
                                "type": "string",
                                "description": "Required for metrics; exact metric name"
                              },
                              "unit": {
                                "type": "string",
                                "maxLength": 32
                              },
                              "compareWeek": {
                                "type": "boolean"
                              },
                              "functions": {
                                "type": "array",
                                "maxItems": 8,
                                "description": "Ordered numeric metric transformations; see the documented dashboard function semantics.",
                                "items": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "required": [
                                        "kind",
                                        "seconds",
                                        "operation"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "const": "rollup"
                                        },
                                        "seconds": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 604800
                                        },
                                        "operation": {
                                          "enum": [
                                            "average",
                                            "sum"
                                          ]
                                        }
                                      }
                                    },
                                    {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "required": [
                                        "kind",
                                        "limit"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "const": "rank"
                                        },
                                        "limit": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 2000
                                        }
                                      }
                                    },
                                    {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "required": [
                                        "kind",
                                        "window"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "const": "smooth"
                                        },
                                        "window": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 2000
                                        }
                                      }
                                    },
                                    {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "required": [
                                        "kind"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "const": "rate"
                                        }
                                      }
                                    }
                                  ]
                                }
                              },
                              "widget": {
                                "enum": [
                                  "query_value",
                                  "timeseries",
                                  "table",
                                  "top_list",
                                  "distribution",
                                  "heatmap",
                                  "pie",
                                  "treemap",
                                  "list",
                                  "log_stream",
                                  "notes"
                                ]
                              },
                              "note": {
                                "type": "string",
                                "maxLength": 5000
                              }
                            }
                          }
                        },
                        "variables": {
                          "type": "object",
                          "required": [
                            "team",
                            "environment"
                          ],
                          "properties": {
                            "team": {
                              "type": "string"
                            },
                            "environment": {
                              "type": "string"
                            }
                          }
                        },
                        "range": {
                          "type": "object",
                          "required": [
                            "from",
                            "through"
                          ],
                          "properties": {
                            "from": {
                              "type": "string",
                              "pattern": "^[0-9]+$"
                            },
                            "through": {
                              "type": "string",
                              "pattern": "^[0-9]+$"
                            }
                          }
                        },
                        "eventOverlays": {
                          "type": "array",
                          "maxItems": 50,
                          "uniqueItems": true,
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Private authorized custom-event references; resolved at read time. Definition credentials do not gain event access."
                        },
                        "annotations": {
                          "type": "array",
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "required": [
                              "at",
                              "label"
                            ],
                            "properties": {
                              "at": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string",
                                "maxLength": 300
                              }
                            }
                          }
                        }
                      }
                    },
                    "state": {
                      "enum": [
                        "active",
                        "archived",
                        "quarantined"
                      ]
                    },
                    "versions": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ]
      }
    },
    "/api/porthole/v1/dashboards/archive": {
      "post": {
        "summary": "Archive an exact dashboard revision, retaining history",
        "description": "Updates require id and the exact current revision in the body. A scoped read credential cannot mutate. Idempotency-Key is optional and makes repeated identical native writes durable. Native writes require owner, admin or maintainer role and a same-origin Origin header. JSON bodies are limited to 8192 bytes.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "description": "Must equal the configured application origin for native writes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "revision"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Committed revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "revision",
                    "state"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Reduce the request size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Use a supported Content-Type and encoding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "NativeSession": []
          }
        ]
      }
    },
    "/api/porthole/v1/pipelines": {
      "get": {
        "summary": "Read current pipeline configuration and first history page",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Current native owner session only, within current service, environment and team scope. Authorization headers always refuse, including with an owner cookie. Current authority is rechecked on every page. Reads change no pipeline or telemetry. History is descending, bounded to the first page snapshot; newer activations require a new traversal. Unknown or repeated query parameters refuse.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque signed continuation. Keep the same limit. Bound to the current owner and membership revision; survives Worker restart.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current global revision, authorized active definition or null, and immutable history page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revision",
                    "definition",
                    "history",
                    "snapshot",
                    "cursor"
                  ],
                  "properties": {
                    "history": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "$ref": "#/components/schemas/PipelineRevision"
                      }
                    },
                    "snapshot": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "definition": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/PipelineDefinition"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/pipelines/catalog": {
      "get": {
        "summary": "Read the native processor catalog",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Current native owner session only, within current service, environment and team scope. Authorization headers always refuse, including with an owner cookie. Current authority is rechecked on every page. Reads change no pipeline or telemetry. History is descending, bounded to the first page snapshot; newer activations require a new traversal. Unknown or repeated query parameters refuse.",
        "responses": {
          "200": {
            "description": "Implemented processor examples and supported native limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/pipelines/revisions": {
      "get": {
        "summary": "Page immutable pipeline revision history",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Current native owner session only, within current service, environment and team scope. Authorization headers always refuse, including with an owner cookie. Current authority is rechecked on every page. Reads change no pipeline or telemetry. History is descending, bounded to the first page snapshot; newer activations require a new traversal. Unknown or repeated query parameters refuse.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque signed continuation. Keep the same limit. Bound to the current owner and membership revision; survives Worker restart.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Snapshot-consistent authorized history page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineHistory"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/pipelines/revisions/{revision}": {
      "get": {
        "summary": "Read one exact immutable pipeline revision",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "description": "Current native owner session only, within current service, environment and team scope. Authorization headers always refuse, including with an owner cookie. Current authority is rechecked on every page. Reads change no pipeline or telemetry. History is descending, bounded to the first page snapshot; newer activations require a new traversal. Unknown or repeated query parameters refuse.",
        "parameters": [
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact authorized revision, including inactive history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineRevision"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Check the identifier and current access; inaccessible objects may be hidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/genai": {
      "get": {
        "summary": "Read scoped GenAI metadata and observed usage",
        "security": [
          {
            "NativeSession": []
          },
          {
            "ScopedCredential": []
          }
        ],
        "description": "Current trace authority, snapshot and paging rules apply. Identical span copies do not add usage. Missing token counters, USD, rate source and authorized provider reconciliation stay unavailable. Content capture is disabled.",
        "parameters": [
          {
            "name": "trace",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "team",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "through",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Observed GenAI calls and provider, model and feature groups for this page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Wait for Retry-After before resuming.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/porthole/v1/openapi.json": {
      "get": {
        "summary": "Read this contract through the protected API",
        "security": [
          {
            "NativeSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "OpenAPI document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Correct the rejected input; expression errors include field and hint when available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in or supply a valid live credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Use an authorized scope and action. Native writes require the configured same-origin Origin header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Use the documented method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Refresh current authority and revision; reuse an idempotency key only for the identical request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Restore service availability and retry; a failed request is not evidence of acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ScopedCredential": {
        "type": "http",
        "scheme": "bearer",
        "description": "Porthole scoped credential in Authorization. Intake requires telemetry.write; queries require telemetry.read; definition reads require definitions.read. Signal and resource grants, live custody and limits apply. Credentials in URL query parameters are forbidden."
      },
      "NativeSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-operator_session",
        "description": "Native installation session. Local development uses an origin-specific cookie name. Native mutation roles are owner, admin or maintainer; unsafe requests require a same-origin Origin header. Authorization credentials cannot mutate definitions."
      }
    },
    "schemas": {
      "QueryInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "JSON object, at most 8192 bytes; duplicate keys refuse. Visual queries need signal. Text dialects can infer signal. Native scope filters are optional and intersect live grants. Empty optional fields mean unset. Native and expression filters must agree.",
        "properties": {
          "dialect": {
            "enum": [
              "visual",
              "promql",
              "sql",
              "lucene"
            ],
            "default": "visual"
          },
          "expression": {
            "type": "string",
            "maxLength": 2048,
            "description": "Visual requires empty text. PromQL supports one bare metric selector with exact scope labels. SQL supports COUNT(*) on logs, AVG(value) on metrics with one exact metric, or discrete p95 duration on traces, with exact scope equalities. Lucene supports exact log scope terms joined by AND. No general query-language execution; unsupported syntax refuses."
          },
          "mode": {
            "enum": [
              "records",
              "range"
            ],
            "default": "records",
            "description": "Range mode is visual scalar-gauge evaluation, with no record cursor, limit or from and through fields."
          },
          "start": {
            "type": "string",
            "description": "Range start as unsigned Unix nanoseconds, inclusive."
          },
          "end": {
            "type": "string",
            "description": "Range end as unsigned Unix nanoseconds, inclusive."
          },
          "step": {
            "type": [
              "string",
              "number"
            ],
            "description": "Required whole seconds from 1 through 86400 in range mode. At most 1000 instants."
          },
          "lookback": {
            "type": [
              "string",
              "number"
            ],
            "description": "Required whole seconds from 1 through 86400. Latest point per producer in the interval (instant minus lookback, instant]."
          },
          "groupBy": {
            "type": "string",
            "description": "Required comma-separated list of at most eight attribute or scope labels; empty means one group."
          },
          "aggregation": {
            "enum": [
              "sum",
              "average",
              "min",
              "max"
            ],
            "description": "Required gauge aggregation. Each group keeps one exact unit throughout the range; mixed units refuse before a snapshot is saved."
          },
          "signal": {
            "enum": [
              "logs",
              "traces",
              "metrics",
              "profiles"
            ]
          },
          "service": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
          },
          "environment": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
          },
          "team": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
          },
          "from": {
            "type": [
              "string",
              "number"
            ],
            "description": "Inclusive unsigned 64-bit Unix nanoseconds. Use decimal strings to avoid numeric precision loss."
          },
          "through": {
            "type": [
              "string",
              "number"
            ],
            "description": "Inclusive Unix nanoseconds, at least from."
          },
          "cursor": {
            "type": "string",
            "description": "Opaque cursor returned by a previous page."
          },
          "snapshot": {
            "type": [
              "string",
              "number"
            ],
            "description": "Nonnegative safe integer completion watermark; defaults to latest completed batch."
          },
          "limit": {
            "type": [
              "string",
              "number"
            ],
            "description": "Integer 1 to 200, or up to 2000 when trace is selected. Default 100."
          },
          "record": {
            "type": "string",
            "pattern": "^[a-f0-9-]{36}:[0-9]+$",
            "description": "Exact original retained record ID; current scope still applies."
          },
          "trace": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "description": "Nonzero trace ID; traces only."
          },
          "metric": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Exact metric name, metrics only; control characters refuse."
          }
        }
      },
      "QueryResult": {
        "type": "object",
        "required": [
          "snapshot",
          "from",
          "through",
          "queryRef",
          "records",
          "cursor",
          "archive",
          "source",
          "parameters",
          "replay"
        ],
        "properties": {
          "snapshot": {
            "type": "integer",
            "minimum": 0
          },
          "from": {
            "type": "string"
          },
          "through": {
            "type": "string"
          },
          "queryRef": {
            "type": "string",
            "format": "uuid"
          },
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Retained normalized telemetry row with object payload; shape depends on signal and storage backend.",
              "additionalProperties": true
            }
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "archive": {
            "type": "boolean"
          },
          "source": {
            "type": "object",
            "properties": {
              "dialect": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            }
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          "range": {
            "type": "object",
            "description": "Bounded scalar-gauge range over one completed-batch watermark. Entire request refuses on mixed units, unsupported metric types or exceeded scan bounds. Missing instants remain absent. No conversion is applied.",
            "required": [
              "version",
              "state",
              "start",
              "end",
              "step",
              "lookback",
              "groupBy",
              "aggregation",
              "series"
            ],
            "properties": {
              "version": {
                "const": 1
              },
              "state": {
                "const": "complete"
              },
              "start": {
                "type": "string"
              },
              "end": {
                "type": "string"
              },
              "step": {
                "type": "integer"
              },
              "lookback": {
                "type": "integer"
              },
              "groupBy": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "aggregation": {
                "enum": [
                  "sum",
                  "average",
                  "min",
                  "max"
                ]
              },
              "series": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "labels",
                    "unit",
                    "points"
                  ],
                  "properties": {
                    "labels": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "unit": {
                      "type": "string"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "timestamp",
                          "value",
                          "contributors"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "contributors": {
                            "type": "integer",
                            "minimum": 1
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "aggregate": {
            "type": "object",
            "description": "Aggregate is null when pagination makes the result partial, and for empty numeric selections. Count is zero on a complete empty result.",
            "required": [
              "kind",
              "value",
              "state",
              "unit",
              "count"
            ],
            "properties": {
              "kind": {
                "enum": [
                  "count",
                  "average",
                  "p95"
                ]
              },
              "value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "state": {
                "enum": [
                  "partial",
                  "complete",
                  "empty"
                ]
              },
              "unit": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "replay": {
            "type": "string"
          }
        }
      },
      "PipelineDefinition": {
        "type": "object",
        "required": [
          "service",
          "environment",
          "team",
          "processors",
          "metrics"
        ],
        "properties": {
          "service": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "team": {
            "type": "string"
          },
          "processors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "exclude": {
            "type": "object"
          },
          "redaction": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "PipelineRevision": {
        "type": "object",
        "required": [
          "revision",
          "definition",
          "created_at",
          "owner_id",
          "state"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "definition": {
            "type": "object",
            "required": [
              "service",
              "environment",
              "team",
              "processors",
              "metrics"
            ],
            "properties": {
              "service": {
                "type": "string"
              },
              "environment": {
                "type": "string"
              },
              "team": {
                "type": "string"
              },
              "processors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "type"
                  ],
                  "properties": {
                    "type": {
                      "type": "string"
                    }
                  }
                }
              },
              "metrics": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "exclude": {
                "type": "object"
              },
              "redaction": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "created_at": {
            "type": "integer",
            "description": "Unix milliseconds."
          },
          "owner_id": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "PipelineHistory": {
        "type": "object",
        "required": [
          "history",
          "snapshot",
          "cursor"
        ],
        "properties": {
          "history": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/PipelineRevision"
            }
          },
          "snapshot": {
            "type": "integer",
            "minimum": 0
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Scope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "services",
          "environments",
          "teams"
        ],
        "properties": {
          "services": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^(\\*|[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119})$"
            }
          },
          "environments": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^(\\*|[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119})$"
            }
          },
          "teams": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^(\\*|[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119})$"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "status": {
                "type": "integer"
              },
              "requestId": {
                "type": "string"
              }
            }
          }
        }
      },
      "Definition": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "name",
          "scope",
          "body",
          "revision",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "monitor",
              "repair"
            ]
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "body": {
            "oneOf": [
              {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "type",
                      "signal",
                      "hosts",
                      "missedAfterSeconds",
                      "pendingSeconds",
                      "recoverySeconds"
                    ],
                    "properties": {
                      "type": {
                        "const": "host-heartbeat"
                      },
                      "signal": {
                        "enum": [
                          "logs",
                          "metrics",
                          "traces",
                          "profiles"
                        ]
                      },
                      "hosts": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 100,
                        "uniqueItems": true,
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$"
                        }
                      },
                      "missedAfterSeconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 86400
                      },
                      "pendingSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      },
                      "recoverySeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "signal",
                      "operator",
                      "threshold",
                      "windowSeconds"
                    ],
                    "properties": {
                      "signal": {
                        "enum": [
                          "logs",
                          "metrics",
                          "traces"
                        ]
                      },
                      "operator": {
                        "enum": [
                          "above",
                          "below"
                        ]
                      },
                      "threshold": {
                        "type": "number"
                      },
                      "windowSeconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 86400
                      }
                    }
                  }
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "steps",
                  "expiresAt"
                ],
                "properties": {
                  "expiresAt": {
                    "type": "integer"
                  },
                  "steps": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "kind",
                        "target",
                        "revision"
                      ],
                      "properties": {
                        "kind": {
                          "enum": [
                            "restart",
                            "rollback"
                          ]
                        },
                        "target": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                        },
                        "revision": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,119}$"
                        }
                      }
                    }
                  }
                }
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "enum": [
              "inactive",
              "active",
              "approved",
              "archived",
              "quarantined"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "updated_at": {
            "type": "integer"
          }
        }
      }
    }
  }
}
