{
  "openapi": "3.0.0",
  "info": {
    "description": "OllyGarden's read-only REST API service that provides secure, high-performance, and programmatic access to observability insights and telemetry quality data.",
    "title": "OllyGarden REST API",
    "contact": {
      "name": "OllyGarden Engineering",
      "url": "https://olly.garden"
    },
    "version": "1.0"
  },
  "paths": {
    "/v1/analytics/log-volume": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve log volume breakdown by severity for the entire organization over a specified time period. Queries the logs_severity_total counter from Prometheus.",
        "tags": [
          "analytics"
        ],
        "summary": "Get organization log volume",
        "operationId": "getOrganizationLogVolume",
        "parameters": [
          {
            "description": "Time period for the query",
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "6h",
                "12h",
                "24h",
                "7d",
                "30d"
              ],
              "default": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved log volume",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.LogVolumeData"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid period parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to query Prometheus",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Prometheus not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/services": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Returns service usage and cost analytics data",
        "tags": [
          "analytics"
        ],
        "summary": "Get service analytics",
        "operationId": "getServiceAnalytics",
        "parameters": [
          {
            "description": "Maximum number of services to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved service analytics",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/insights": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Returns a paginated list of insights for the organization with optional filters",
        "tags": [
          "insights"
        ],
        "summary": "List insights",
        "operationId": "listInsights",
        "parameters": [
          {
            "description": "Maximum number of items to return (1-100, default: 20)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of items to skip (default: 0)",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by service ID (UUID)",
            "name": "service_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by status (comma-separated: active,archived,muted)",
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by signal type (trace, metric, log)",
            "name": "signal_type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by impact (comma-separated: Critical,Important,Normal,Low)",
            "name": "impact",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by created date from (RFC3339)",
            "name": "date_from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by created date to (RFC3339)",
            "name": "date_to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort field with +/- prefix (default: -created_at). Valid: created_at, detected_ts, updated_at, impact, signal_type",
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.Insight"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/insights/{id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a specific insight by its unique identifier",
        "tags": [
          "insights"
        ],
        "summary": "Get insight by ID",
        "operationId": "getInsight",
        "parameters": [
          {
            "description": "Insight ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved insight",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.Insight"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid insight ID parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Insight not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/insights/{id}/summary": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve an AI-generated summary for a specific insight. Returns cached summary if available, otherwise generates a new one via Lotus.",
        "tags": [
          "insights"
        ],
        "summary": "Get AI-generated summary for an insight",
        "operationId": "getInsightSummary",
        "parameters": [
          {
            "description": "Insight ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved summary",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.InsightSummary"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid insight ID parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Insight not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Summary service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organization": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Returns organization tier (subscription level) and instrumentation quality score",
        "tags": [
          "organization"
        ],
        "summary": "Get organization details",
        "operationId": "getOrganization",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.Organization"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/admin/installations": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the admin installations listing request to Rose agent-server. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "codebase"
        ],
        "summary": "List Rose installations (admin)",
        "operationId": "listRoseAdminInstallations",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/codebase/deliveryhero/migrate/execute": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a DeliveryHero migration trigger request to Rose agent-server. Rose determines the migration from the codebase and owns plan entitlement and org allowlist checks. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Execute DeliveryHero migration",
        "operationId": "executeRoseDeliveryHeroMigration",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/codebase/findings": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the codebase findings request to Rose agent-server. Filters findings by execution and active or resolved status, with query parameters forwarded verbatim. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "List Rose codebase findings",
        "operationId": "listRoseCodebaseFindings",
        "parameters": [
          {
            "description": "Execution ID",
            "name": "executionId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Finding status",
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "resolved",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/codebase/fix/execute": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a codebase fix trigger request to Rose agent-server. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Execute codebase fix",
        "operationId": "executeRoseCodebaseFix",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/codebase/instrumentation/execute": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a codebase instrumentation trigger request to Rose agent-server. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Execute codebase instrumentation",
        "operationId": "executeRoseCodebaseInstrumentation",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/codebase/review/execute": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a codebase review trigger request to Rose agent-server. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Execute codebase review",
        "operationId": "executeRoseCodebaseReview",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/executions": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the executions listing request to Rose agent-server. Returns paginated Rose runs and forwards supported query filters. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "List Rose executions",
        "operationId": "listRoseExecutions",
        "parameters": [
          {
            "description": "Page size (default 50, max 100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Rows to skip (default 0)",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Execution status",
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository ID",
            "name": "repositoryId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated execution kinds, e.g. review,deliveryhero-migrate-execute",
            "name": "executionType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/executions/{execution_id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards one execution detail request to Rose agent-server. Returns the execution summary, current phase, ordered phases, and event timeline for polling UIs. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Get Rose execution",
        "operationId": "getRoseExecution",
        "parameters": [
          {
            "description": "Execution ID",
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/executions/{execution_id}/agent-events": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards an execution agent-events request to Rose agent-server. Returns the append-only, seq-ordered agent-events timeline for one execution; use afterSeq as a poll cursor to fetch only events with seq greater than the given value. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Get Rose execution agent events",
        "operationId": "listRoseExecutionAgentEvents",
        "parameters": [
          {
            "description": "Execution ID",
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only return events with seq greater than this value",
            "name": "afterSeq",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Maximum number of events to return",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/findings": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the findings listing request to Rose agent-server's codebase findings resource. Returns paginated findings for the organization derived from the token and forwards severity, category, page, and page_size query filters verbatim. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "List Rose findings",
        "operationId": "listRoseFindings",
        "parameters": [
          {
            "description": "Comma-separated severities, e.g. critical,high",
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated categories, e.g. Sensitive Data,Volume",
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default 1)",
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Page size (default 50, max 100)",
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/findings/summary": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the codebase findings summary request to Rose agent-server. Returns active-finding counts for the organization, faceted by severity and category. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Get Rose findings summary",
        "operationId": "getRoseFindingsSummary",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/onboarding/repos": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a repo selection request to Rose agent-server. Activates selected repos and completes onboarding. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "onboarding"
        ],
        "summary": "Select onboarding repos",
        "operationId": "selectRoseOnboardingRepositories",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/onboarding/session": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards an onboarding session creation request to Rose agent-server. Returns a GitHub App installation URL. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "onboarding"
        ],
        "summary": "Create onboarding session",
        "operationId": "createRoseOnboardingSession",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/onboarding/status": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards an onboarding status request to Rose agent-server. Returns current onboarding state and repo counts. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "onboarding"
        ],
        "summary": "Get onboarding status",
        "operationId": "getRoseOnboardingStatus",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/repositories": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the repository inventory request to Rose agent-server. Returns installation-nested repositories for the active org. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "List Rose repositories",
        "operationId": "listRoseRepositories",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/repositories/{repository_id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards one repository detail request to Rose agent-server. Returns repository state, instrumentation metadata, and active findings for the active org. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Get Rose repository",
        "operationId": "getRoseRepository",
        "parameters": [
          {
            "description": "Repository ID",
            "name": "repository_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a repository active-status patch to Rose agent-server. Activates or deactivates a repository for Rose; enforces the org repo limit on activation. Accepts a Clerk JWT or an Olive API key (og_sk_*); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose.",
        "tags": [
          "codebase"
        ],
        "summary": "Update repository active status",
        "operationId": "updateRoseRepository",
        "parameters": [
          {
            "description": "Repository ID",
            "name": "repository_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "description": "Active status patch",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Request Entity Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/repositories/{repository_id}/settings": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a repository settings request to Rose agent-server. Returns custom review and fix instructions for a specific repository. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "codebase"
        ],
        "summary": "Get repository settings",
        "operationId": "getRoseRepositorySettings",
        "parameters": [
          {
            "description": "Repository ID",
            "name": "repository_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards a repository settings update to Rose agent-server. Saves custom review and fix instructions for a specific repository. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "codebase"
        ],
        "summary": "Update repository settings",
        "operationId": "updateRoseRepositorySettings",
        "parameters": [
          {
            "description": "Repository ID",
            "name": "repository_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "description": "Repository settings",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Request Entity Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rose/settings/organization": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards the organization settings request to Rose agent-server. Returns custom review and fix instructions for the active org. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "settings"
        ],
        "summary": "Get organization settings",
        "operationId": "getRoseOrganizationSettings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Forwards an organization settings update to Rose agent-server. Saves custom review and fix instructions for the active org. Requires a Clerk user session (JWT); Olive authenticates the caller and forwards a short-lived Olive-signed token to Rose. API keys are authenticated but receive 403.",
        "tags": [
          "settings"
        ],
        "summary": "Update organization settings",
        "operationId": "updateRoseOrganizationSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "description": "Organization settings",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.APIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Request Entity Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a paginated list of services for the authenticated organization",
        "tags": [
          "services"
        ],
        "summary": "List services",
        "operationId": "listServices",
        "parameters": [
          {
            "description": "Maximum number of items to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "description": "Number of items to skip for pagination",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "description": "Filter to only favorite services",
            "name": "favorite",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved services",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.Service"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/grouped": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve services grouped by name/namespace/environment",
        "tags": [
          "services"
        ],
        "summary": "List grouped services",
        "operationId": "listGroupedServices",
        "parameters": [
          {
            "description": "Search query to filter services by name",
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of groups to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "description": "Number of groups to skip for pagination",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "description": "Sort order",
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "insights-first",
                "name-asc",
                "name-desc",
                "created-asc",
                "created-desc"
              ],
              "default": "insights-first"
            }
          },
          {
            "description": "Filter to only favorite services",
            "name": "favorite",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved grouped services",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.GroupedService"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/search": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Search for services by name with optional environment/namespace filters",
        "tags": [
          "services"
        ],
        "summary": "Search services",
        "operationId": "searchServices",
        "parameters": [
          {
            "description": "Search query",
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of results to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "description": "Number of results to skip for pagination",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "description": "Filter by environment",
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by namespace",
            "name": "namespace",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully searched services",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.Service"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a specific service by its unique identifier",
        "tags": [
          "services"
        ],
        "summary": "Get service by ID",
        "operationId": "getService",
        "parameters": [
          {
            "description": "Service ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved service",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.Service"
                        },
                        "links": {
                          "$ref": "#/components/schemas/api.ServiceLinks"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid service ID parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{id}/analytics/log-volume": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve log volume breakdown by severity for a specific service over a specified time period. Queries the logs_severity_total counter from Prometheus filtered by service name, namespace, and environment.",
        "tags": [
          "analytics"
        ],
        "summary": "Get service log volume",
        "operationId": "getServiceLogVolume",
        "parameters": [
          {
            "description": "Service ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "description": "Time period for the query",
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "6h",
                "12h",
                "24h",
                "7d",
                "30d"
              ],
              "default": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved service log volume",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.LogVolumeData"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid period parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to query Prometheus",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Prometheus not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{id}/favorite": {
      "patch": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Update the favorite flag for a specific service",
        "tags": [
          "services"
        ],
        "summary": "Set service favorite status",
        "operationId": "updateServiceFavorite",
        "parameters": [
          {
            "description": "Service ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.SetFavoriteRequest"
              }
            }
          },
          "description": "Favorite status",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated service favorite status",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.Service"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{id}/insights": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a paginated list of insights for a specific service",
        "tags": [
          "insights"
        ],
        "summary": "List insights for a service",
        "operationId": "listServiceInsights",
        "parameters": [
          {
            "description": "Service ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "description": "Filter by insight status (comma-separated)",
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "muted"
              ],
              "default": "active"
            }
          },
          {
            "description": "Maximum number of items to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "description": "Number of items to skip for pagination",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved insights",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.Insight"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{id}/versions": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve other versions of the same service (same name, different version/env)",
        "tags": [
          "services"
        ],
        "summary": "Get related service versions",
        "operationId": "listServiceVersions",
        "parameters": [
          {
            "description": "Service ID",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "description": "Maximum number of versions to return",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved related versions",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.Service"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a paginated list of webhook configurations for the authenticated organization",
        "tags": [
          "webhooks"
        ],
        "summary": "List webhook configurations",
        "operationId": "listWebhooks",
        "parameters": [
          {
            "description": "Maximum number of items to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "description": "Number of items to skip for pagination",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved webhook configurations",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.WebhookConfig"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Create a new webhook configuration for the authenticated organization",
        "tags": [
          "webhooks"
        ],
        "summary": "Create a webhook configuration",
        "operationId": "createWebhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.CreateWebhookRequest"
              }
            }
          },
          "description": "Webhook configuration to create",
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successfully created webhook configuration",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.WebhookConfig"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{webhook_id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a specific webhook configuration by its unique identifier",
        "tags": [
          "webhooks"
        ],
        "summary": "Get webhook configuration by ID",
        "operationId": "getWebhook",
        "parameters": [
          {
            "description": "Webhook Configuration ID",
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved webhook configuration",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.WebhookConfig"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook ID parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Update an existing webhook configuration",
        "tags": [
          "webhooks"
        ],
        "summary": "Update a webhook configuration",
        "operationId": "updateWebhook",
        "parameters": [
          {
            "description": "Webhook Configuration ID",
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.UpdateWebhookRequest"
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated webhook configuration",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.WebhookConfig"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Delete an existing webhook configuration",
        "tags": [
          "webhooks"
        ],
        "summary": "Delete a webhook configuration",
        "operationId": "deleteWebhook",
        "parameters": [
          {
            "description": "Webhook Configuration ID",
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted webhook configuration"
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{webhook_id}/deliveries": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a paginated list of deliveries for a specific webhook configuration",
        "tags": [
          "webhooks"
        ],
        "summary": "List webhook deliveries",
        "operationId": "listWebhookDeliveries",
        "parameters": [
          {
            "description": "Webhook Configuration ID",
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "description": "Maximum number of items to return (1-100)",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "description": "Number of items to skip for pagination",
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/models.WebhookDelivery"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{webhook_id}/deliveries/{delivery_id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieve a specific webhook delivery by its unique identifier",
        "tags": [
          "webhooks"
        ],
        "summary": "Get webhook delivery by ID",
        "operationId": "getWebhookDelivery",
        "parameters": [
          {
            "description": "Webhook Configuration ID",
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "description": "Delivery ID",
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved delivery",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.WebhookDelivery"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Delivery not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{webhook_id}/test": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Send a sample event to the webhook URL to verify it is reachable",
        "tags": [
          "webhooks"
        ],
        "summary": "Test a webhook configuration",
        "operationId": "testWebhook",
        "parameters": [
          {
            "description": "Webhook Configuration ID",
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test result",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.APIResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/models.WebhookTestResponse"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/magnolia/findings": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Reads the most recent .findings.json for the caller's organization from the query-engine bucket and streams it verbatim. The orgId query parameter must match the JWT's org_id claim. The artifact is produced by the Rose magnolia-findings pipeline in two phases; between phases the groups carry analysis null.",
        "tags": [
          "magnolia"
        ],
        "summary": "Get the latest Magnolia findings artifact",
        "operationId": "getMagnoliaFindings",
        "parameters": [
          {
            "description": "Organization identifier that must match the authenticated JWT's org_id claim",
            "name": "orgId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Findings artifact (raw pipeline shape)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing orgId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — bearer token missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "orgId does not match the authenticated organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No findings available for this org yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to read findings from bucket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Magnolia query engine is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/magnolia/report": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Reads the most recent .reportv2.json for the caller's organization from the query-engine bucket and returns the full payload. The orgId query parameter must match the JWT's org_id claim. The report is pre-computed by magnolia-sampler and cached for up to one hour.",
        "tags": [
          "magnolia"
        ],
        "summary": "Get the latest pre-computed Magnolia report",
        "operationId": "getMagnoliaReport",
        "parameters": [
          {
            "description": "Organization identifier that must match the authenticated JWT's org_id claim",
            "name": "orgId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handlers.Envelope-handlers_ReportV2"
                }
              }
            }
          },
          "400": {
            "description": "Missing orgId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — bearer token missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "orgId does not match the authenticated organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No report available for this org yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to read report from bucket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Magnolia query engine is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/magnolia/visualize": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Streams the most recent .visualize.html for the caller's organization from the Rose v2 query-engine bucket. The orgId query parameter must match the JWT's org_id claim.",
        "tags": [
          "magnolia"
        ],
        "summary": "Get the latest Magnolia visualize.html",
        "operationId": "visualizeMagnoliaReport",
        "parameters": [
          {
            "description": "Organization identifier that must match the authenticated JWT's org_id claim",
            "name": "orgId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Raw HTML report bytes",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Missing orgId query parameter",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — bearer token missing or invalid",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "orgId does not match the authenticated organization",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No visualize report available for this org",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to read report from bucket",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Magnolia query engine is not configured",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/api.ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.ollygarden.cloud/api",
      "description": "Production server"
    },
    {
      "url": "/api",
      "description": "Relative URL"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "description": "Bearer authentication with an Olive API key, Clerk session JWT, or configured Clerk OAuth access token. OAuth webhook mutations require webhooks:write.",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Bearer"
      }
    },
    "schemas": {
      "api.APIResponse": {
        "type": "object",
        "properties": {
          "data": {},
          "links": {
            "$ref": "#/components/schemas/api.ServiceLinks"
          },
          "meta": {
            "$ref": "#/components/schemas/api.ResponseMeta"
          }
        }
      },
      "api.ErrorDetail": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "INVALID_PARAMETERS"
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "message": {
            "type": "string",
            "example": "Invalid request parameters"
          }
        }
      },
      "api.ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/api.ErrorDetail"
          },
          "meta": {
            "$ref": "#/components/schemas/api.ResponseMeta"
          }
        }
      },
      "api.ResponseMeta": {
        "type": "object",
        "properties": {
          "has_more": {
            "type": "boolean",
            "example": true
          },
          "hidden_count": {
            "type": "integer",
            "example": 12
          },
          "hidden_count_capped": {
            "type": "boolean"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2023-12-31T23:59:59Z"
          },
          "total": {
            "type": "integer",
            "example": 150
          },
          "trace_id": {
            "type": "string",
            "example": "4bf92f3577b34da6a3ce929d0e0e4736"
          }
        }
      },
      "api.ServiceLinks": {
        "type": "object",
        "properties": {
          "insights": {
            "type": "string",
            "example": "/api/v1/services/123e4567-e89b-12d3-a456-426614174000/insights"
          }
        }
      },
      "handlers.Envelope-handlers_ReportV2": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/handlers.ReportV2"
          },
          "generatedAt": {
            "type": "string"
          },
          "orgId": {
            "type": "string"
          },
          "window": {
            "$ref": "#/components/schemas/handlers.Window"
          }
        }
      },
      "handlers.ReportV2": {
        "type": "object",
        "properties": {
          "attributes": {
            "$ref": "#/components/schemas/repository.AttributesByScope"
          },
          "generatedAt": {
            "type": "string"
          },
          "logDuplication": {
            "$ref": "#/components/schemas/repository.LogDuplicationResult"
          },
          "logPatterns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.LogPatternRow"
            }
          },
          "logSeverities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.LogSeverityRow"
            }
          },
          "metrics": {
            "$ref": "#/components/schemas/repository.MetricsByType"
          },
          "services": {
            "$ref": "#/components/schemas/repository.ServicesBySignal"
          },
          "spanNames": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.SpanNameRow"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/repository.SummaryResult"
          },
          "traces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.TraceRow"
            }
          },
          "window": {
            "$ref": "#/components/schemas/handlers.Window"
          }
        }
      },
      "handlers.Window": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        }
      },
      "models.CreateWebhookRequest": {
        "type": "object",
        "required": [
          "name",
          "url"
        ],
        "properties": {
          "environments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_enabled": {
            "type": "boolean"
          },
          "min_severity": {
            "type": "string",
            "enum": [
              "Low",
              "Normal",
              "Important",
              "Critical"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "url": {
            "type": "string"
          }
        }
      },
      "models.GroupedService": {
        "type": "object",
        "properties": {
          "environment": {
            "description": "Service environment",
            "type": "string"
          },
          "insights_count": {
            "description": "Number of active insights for the most recent version",
            "type": "integer"
          },
          "instrumentation_score": {
            "description": "Latest instrumentation quality score for the most recent version. Omitted if no score exists.",
            "allOf": [
              {
                "$ref": "#/components/schemas/models.InstrumentationScore"
              }
            ]
          },
          "is_favorite": {
            "description": "Whether any version in this service group is marked as a favorite by the current user",
            "type": "boolean"
          },
          "latest_id": {
            "description": "ID of the most recently seen service version",
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "description": "Service name from OpenTelemetry service.name attribute",
            "type": "string"
          },
          "namespace": {
            "description": "Service namespace",
            "type": "string"
          },
          "version_count": {
            "description": "Number of different versions for this service group",
            "type": "integer"
          }
        }
      },
      "models.Insight": {
        "type": "object",
        "properties": {
          "attributes": {
            "description": "Dynamic object containing insight-specific attributes and telemetry data",
            "type": "object",
            "additionalProperties": {}
          },
          "created_at": {
            "description": "When the insight was created",
            "type": "string",
            "format": "date-time"
          },
          "detected_ts": {
            "description": "When the insight was detected by the system",
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "description": "Insight unique identifier",
            "type": "string",
            "format": "uuid"
          },
          "insight_type": {
            "description": "Type information for this insight",
            "allOf": [
              {
                "$ref": "#/components/schemas/models.InsightType"
              }
            ]
          },
          "service_environment": {
            "description": "Service environment (populated when insights are fetched with service info)",
            "type": "string"
          },
          "service_id": {
            "description": "ID of the service this insight belongs to",
            "type": "string",
            "format": "uuid"
          },
          "service_name": {
            "description": "Service name (populated when insights are fetched with service info)",
            "type": "string"
          },
          "service_namespace": {
            "description": "Service namespace (populated when insights are fetched with service info)",
            "type": "string"
          },
          "service_version": {
            "description": "Service version (populated when insights are fetched with service info)",
            "type": "string"
          },
          "status": {
            "description": "Current status of the insight (active, archived, muted)",
            "type": "string",
            "enum": [
              "active",
              "archived",
              "muted"
            ]
          },
          "telemetry_ts": {
            "description": "Timestamp from the telemetry data that triggered this insight (can be null)",
            "type": "string",
            "format": "date-time"
          },
          "trace_id": {
            "description": "OpenTelemetry trace ID (can be empty)",
            "type": "string"
          },
          "updated_at": {
            "description": "When the insight was last updated",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "models.InsightSummary": {
        "type": "object",
        "properties": {
          "cached": {
            "description": "Cached indicates if this summary was retrieved from cache",
            "type": "boolean"
          },
          "content": {
            "description": "Content is the generated summary text",
            "type": "string"
          },
          "generated_at": {
            "description": "GeneratedAt is when the summary was generated",
            "type": "string"
          },
          "insight_id": {
            "description": "InsightID is the unique identifier of the insight",
            "type": "string"
          },
          "model": {
            "description": "Model is the LLM model used to generate the summary",
            "type": "string"
          }
        }
      },
      "models.InsightType": {
        "type": "object",
        "properties": {
          "created_at": {
            "description": "When the insight type was created",
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "description": "Detailed description of what this insight detects",
            "type": "string"
          },
          "display_name": {
            "description": "Human-readable name for the insight type",
            "type": "string"
          },
          "id": {
            "description": "Insight type unique identifier",
            "type": "string",
            "format": "uuid"
          },
          "impact": {
            "description": "Impact level of the detected issue",
            "type": "string",
            "enum": [
              "Low",
              "Normal",
              "Important",
              "Critical"
            ]
          },
          "instrumentation_score_rule_id": {
            "description": "Associated instrumentation score rule ID (if any)",
            "type": "string"
          },
          "name": {
            "description": "Internal name/slug for the insight type",
            "type": "string"
          },
          "remediation_instructions": {
            "description": "Detailed instructions on how to fix the detected issue",
            "type": "string"
          },
          "signal_type": {
            "description": "Type of telemetry signal this insight applies to",
            "type": "string",
            "enum": [
              "trace",
              "metric",
              "log"
            ]
          },
          "updated_at": {
            "description": "When the insight type was last updated",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "models.InstrumentationScore": {
        "type": "object",
        "properties": {
          "calculated_timestamp": {
            "description": "Timestamp when the score was calculated",
            "type": "string",
            "format": "date-time"
          },
          "calculation_window_seconds": {
            "description": "Time window in seconds used for score calculation",
            "type": "integer"
          },
          "created_at": {
            "description": "When the score record was created",
            "type": "string",
            "format": "date-time"
          },
          "evaluated_rule_ids": {
            "description": "List of instrumentation rule IDs that were evaluated",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "description": "Instrumentation score unique identifier",
            "type": "string",
            "format": "uuid"
          },
          "score": {
            "description": "Instrumentation quality score (0-100)",
            "type": "integer",
            "maximum": 100,
            "minimum": 0
          }
        }
      },
      "models.LogVolumeData": {
        "type": "object",
        "properties": {
          "period": {
            "description": "Time period for the query (e.g., \"24h\", \"7d\")",
            "type": "string"
          },
          "severities": {
            "description": "Breakdown by severity level",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/models.LogVolumeSeverity"
            }
          },
          "total_count": {
            "description": "Total log record count across all severities",
            "type": "integer"
          }
        }
      },
      "models.LogVolumeSeverity": {
        "type": "object",
        "properties": {
          "percent": {
            "description": "Percentage of total log volume",
            "type": "number"
          },
          "record_count": {
            "description": "Number of log records for this severity",
            "type": "integer"
          },
          "severity_text": {
            "description": "Severity level (TRACE, DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN)",
            "type": "string"
          }
        }
      },
      "models.Organization": {
        "type": "object",
        "properties": {
          "score": {
            "description": "nil if no score exists",
            "allOf": [
              {
                "$ref": "#/components/schemas/models.OrganizationScore"
              }
            ]
          },
          "tier": {
            "$ref": "#/components/schemas/models.OrganizationTier"
          }
        }
      },
      "models.OrganizationScore": {
        "type": "object",
        "properties": {
          "updated_at": {
            "type": "string"
          },
          "value": {
            "type": "integer"
          }
        }
      },
      "models.OrganizationTier": {
        "type": "object",
        "properties": {
          "allowed_insight_types": {
            "description": "nil = all allowed",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          }
        }
      },
      "models.Service": {
        "type": "object",
        "properties": {
          "created_at": {
            "description": "When the service record was created",
            "type": "string",
            "format": "date-time"
          },
          "environment": {
            "description": "Service environment (can be empty)",
            "type": "string"
          },
          "first_seen_at": {
            "description": "When the service was first detected",
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "description": "Service unique identifier",
            "type": "string",
            "format": "uuid"
          },
          "instrumentation_score": {
            "description": "Latest instrumentation quality score for this service. Omitted if no instrumentation score has been calculated for the service yet.",
            "allOf": [
              {
                "$ref": "#/components/schemas/models.InstrumentationScore"
              }
            ]
          },
          "is_favorite": {
            "description": "Whether this service is marked as a favorite by the current user (computed from user_service_favorites)",
            "type": "boolean"
          },
          "last_seen_at": {
            "description": "When the service was last seen sending telemetry",
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "description": "Service name from OpenTelemetry service.name attribute",
            "type": "string"
          },
          "namespace": {
            "description": "Service namespace from OpenTelemetry service.namespace attribute (can be empty)",
            "type": "string"
          },
          "organization_id": {
            "description": "Organization that owns this service",
            "type": "string"
          },
          "updated_at": {
            "description": "When the service record was last updated",
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "description": "Service version (can be empty)",
            "type": "string"
          }
        }
      },
      "models.SetFavoriteRequest": {
        "type": "object",
        "required": [
          "is_favorite"
        ],
        "properties": {
          "is_favorite": {
            "description": "Whether the service should be marked as a favorite",
            "type": "boolean"
          }
        }
      },
      "models.UpdateWebhookRequest": {
        "type": "object",
        "properties": {
          "environments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_enabled": {
            "type": "boolean"
          },
          "min_severity": {
            "type": "string",
            "enum": [
              "Low",
              "Normal",
              "Important",
              "Critical"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "url": {
            "type": "string"
          }
        }
      },
      "models.WebhookConfig": {
        "type": "object",
        "properties": {
          "created_at": {
            "description": "When the webhook configuration was created",
            "type": "string",
            "format": "date-time"
          },
          "environments": {
            "description": "Environments to subscribe to; empty means all",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "event_types": {
            "description": "Insight type IDs to subscribe to; empty means all",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "description": "Webhook configuration unique identifier",
            "type": "string",
            "format": "uuid"
          },
          "is_enabled": {
            "description": "Whether the webhook is enabled",
            "type": "boolean"
          },
          "min_severity": {
            "description": "Minimum severity level (Low, Normal, Important, Critical)",
            "type": "string"
          },
          "name": {
            "description": "Human-readable name for the webhook",
            "type": "string"
          },
          "organization_id": {
            "description": "Organization that owns this webhook configuration",
            "type": "string"
          },
          "updated_at": {
            "description": "When the webhook configuration was last updated",
            "type": "string",
            "format": "date-time"
          },
          "url": {
            "description": "HTTPS URL to deliver events to",
            "type": "string"
          }
        }
      },
      "models.WebhookDelivery": {
        "type": "object",
        "properties": {
          "attempt_number": {
            "description": "Number of delivery attempts made",
            "type": "integer"
          },
          "completed_at": {
            "description": "When the delivery completed (success or exhausted)",
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "description": "When the delivery was created",
            "type": "string",
            "format": "date-time"
          },
          "error_message": {
            "description": "Error message if delivery failed",
            "type": "string"
          },
          "http_status_code": {
            "description": "HTTP status code returned by the webhook endpoint",
            "type": "integer"
          },
          "id": {
            "description": "Delivery unique identifier",
            "type": "string",
            "format": "uuid"
          },
          "idempotency_key": {
            "description": "Idempotency key for deduplication",
            "type": "string"
          },
          "insight_id": {
            "description": "Insight that triggered this delivery",
            "type": "string",
            "format": "uuid"
          },
          "organization_id": {
            "description": "Organization that owns this delivery",
            "type": "string"
          },
          "status": {
            "description": "Delivery status (pending, success, failed, exhausted)",
            "type": "string",
            "enum": [
              "pending",
              "success",
              "failed",
              "exhausted"
            ]
          },
          "webhook_config_id": {
            "description": "Webhook configuration that triggered this delivery",
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "models.WebhookTestResponse": {
        "type": "object",
        "properties": {
          "response_body": {
            "description": "First 1KB of the response body",
            "type": "string"
          },
          "status_code": {
            "description": "HTTP status code returned by the webhook endpoint",
            "type": "integer"
          },
          "success": {
            "description": "Whether the test was successful (2xx status code)",
            "type": "boolean"
          }
        }
      },
      "repository.AttributeRow": {
        "type": "object",
        "properties": {
          "attr_key": {
            "type": "string"
          },
          "avg_char_len": {
            "type": "number"
          },
          "max_char_len": {
            "type": "integer"
          },
          "occurrences": {
            "type": "integer"
          }
        }
      },
      "repository.AttributesByScope": {
        "type": "object",
        "properties": {
          "log": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.AttributeRow"
            }
          },
          "resource": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.AttributeRow"
            }
          },
          "span": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.AttributeRow"
            }
          }
        }
      },
      "repository.LogDuplicationResult": {
        "type": "object",
        "properties": {
          "dedup_potential_pct": {
            "type": "number"
          },
          "total": {
            "type": "integer"
          },
          "unique_log_messages": {
            "type": "integer"
          }
        }
      },
      "repository.LogPatternRow": {
        "type": "object",
        "properties": {
          "ServiceName": {
            "type": "string"
          },
          "SeverityText": {
            "type": "string"
          },
          "body_preview": {
            "type": "string"
          },
          "cnt": {
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "service_namespace": {
            "type": "string"
          }
        }
      },
      "repository.LogSeverityRow": {
        "type": "object",
        "properties": {
          "SeverityText": {
            "type": "string"
          },
          "cnt": {
            "type": "integer"
          },
          "environment": {
            "type": "string"
          }
        }
      },
      "repository.MetricDPByType": {
        "type": "object",
        "properties": {
          "gauge": {
            "type": "integer"
          },
          "histogram": {
            "type": "integer"
          },
          "sum": {
            "type": "integer"
          }
        }
      },
      "repository.MetricRow": {
        "type": "object",
        "properties": {
          "datapoints": {
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "metric_name": {
            "type": "string"
          },
          "metric_type": {
            "type": "string"
          },
          "service_name": {
            "type": "string"
          },
          "service_namespace": {
            "type": "string"
          },
          "value_diversity_pct": {
            "type": "number"
          }
        }
      },
      "repository.MetricsByType": {
        "type": "object",
        "properties": {
          "gauge": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.MetricRow"
            }
          },
          "histogram": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.MetricRow"
            }
          },
          "sum": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.MetricRow"
            }
          }
        }
      },
      "repository.ServiceCountBySignal": {
        "type": "object",
        "properties": {
          "services": {
            "type": "integer"
          },
          "signal": {
            "type": "string"
          }
        }
      },
      "repository.ServicesBySignal": {
        "type": "object",
        "properties": {
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.ServicesRow"
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.ServicesRow"
            }
          },
          "traces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.ServicesRow"
            }
          }
        }
      },
      "repository.ServicesRow": {
        "type": "object",
        "properties": {
          "datapoints": {
            "description": "Datapoints and the per-type breakdown are present when signal=metrics.",
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "gauge_datapoints": {
            "type": "integer"
          },
          "histogram_datapoints": {
            "type": "integer"
          },
          "log_count": {
            "description": "LogCount is present when signal=logs.",
            "type": "integer"
          },
          "service_name": {
            "type": "string"
          },
          "service_namespace": {
            "type": "string"
          },
          "span_count": {
            "description": "SpanCount and TraceCount are present when signal=traces.",
            "type": "integer"
          },
          "sum_datapoints": {
            "type": "integer"
          },
          "trace_count": {
            "type": "integer"
          }
        }
      },
      "repository.SpanNameRow": {
        "type": "object",
        "properties": {
          "ServiceName": {
            "type": "string"
          },
          "SpanKind": {
            "type": "string"
          },
          "SpanName": {
            "type": "string"
          },
          "cnt": {
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "service_namespace": {
            "type": "string"
          }
        }
      },
      "repository.SummaryResult": {
        "type": "object",
        "properties": {
          "service_counts_by_signal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/repository.ServiceCountBySignal"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/repository.SummaryTotals"
          }
        }
      },
      "repository.SummaryTotals": {
        "type": "object",
        "properties": {
          "log_records": {
            "type": "integer"
          },
          "metric_datapoints": {
            "type": "integer"
          },
          "metric_datapoints_by_type": {
            "$ref": "#/components/schemas/repository.MetricDPByType"
          },
          "spans": {
            "type": "integer"
          }
        }
      },
      "repository.TraceRow": {
        "type": "object",
        "properties": {
          "root_span_name": {
            "type": "string"
          },
          "service_name": {
            "type": "string"
          },
          "span_count": {
            "type": "integer"
          },
          "trace_id": {
            "type": "string"
          }
        }
      }
    }
  }
}
