{
  "openapi": "3.0.4",
  "info": {
    "title": "Kombine Flex Portal — operations diagnostics",
    "description": "For the hosting operations team only. Not needed by external portals or agents. Requires a separately issued JWT with the portal.diagnostics scope; manager tokens do not work here. This probe queries MySQL. Use the public /api/v1/status endpoint for routine availability checks.",
    "version": "v1"
  },
  "paths": {
    "/api/v1/database/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Checks database connectivity. Requires the portal.diagnostics scope.",
        "operationId": "GetDatabaseStatus",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseStatusResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "DiagnosticsJwt": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "DatabaseStatusResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Available, Unavailable, or NotConfigured.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Describes a connection probe without exposing infrastructure details."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      }
    },
    "securitySchemes": {
      "DiagnosticsJwt": {
        "type": "http",
        "description": "Operator-only JWT from the configured diagnostics issuer with scope portal.diagnostics.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Status"
    }
  ]
}