{
  "components": {
    "schemas": {
      "UUID": {
        "format": "uuid",
        "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
        "type": "string"
      }
    },
    "securitySchemes": {
      "keycloak-bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Access token issued by the Keycloak realm `startupos`. Send it as `Authorization: Bearer <token>`. A missing, expired or invalid token returns 401; a valid token without the required role returns 403."
      },
      "stream-token": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "Short-lived, enrolment-scoped stream token minted by the matching authenticated `stream-token` operation. Used because a cross-origin video element cannot send an Authorization header."
      },
      "livekit-signature": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "JWT signed by the LiveKit server, sent without a `Bearer ` prefix and verified by the service. Only the LiveKit server calls this operation."
      }
    }
  },
  "info": {
    "title": "StartupOS analytics service",
    "version": "a54687de",
    "description": "Generated at build time from the service's JAX-RS resources (SmallRye OpenAPI) and annotated by the overlay in docs-site/openapi/overlays. Every operation requires a Keycloak access token unless the operation says otherwise. Health and metrics endpoints are internal and are not documented."
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/v1/admin/analytics/backfill": {
      "post": {
        "operationId": "AnalyticsBackfillResource_run",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "retryFailed",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics backfill"
        ],
        "summary": "Run"
      }
    },
    "/api/v1/admin/analytics/backfill/failures": {
      "get": {
        "operationId": "AnalyticsBackfillResource_failures",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics backfill"
        ],
        "summary": "Failures"
      }
    },
    "/api/v1/admin/analytics/backfill/status": {
      "get": {
        "operationId": "AnalyticsBackfillResource_status",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics backfill"
        ],
        "summary": "Status"
      }
    },
    "/api/v1/admin/at-risk": {
      "get": {
        "operationId": "AnalyticsResource_getAtRisk",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics"
        ],
        "summary": "Get at risk"
      }
    },
    "/api/v1/admin/dashboard": {
      "get": {
        "operationId": "AnalyticsResource_adminDashboard",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics"
        ],
        "summary": "Admin dashboard"
      }
    },
    "/api/v1/analytics/lms": {
      "get": {
        "operationId": "AnalyticsResource_lmsAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "programId",
            "schema": {
              "$ref": "#/components/schemas/UUID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics"
        ],
        "summary": "Lms analytics"
      }
    },
    "/api/v1/analytics/mentors": {
      "get": {
        "operationId": "AnalyticsResource_mentorAnalytics",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics"
        ],
        "summary": "Mentor analytics"
      }
    },
    "/api/v1/cm/dashboard": {
      "get": {
        "operationId": "AnalyticsResource_cmDashboard",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics"
        ],
        "summary": "Cm dashboard"
      }
    },
    "/api/v1/cm/export": {
      "post": {
        "operationId": "AnalyticsResource_exportReport",
        "parameters": [
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "tags": [
          "Analytics"
        ],
        "summary": "Export report"
      }
    }
  },
  "security": [
    {
      "keycloak-bearer": []
    }
  ],
  "tags": [
    {
      "name": "Analytics backfill",
      "description": "Administrative backfill of analytics data: start, status and failures."
    },
    {
      "name": "Analytics",
      "description": "Dashboards and at-risk reporting for administrators."
    }
  ]
}
