mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-14 13:38:39 -05:00
4607 lines
96 KiB
JSON
4607 lines
96 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "Checkmate API",
|
|
"summary": "Checkmate OpenAPI Specifications",
|
|
"description": "Checkmate is an open source monitoring tool used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.",
|
|
"contact": {
|
|
"name": "API Support",
|
|
"url": "mailto:support@bluewavelabs.ca",
|
|
"email": "support@bluewavelabs.ca"
|
|
},
|
|
"license": {
|
|
"name": "AGPLv3",
|
|
"url": "https://github.com/bluewave-labs/checkmate/tree/HEAD/LICENSE"
|
|
},
|
|
"version": "2.3"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "http://localhost:{PORT}/{API_PATH}",
|
|
"description": "Local Development Server",
|
|
"variables": {
|
|
"PORT": {
|
|
"default": "52345"
|
|
},
|
|
"API_PATH": {
|
|
"default": "api/v1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"url": "https://checkmate-demo.bluewavelabs.ca/{API_PATH}",
|
|
"description": "Checkmate Demo Server",
|
|
"variables": {
|
|
"API_PATH": {
|
|
"default": "api/v1"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"name": "auth",
|
|
"description": "Authentication and user management"
|
|
},
|
|
{
|
|
"name": "invite",
|
|
"description": "Team invitation management"
|
|
},
|
|
{
|
|
"name": "monitors",
|
|
"description": "Monitor management (uptime, page speed, hardware)"
|
|
},
|
|
{
|
|
"name": "checks",
|
|
"description": "Monitor check results and history"
|
|
},
|
|
{
|
|
"name": "maintenance-window",
|
|
"description": "Scheduled maintenance windows"
|
|
},
|
|
{
|
|
"name": "queue",
|
|
"description": "Job queue management"
|
|
},
|
|
{
|
|
"name": "status-page",
|
|
"description": "Public status page management"
|
|
},
|
|
{
|
|
"name": "settings",
|
|
"description": "Application configuration settings"
|
|
},
|
|
{
|
|
"name": "logs",
|
|
"description": "Application logs and diagnostics"
|
|
},
|
|
{
|
|
"name": "notifications",
|
|
"description": "Notification integrations (email, slack, discord, etc.)"
|
|
},
|
|
{
|
|
"name": "diagnostic",
|
|
"description": "System health and performance diagnostics"
|
|
},
|
|
{
|
|
"name": "incidents",
|
|
"description": "Incident management and resolution"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/auth/register": {
|
|
"post": {
|
|
"tags": ["auth"],
|
|
"summary": "Register new user",
|
|
"description": "Register a new user account with profile information",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RegisterRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "User registered successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/login": {
|
|
"post": {
|
|
"tags": ["auth"],
|
|
"summary": "User login",
|
|
"description": "Authenticate user with email and password",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/LoginRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Login successful",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/user/{userId}": {
|
|
"put": {
|
|
"tags": ["auth"],
|
|
"summary": "Update user profile",
|
|
"description": "Update user information including profile image",
|
|
"parameters": [
|
|
{
|
|
"name": "userId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UserUpdateRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["auth"],
|
|
"summary": "Delete user account",
|
|
"description": "Permanently delete user account and associated data",
|
|
"parameters": [
|
|
{
|
|
"name": "userId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/users": {
|
|
"get": {
|
|
"tags": ["auth"],
|
|
"summary": "Get all users",
|
|
"description": "Retrieve all users (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Users retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/users/superadmin": {
|
|
"get": {
|
|
"tags": ["auth"],
|
|
"summary": "Check superadmin exists",
|
|
"description": "Check if a superadmin account exists in the system",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Check completed",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"exists": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/recovery/request": {
|
|
"post": {
|
|
"tags": ["auth"],
|
|
"summary": "Request password reset",
|
|
"description": "Send password reset email to user",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["email"],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"format": "email",
|
|
"description": "User email address"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"description": "User not found"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/recovery/validate": {
|
|
"post": {
|
|
"tags": ["auth"],
|
|
"summary": "Validate recovery token",
|
|
"description": "Validate password reset token",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["recoveryToken"],
|
|
"properties": {
|
|
"recoveryToken": {
|
|
"type": "string",
|
|
"description": "Password reset token"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"400": {
|
|
"description": "Invalid or expired token"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/recovery/reset": {
|
|
"post": {
|
|
"tags": ["auth"],
|
|
"summary": "Reset password",
|
|
"description": "Reset user password with recovery token",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["recoveryToken", "password"],
|
|
"properties": {
|
|
"recoveryToken": {
|
|
"type": "string",
|
|
"description": "Password reset token"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"format": "password",
|
|
"description": "New password"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"400": {
|
|
"description": "Invalid token or password requirements not met"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/monitors": {
|
|
"post": {
|
|
"tags": ["monitors"],
|
|
"summary": "Create monitor",
|
|
"description": "Create a new monitoring endpoint",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateMonitorRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Monitor created successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/Monitor"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["monitors"],
|
|
"summary": "Delete all monitors",
|
|
"description": "Delete all monitors (superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/team": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get monitors by team",
|
|
"description": "Get monitors filtered by team with optional parameters",
|
|
"parameters": [
|
|
{
|
|
"name": "status",
|
|
"in": "query",
|
|
"description": "Filter by monitor status (up/down)",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
{
|
|
"name": "type",
|
|
"in": "query",
|
|
"description": "Filter by monitor type",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["http", "ping", "pagespeed", "hardware", "docker", "port"]
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"description": "Page number for pagination",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"default": 1
|
|
}
|
|
},
|
|
{
|
|
"name": "rowsPerPage",
|
|
"in": "query",
|
|
"description": "Number of monitors per page",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"default": 10
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"description": "Search filter value",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "field",
|
|
"in": "query",
|
|
"description": "Field to filter on",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["name", "url", "description"]
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Team monitors retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"monitors": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Monitor"
|
|
}
|
|
},
|
|
"totalCount": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/team/with-checks": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get monitors with recent checks",
|
|
"description": "Get team monitors with their most recent check results",
|
|
"parameters": [
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"description": "Number of recent checks to include per monitor",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 50,
|
|
"default": 10
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Monitors with checks retrieved successfully"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/team/groups": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get monitor groups by team",
|
|
"description": "Get all monitor groups for the authenticated user's team",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Monitor groups retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Monitor groups retrieved successfully"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"monitors": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/{monitorId}": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get monitor by ID",
|
|
"description": "Retrieve a specific monitor by its ID",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Monitor ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Monitor retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/Monitor"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": ["monitors"],
|
|
"summary": "Update monitor",
|
|
"description": "Update an existing monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UpdateMonitorRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["monitors"],
|
|
"summary": "Delete monitor",
|
|
"description": "Delete a specific monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/uptime/details/{monitorId}": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get uptime details",
|
|
"description": "Get detailed uptime statistics for a monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Uptime details retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/hardware/details/{monitorId}": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get hardware monitoring details",
|
|
"description": "Get hardware performance metrics for a monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Hardware details retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/pause/{monitorId}": {
|
|
"post": {
|
|
"tags": ["monitors"],
|
|
"summary": "Pause/unpause monitor",
|
|
"description": "Toggle monitor active status",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/pagespeed/details/{monitorId}": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get PageSpeed monitor details",
|
|
"description": "Get detailed PageSpeed monitoring data including performance metrics and Core Web Vitals",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The PageSpeed monitor ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "sortOrder",
|
|
"in": "query",
|
|
"description": "Sort order for results",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["asc", "desc"],
|
|
"default": "desc"
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"description": "Number of results to return",
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 50
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "PageSpeed details retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "PageSpeed details retrieved successfully"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"monitor": {
|
|
"$ref": "#/components/schemas/Monitor"
|
|
},
|
|
"checks": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Check"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/certificate/{monitorId}": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get SSL certificate info",
|
|
"description": "Get SSL certificate information for a monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Certificate information retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/demo": {
|
|
"post": {
|
|
"tags": ["monitors"],
|
|
"summary": "Add demo monitors",
|
|
"description": "Add preconfigured demo monitors for testing",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/export/json": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Export monitors to JSON",
|
|
"description": "Export all monitors to JSON format (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "JSON file generated successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Monitors exported successfully"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Monitor"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/bulk": {
|
|
"post": {
|
|
"tags": ["monitors"],
|
|
"summary": "Bulk import monitors",
|
|
"description": "Import monitors from CSV file",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"csvFile": {
|
|
"type": "string",
|
|
"format": "binary",
|
|
"description": "CSV file containing monitor data"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Monitors imported successfully"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/test-email": {
|
|
"post": {
|
|
"tags": ["monitors"],
|
|
"summary": "Send test email",
|
|
"description": "Send a test email notification",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/settings": {
|
|
"get": {
|
|
"tags": ["settings"],
|
|
"summary": "Get application settings",
|
|
"description": "Retrieve current application configuration",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Settings retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/AppSettings"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": ["settings"],
|
|
"summary": "Update application settings",
|
|
"description": "Update application configuration (admin/superadmin only)",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AppSettings"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/settings/test-email": {
|
|
"post": {
|
|
"tags": ["settings"],
|
|
"summary": "Send test email",
|
|
"description": "Send test email to verify email configuration",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/notifications": {
|
|
"post": {
|
|
"tags": ["notifications"],
|
|
"summary": "Create notification",
|
|
"description": "Create a new notification integration",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateNotificationRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Notification created successfully"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/notifications/team": {
|
|
"get": {
|
|
"tags": ["notifications"],
|
|
"summary": "Get team notifications",
|
|
"description": "Get all notification configurations for the team",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Notifications retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Notification"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/notifications/{id}": {
|
|
"get": {
|
|
"tags": ["notifications"],
|
|
"summary": "Get notification by ID",
|
|
"description": "Retrieve a specific notification configuration",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Notification retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": ["notifications"],
|
|
"summary": "Update notification",
|
|
"description": "Update an existing notification configuration",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateNotificationRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["notifications"],
|
|
"summary": "Delete notification",
|
|
"description": "Delete a notification configuration",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/notifications/test": {
|
|
"post": {
|
|
"tags": ["notifications"],
|
|
"summary": "Test notification",
|
|
"description": "Send a test notification to verify configuration",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/notifications/test/all": {
|
|
"post": {
|
|
"tags": ["notifications"],
|
|
"summary": "Test all notifications",
|
|
"description": "Send test notifications to all configured integrations",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/logs": {
|
|
"get": {
|
|
"tags": ["logs"],
|
|
"summary": "Get application logs",
|
|
"description": "Retrieve application logs (admin/superadmin only)",
|
|
"parameters": [
|
|
{
|
|
"name": "level",
|
|
"in": "query",
|
|
"description": "Log level filter",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["error", "warn", "info", "debug"]
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"description": "Number of log entries to return",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 1000,
|
|
"default": 100
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Logs retrieved successfully"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/diagnostic/system": {
|
|
"get": {
|
|
"tags": ["diagnostic"],
|
|
"summary": "Get system diagnostics",
|
|
"description": "Get system health and performance metrics (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "System diagnostics retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/SystemDiagnostics"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/user": {
|
|
"put": {
|
|
"tags": ["auth"],
|
|
"summary": "Update current user profile",
|
|
"description": "Update authenticated user's profile information",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UserUpdateRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["auth"],
|
|
"summary": "Delete current user account",
|
|
"description": "Delete authenticated user's account and associated data",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/users/{userId}": {
|
|
"get": {
|
|
"tags": ["auth"],
|
|
"summary": "Get user by ID",
|
|
"description": "Get a specific user by ID (superadmin only)",
|
|
"parameters": [
|
|
{
|
|
"name": "userId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": ["auth"],
|
|
"summary": "Update user by ID",
|
|
"description": "Update a specific user by ID (superadmin only)",
|
|
"parameters": [
|
|
{
|
|
"name": "userId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UserUpdateRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/users/{userId}/password": {
|
|
"put": {
|
|
"tags": ["auth"],
|
|
"summary": "Update user password by ID",
|
|
"description": "Update a specific user's password by ID (superadmin only)",
|
|
"parameters": [
|
|
{
|
|
"name": "userId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["password"],
|
|
"properties": {
|
|
"password": {
|
|
"type": "string",
|
|
"format": "password",
|
|
"minLength": 8,
|
|
"description": "New password for the user"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/invite": {
|
|
"post": {
|
|
"tags": ["invite"],
|
|
"summary": "Create invite token",
|
|
"description": "Create a new invitation token",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["email", "role"],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
"role": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"enum": ["user", "admin"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Invite token created successfully"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/invite/send": {
|
|
"post": {
|
|
"tags": ["invite"],
|
|
"summary": "Send invitation email",
|
|
"description": "Send invitation email to user",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["email"],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/invite/verify": {
|
|
"post": {
|
|
"tags": ["invite"],
|
|
"summary": "Verify invitation token",
|
|
"description": "Verify an invitation token",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["token"],
|
|
"properties": {
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"400": {
|
|
"description": "Invalid or expired token"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/checks/{monitorId}": {
|
|
"get": {
|
|
"tags": ["checks"],
|
|
"summary": "Get checks by monitor",
|
|
"description": "Get all checks for a specific monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Checks retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["checks"],
|
|
"summary": "Delete checks by monitor",
|
|
"description": "Delete all checks for a specific monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/checks/team": {
|
|
"get": {
|
|
"tags": ["checks"],
|
|
"summary": "Get checks by team",
|
|
"description": "Get all checks for team monitors",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Team checks retrieved successfully"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["checks"],
|
|
"summary": "Delete team checks",
|
|
"description": "Delete all checks for team (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/checks/team/summary": {
|
|
"get": {
|
|
"tags": ["checks"],
|
|
"summary": "Get team checks summary",
|
|
"description": "Get summary statistics for team checks",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Team checks summary retrieved successfully"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/checks/team/ttl": {
|
|
"put": {
|
|
"tags": ["checks"],
|
|
"summary": "Update checks TTL",
|
|
"description": "Update time-to-live for checks (admin/superadmin only)",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["ttl"],
|
|
"properties": {
|
|
"ttl": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Time to live in days"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/checks/check/{checkId}": {
|
|
"put": {
|
|
"tags": ["checks"],
|
|
"summary": "Acknowledge check",
|
|
"description": "Acknowledge a specific check",
|
|
"parameters": [
|
|
{
|
|
"name": "checkId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"ack": {
|
|
"type": "boolean",
|
|
"description": "Acknowledgement status"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/checks/{action}": {
|
|
"put": {
|
|
"tags": ["checks"],
|
|
"summary": "Acknowledge all checks for all monitors",
|
|
"description": "Acknowledge all checks across all monitors for the team",
|
|
"parameters": [
|
|
{
|
|
"name": "action",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Action to perform (e.g., 'ack')",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["ack"]
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["ack"],
|
|
"properties": {
|
|
"ack": {
|
|
"type": "boolean",
|
|
"description": "Acknowledgement status to set"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Checks acknowledged successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "All checks acknowledged successfully"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"description": "Updated checks information"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/checks/{action}/{monitorId}": {
|
|
"put": {
|
|
"tags": ["checks"],
|
|
"summary": "Acknowledge all checks for a specific monitor",
|
|
"description": "Acknowledge all checks for a specific monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "action",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Action to perform (e.g., 'ack')",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["ack"]
|
|
}
|
|
},
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Monitor ID to acknowledge checks for",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["ack"],
|
|
"properties": {
|
|
"ack": {
|
|
"type": "boolean",
|
|
"description": "Acknowledgement status to set"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Checks acknowledged successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "All checks acknowledged successfully"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"description": "Updated checks information"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/maintenance-window": {
|
|
"post": {
|
|
"tags": ["maintenance-window"],
|
|
"summary": "Create maintenance window",
|
|
"description": "Create a new maintenance window",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["name", "startTime", "endTime"],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 500
|
|
},
|
|
"startTime": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"endTime": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"monitors": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Maintenance window created successfully"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/maintenance-window/team": {
|
|
"get": {
|
|
"tags": ["maintenance-window"],
|
|
"summary": "Get team maintenance windows",
|
|
"description": "Get all maintenance windows for the team",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Maintenance windows retrieved successfully"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/maintenance-window/monitor/{monitorId}": {
|
|
"get": {
|
|
"tags": ["maintenance-window"],
|
|
"summary": "Get maintenance windows by monitor",
|
|
"description": "Get all maintenance windows for a specific monitor",
|
|
"parameters": [
|
|
{
|
|
"name": "monitorId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Monitor maintenance windows retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/maintenance-window/{id}": {
|
|
"get": {
|
|
"tags": ["maintenance-window"],
|
|
"summary": "Get maintenance window by ID",
|
|
"description": "Get a specific maintenance window",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Maintenance window retrieved successfully"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": ["maintenance-window"],
|
|
"summary": "Update maintenance window",
|
|
"description": "Update an existing maintenance window",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 500
|
|
},
|
|
"startTime": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"endTime": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"monitors": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"422": {
|
|
"$ref": "#/components/responses/ValidationError"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": ["maintenance-window"],
|
|
"summary": "Delete maintenance window",
|
|
"description": "Delete a specific maintenance window",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/queue/jobs": {
|
|
"get": {
|
|
"tags": ["queue"],
|
|
"summary": "Get queue jobs",
|
|
"description": "Retrieve all jobs in the queue (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Queue jobs retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Queue jobs fetched successfully"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/QueueJob"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"tags": ["queue"],
|
|
"summary": "Add job to queue",
|
|
"description": "Add a new job to the queue (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Job added successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Job added to queue successfully"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/queue/metrics": {
|
|
"get": {
|
|
"tags": ["queue"],
|
|
"summary": "Get queue metrics",
|
|
"description": "Retrieve queue metrics (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Queue metrics retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Queue metrics fetched successfully"
|
|
},
|
|
"data": {
|
|
"$ref": "#/components/schemas/QueueMetrics"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/queue/health": {
|
|
"get": {
|
|
"tags": ["queue"],
|
|
"summary": "Check queue health",
|
|
"description": "Check the health status of the job queue (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Queue health status retrieved successfully"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/queue/all-metrics": {
|
|
"get": {
|
|
"tags": ["queue"],
|
|
"summary": "Get all queue metrics",
|
|
"description": "Get comprehensive queue metrics (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "All queue metrics retrieved successfully"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/queue/flush": {
|
|
"post": {
|
|
"tags": ["queue"],
|
|
"summary": "Flush queue",
|
|
"description": "Clear all jobs from the queue (admin/superadmin only)",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/monitors/games": {
|
|
"get": {
|
|
"tags": ["monitors"],
|
|
"summary": "Get game server list",
|
|
"description": "Get available game servers for monitoring",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Game servers retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/status-page": {
|
|
"get": {
|
|
"tags": ["status-page"],
|
|
"summary": "Get status page",
|
|
"description": "Get default status page information",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["status-page"],
|
|
"summary": "Create status page",
|
|
"description": "Create a new status page with optional logo upload",
|
|
"requestBody": {
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"logo": {
|
|
"type": "string",
|
|
"format": "binary",
|
|
"description": "Logo file for the status page"
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Status page title"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Status page description"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "Custom URL for the status page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"400": {
|
|
"$ref": "#/components/responses/BadRequest"
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": ["status-page"],
|
|
"summary": "Update status page",
|
|
"description": "Update an existing status page with optional logo upload",
|
|
"requestBody": {
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"logo": {
|
|
"type": "string",
|
|
"format": "binary",
|
|
"description": "Logo file for the status page"
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Status page title"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Status page description"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "Custom URL for the status page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"400": {
|
|
"$ref": "#/components/responses/BadRequest"
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/status-page/team": {
|
|
"get": {
|
|
"tags": ["status-page"],
|
|
"summary": "Get status pages by team",
|
|
"description": "Get all status pages for the authenticated user's team",
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/status-page/{url}": {
|
|
"get": {
|
|
"tags": ["status-page"],
|
|
"summary": "Get status page by URL",
|
|
"description": "Get a specific status page by its custom URL",
|
|
"parameters": [
|
|
{
|
|
"name": "url",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Custom URL of the status page"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": ["status-page"],
|
|
"summary": "Delete status page",
|
|
"description": "Delete a status page by its custom URL",
|
|
"parameters": [
|
|
{
|
|
"name": "url",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Custom URL of the status page (supports wildcards)"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/Success"
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/incidents/team": {
|
|
"get": {
|
|
"tags": ["incidents"],
|
|
"summary": "Get incidents by team",
|
|
"description": "Retrieve all incidents for the authenticated user's team with optional filtering",
|
|
"parameters": [
|
|
{
|
|
"name": "status",
|
|
"in": "query",
|
|
"description": "Filter by incident status (true = ongoing, false = resolved)",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
{
|
|
"name": "monitorId",
|
|
"in": "query",
|
|
"description": "Filter by monitor ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"description": "Page number for pagination",
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 1
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"description": "Number of items per page",
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 10
|
|
}
|
|
},
|
|
{
|
|
"name": "sortOrder",
|
|
"in": "query",
|
|
"description": "Sort order for results",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["asc", "desc"],
|
|
"default": "desc"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Incidents retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Incidents retrieved successfully"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Incident"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/incidents/team/summary": {
|
|
"get": {
|
|
"tags": ["incidents"],
|
|
"summary": "Get incident summary",
|
|
"description": "Retrieve a summary of incidents for the authenticated user's team",
|
|
"parameters": [
|
|
{
|
|
"name": "dateRange",
|
|
"in": "query",
|
|
"description": "Date range for summary",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["day", "week", "month"],
|
|
"default": "week"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Incident summary retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Incident summary retrieved successfully"
|
|
},
|
|
"data": {
|
|
"$ref": "#/components/schemas/IncidentSummary"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/incidents/{incidentId}": {
|
|
"get": {
|
|
"tags": ["incidents"],
|
|
"summary": "Get incident by ID",
|
|
"description": "Retrieve a specific incident by its ID",
|
|
"parameters": [
|
|
{
|
|
"name": "incidentId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The incident ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Incident retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Incident retrieved successfully"
|
|
},
|
|
"data": {
|
|
"$ref": "#/components/schemas/Incident"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/incidents/{incidentId}/resolve": {
|
|
"put": {
|
|
"tags": ["incidents"],
|
|
"summary": "Resolve incident manually",
|
|
"description": "Manually resolve an ongoing incident. Requires admin or superadmin role.",
|
|
"parameters": [
|
|
{
|
|
"name": "incidentId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The incident ID to resolve",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"comment": {
|
|
"type": "string",
|
|
"description": "Optional comment about the resolution",
|
|
"example": "Issue resolved by restarting the service"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Incident resolved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Incident resolved successfully"
|
|
},
|
|
"data": {
|
|
"$ref": "#/components/schemas/Incident"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"$ref": "#/components/responses/Unauthorized"
|
|
},
|
|
"403": {
|
|
"$ref": "#/components/responses/Forbidden"
|
|
},
|
|
"404": {
|
|
"$ref": "#/components/responses/NotFound"
|
|
},
|
|
"500": {
|
|
"$ref": "#/components/responses/InternalServerError"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"securitySchemes": {
|
|
"bearerAuth": {
|
|
"type": "http",
|
|
"scheme": "bearer",
|
|
"bearerFormat": "JWT",
|
|
"description": "JWT token obtained from login endpoint"
|
|
}
|
|
},
|
|
"responses": {
|
|
"Success": {
|
|
"description": "Operation successful",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"NotFound": {
|
|
"description": "Resource not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ValidationError": {
|
|
"description": "Validation failed",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Unauthorized": {
|
|
"description": "Authentication required or token invalid",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Forbidden": {
|
|
"description": "Insufficient permissions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"BadRequest": {
|
|
"description": "Invalid request parameters",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"InternalServerError": {
|
|
"description": "Internal server error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"schemas": {
|
|
"SuccessResponse": {
|
|
"type": "object",
|
|
"required": ["success", "msg"],
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "Operation completed successfully"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"description": "Response payload (varies by endpoint)"
|
|
}
|
|
}
|
|
},
|
|
"ErrorResponse": {
|
|
"type": "object",
|
|
"required": ["success", "msg"],
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean",
|
|
"example": false
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"example": "An error occurred"
|
|
},
|
|
"details": {
|
|
"type": "object",
|
|
"description": "Additional error details"
|
|
}
|
|
}
|
|
},
|
|
"RegisterRequest": {
|
|
"type": "object",
|
|
"required": ["firstName", "lastName", "email", "password"],
|
|
"properties": {
|
|
"firstName": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 50,
|
|
"example": "John"
|
|
},
|
|
"lastName": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 50,
|
|
"example": "Doe"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"format": "email",
|
|
"example": "john@example.com"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"minLength": 8,
|
|
"format": "password",
|
|
"example": "SecurePass123!"
|
|
},
|
|
"profileImage": {
|
|
"type": "string",
|
|
"format": "binary",
|
|
"description": "Optional profile image file"
|
|
},
|
|
"role": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"enum": ["user", "admin", "superadmin", "Demo"]
|
|
},
|
|
"default": ["user"]
|
|
}
|
|
}
|
|
},
|
|
"LoginRequest": {
|
|
"type": "object",
|
|
"required": ["email", "password"],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"format": "email",
|
|
"example": "john@example.com"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"format": "password",
|
|
"example": "SecurePass123!"
|
|
}
|
|
}
|
|
},
|
|
"AuthResponse": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SuccessResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"token": {
|
|
"type": "string",
|
|
"description": "JWT access token"
|
|
},
|
|
"user": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"UserUpdateRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"firstName": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 50
|
|
},
|
|
"lastName": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 50
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"format": "password",
|
|
"description": "Current password for verification"
|
|
},
|
|
"newPassword": {
|
|
"type": "string",
|
|
"minLength": 8,
|
|
"format": "password",
|
|
"description": "New password (if changing)"
|
|
},
|
|
"profileImage": {
|
|
"type": "string",
|
|
"format": "binary",
|
|
"description": "New profile image file"
|
|
},
|
|
"deleteProfileImage": {
|
|
"type": "boolean",
|
|
"description": "Flag to delete current profile image"
|
|
}
|
|
}
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string",
|
|
"example": "64f123a456b789012c345def"
|
|
},
|
|
"firstName": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"lastName": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"format": "email",
|
|
"example": "john@example.com"
|
|
},
|
|
"role": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"enum": ["user", "admin", "superadmin", "Demo"]
|
|
}
|
|
},
|
|
"profileImage": {
|
|
"type": "string",
|
|
"description": "URL or path to profile image"
|
|
},
|
|
"isActive": {
|
|
"type": "boolean"
|
|
},
|
|
"teamId": {
|
|
"type": "string"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"CreateMonitorRequest": {
|
|
"type": "object",
|
|
"required": ["name", "description", "type", "url", "interval"],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 100,
|
|
"example": "My Website Monitor"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 500,
|
|
"example": "Monitors the main website homepage"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["http", "ping", "pagespeed", "hardware", "docker", "port"],
|
|
"example": "http"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"example": "https://example.com"
|
|
},
|
|
"interval": {
|
|
"type": "integer",
|
|
"minimum": 30,
|
|
"maximum": 3600,
|
|
"example": 300,
|
|
"description": "Check interval in seconds"
|
|
},
|
|
"isActive": {
|
|
"type": "boolean",
|
|
"default": true
|
|
},
|
|
"notifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Array of notification IDs to associate with this monitor"
|
|
},
|
|
"httpOptions": {
|
|
"type": "object",
|
|
"properties": {
|
|
"method": {
|
|
"type": "string",
|
|
"enum": ["GET", "POST", "PUT", "DELETE", "HEAD"],
|
|
"default": "GET"
|
|
},
|
|
"headers": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"body": {
|
|
"type": "string",
|
|
"description": "Request body for POST/PUT requests"
|
|
},
|
|
"timeout": {
|
|
"type": "integer",
|
|
"minimum": 1000,
|
|
"maximum": 30000,
|
|
"default": 5000,
|
|
"description": "Request timeout in milliseconds"
|
|
}
|
|
}
|
|
},
|
|
"assertions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["status-code", "response-time", "body-contains", "header-contains"]
|
|
},
|
|
"comparison": {
|
|
"type": "string",
|
|
"enum": ["equals", "not-equals", "greater-than", "less-than", "contains", "not-contains"]
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"UpdateMonitorRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 100
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 500
|
|
},
|
|
"interval": {
|
|
"type": "integer",
|
|
"minimum": 30,
|
|
"maximum": 3600
|
|
},
|
|
"isActive": {
|
|
"type": "boolean"
|
|
},
|
|
"notifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"httpOptions": {
|
|
"type": "object",
|
|
"properties": {
|
|
"method": {
|
|
"type": "string",
|
|
"enum": ["GET", "POST", "PUT", "DELETE", "HEAD"]
|
|
},
|
|
"headers": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"body": {
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "integer",
|
|
"minimum": 1000,
|
|
"maximum": 30000
|
|
}
|
|
}
|
|
},
|
|
"assertions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["status-code", "response-time", "body-contains", "header-contains"]
|
|
},
|
|
"comparison": {
|
|
"type": "string",
|
|
"enum": ["equals", "not-equals", "greater-than", "less-than", "contains", "not-contains"]
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Monitor": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string",
|
|
"example": "64f123a456b789012c345def"
|
|
},
|
|
"userId": {
|
|
"type": "string"
|
|
},
|
|
"teamId": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"example": "My Website Monitor"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"example": "Monitors the main website homepage"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["http", "ping", "pagespeed", "hardware", "docker", "port"]
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"example": "https://example.com"
|
|
},
|
|
"interval": {
|
|
"type": "integer",
|
|
"example": 300
|
|
},
|
|
"isActive": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"status": {
|
|
"type": "boolean",
|
|
"description": "Current monitor status (up/down)"
|
|
},
|
|
"lastChecked": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Timestamp of last check"
|
|
},
|
|
"notifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"httpOptions": {
|
|
"type": "object",
|
|
"properties": {
|
|
"method": {
|
|
"type": "string"
|
|
},
|
|
"headers": {
|
|
"type": "object"
|
|
},
|
|
"body": {
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"assertions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"CreateNotificationRequest": {
|
|
"type": "object",
|
|
"required": ["type", "name"],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["email", "webhook", "slack", "discord", "telegram", "zapier"],
|
|
"example": "email"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 100,
|
|
"example": "Admin Email Notifications"
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"description": "Configuration specific to notification type",
|
|
"oneOf": [
|
|
{
|
|
"title": "Email Configuration",
|
|
"properties": {
|
|
"to": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Webhook Configuration",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string",
|
|
"format": "uri"
|
|
},
|
|
"headers": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Slack Configuration",
|
|
"properties": {
|
|
"webhookUrl": {
|
|
"type": "string",
|
|
"format": "uri"
|
|
},
|
|
"channel": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Discord Configuration",
|
|
"properties": {
|
|
"webhookUrl": {
|
|
"type": "string",
|
|
"format": "uri"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"isActive": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
},
|
|
"Notification": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string"
|
|
},
|
|
"userId": {
|
|
"type": "string"
|
|
},
|
|
"teamId": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["email", "webhook", "slack", "discord", "telegram", "zapier"]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"description": "Type-specific configuration"
|
|
},
|
|
"isActive": {
|
|
"type": "boolean"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"AppSettings": {
|
|
"type": "object",
|
|
"properties": {
|
|
"appName": {
|
|
"type": "string",
|
|
"example": "Checkmate"
|
|
},
|
|
"appUrl": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"example": "https://checkmate.example.com"
|
|
},
|
|
"logLevel": {
|
|
"type": "string",
|
|
"enum": ["error", "warn", "info", "debug"],
|
|
"default": "info"
|
|
},
|
|
"emailConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"host": {
|
|
"type": "string"
|
|
},
|
|
"port": {
|
|
"type": "integer"
|
|
},
|
|
"secure": {
|
|
"type": "boolean"
|
|
},
|
|
"user": {
|
|
"type": "string"
|
|
},
|
|
"pass": {
|
|
"type": "string",
|
|
"format": "password"
|
|
},
|
|
"from": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
},
|
|
"webhookRetries": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 10,
|
|
"default": 3
|
|
},
|
|
"checksRetention": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 365,
|
|
"default": 90,
|
|
"description": "Days to retain check results"
|
|
}
|
|
}
|
|
},
|
|
"SystemDiagnostics": {
|
|
"type": "object",
|
|
"properties": {
|
|
"uptime": {
|
|
"type": "number",
|
|
"description": "System uptime in seconds"
|
|
},
|
|
"memory": {
|
|
"type": "object",
|
|
"properties": {
|
|
"total": {
|
|
"type": "number",
|
|
"description": "Total memory in bytes"
|
|
},
|
|
"used": {
|
|
"type": "number",
|
|
"description": "Used memory in bytes"
|
|
},
|
|
"free": {
|
|
"type": "number",
|
|
"description": "Free memory in bytes"
|
|
}
|
|
}
|
|
},
|
|
"cpu": {
|
|
"type": "object",
|
|
"properties": {
|
|
"usage": {
|
|
"type": "number",
|
|
"description": "CPU usage percentage"
|
|
},
|
|
"cores": {
|
|
"type": "integer",
|
|
"description": "Number of CPU cores"
|
|
}
|
|
}
|
|
},
|
|
"database": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string",
|
|
"enum": ["connected", "disconnected", "error"]
|
|
},
|
|
"responseTime": {
|
|
"type": "number",
|
|
"description": "Database response time in milliseconds"
|
|
}
|
|
}
|
|
},
|
|
"queue": {
|
|
"type": "object",
|
|
"properties": {
|
|
"active": {
|
|
"type": "integer"
|
|
},
|
|
"waiting": {
|
|
"type": "integer"
|
|
},
|
|
"completed": {
|
|
"type": "integer"
|
|
},
|
|
"failed": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Incident": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string",
|
|
"description": "Unique incident identifier"
|
|
},
|
|
"monitorId": {
|
|
"type": "string",
|
|
"description": "ID of the associated monitor"
|
|
},
|
|
"teamId": {
|
|
"type": "string",
|
|
"description": "ID of the team"
|
|
},
|
|
"startTime": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When the incident started"
|
|
},
|
|
"endTime": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "When the incident was resolved (null if ongoing)"
|
|
},
|
|
"status": {
|
|
"type": "boolean",
|
|
"description": "Incident status (true = ongoing, false = resolved)"
|
|
},
|
|
"message": {
|
|
"type": ["string", "null"],
|
|
"description": "Error message or description"
|
|
},
|
|
"statusCode": {
|
|
"type": ["integer", "null"],
|
|
"description": "HTTP status code if applicable"
|
|
},
|
|
"resolutionType": {
|
|
"type": ["string", "null"],
|
|
"enum": ["automatic", "manual", null],
|
|
"description": "How the incident was resolved"
|
|
},
|
|
"resolvedBy": {
|
|
"type": ["string", "null"],
|
|
"description": "User ID who resolved the incident (for manual resolution)"
|
|
},
|
|
"comment": {
|
|
"type": ["string", "null"],
|
|
"description": "Resolution comment"
|
|
},
|
|
"checks": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Array of check IDs associated with this incident"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"IncidentSummary": {
|
|
"type": "object",
|
|
"properties": {
|
|
"totalIncidents": {
|
|
"type": "integer",
|
|
"description": "Total number of incidents"
|
|
},
|
|
"activeIncidents": {
|
|
"type": "integer",
|
|
"description": "Number of ongoing incidents"
|
|
},
|
|
"resolvedIncidents": {
|
|
"type": "integer",
|
|
"description": "Number of resolved incidents"
|
|
},
|
|
"averageResolutionTime": {
|
|
"type": "number",
|
|
"description": "Average time to resolve incidents in milliseconds"
|
|
},
|
|
"incidentsByMonitor": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"monitorId": {
|
|
"type": "string"
|
|
},
|
|
"monitorName": {
|
|
"type": "string"
|
|
},
|
|
"count": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"QueueJob": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Job ID"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Job name"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"description": "Job payload data"
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"enum": ["waiting", "active", "completed", "failed", "delayed"],
|
|
"description": "Current job status"
|
|
},
|
|
"progress": {
|
|
"type": "number",
|
|
"description": "Job progress percentage"
|
|
},
|
|
"attemptsMade": {
|
|
"type": "integer",
|
|
"description": "Number of attempts made"
|
|
},
|
|
"timestamp": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When the job was created"
|
|
},
|
|
"processedOn": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "When the job started processing"
|
|
},
|
|
"finishedOn": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "When the job finished"
|
|
}
|
|
}
|
|
},
|
|
"QueueMetrics": {
|
|
"type": "object",
|
|
"properties": {
|
|
"waiting": {
|
|
"type": "integer",
|
|
"description": "Number of jobs waiting"
|
|
},
|
|
"active": {
|
|
"type": "integer",
|
|
"description": "Number of jobs currently processing"
|
|
},
|
|
"completed": {
|
|
"type": "integer",
|
|
"description": "Number of completed jobs"
|
|
},
|
|
"failed": {
|
|
"type": "integer",
|
|
"description": "Number of failed jobs"
|
|
},
|
|
"delayed": {
|
|
"type": "integer",
|
|
"description": "Number of delayed jobs"
|
|
}
|
|
}
|
|
},
|
|
"Check": {
|
|
"type": "object",
|
|
"description": "A monitoring check result",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string",
|
|
"description": "Check ID"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"properties": {
|
|
"monitorId": {
|
|
"type": "string",
|
|
"description": "Associated monitor ID"
|
|
},
|
|
"teamId": {
|
|
"type": "string",
|
|
"description": "Associated team ID"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["http", "ping", "pagespeed", "hardware", "docker", "port"],
|
|
"description": "Monitor type"
|
|
}
|
|
},
|
|
"required": ["monitorId", "teamId", "type"]
|
|
},
|
|
"status": {
|
|
"type": "boolean",
|
|
"description": "Check status (true = up, false = down)"
|
|
},
|
|
"responseTime": {
|
|
"type": "number",
|
|
"description": "Response time in milliseconds"
|
|
},
|
|
"statusCode": {
|
|
"type": "integer",
|
|
"description": "HTTP status code (for HTTP monitors)"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "Status message or error description"
|
|
},
|
|
"timings": {
|
|
"$ref": "#/components/schemas/CheckTimings"
|
|
},
|
|
"cpu": {
|
|
"$ref": "#/components/schemas/CheckCpuInfo"
|
|
},
|
|
"memory": {
|
|
"$ref": "#/components/schemas/CheckMemoryInfo"
|
|
},
|
|
"disk": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CheckDiskInfo"
|
|
}
|
|
},
|
|
"host": {
|
|
"$ref": "#/components/schemas/CheckHostInfo"
|
|
},
|
|
"errors": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CheckErrorInfo"
|
|
}
|
|
},
|
|
"capture": {
|
|
"$ref": "#/components/schemas/CheckCaptureInfo"
|
|
},
|
|
"net": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CheckNetworkInfo"
|
|
}
|
|
},
|
|
"accessibility": {
|
|
"type": "number",
|
|
"description": "PageSpeed accessibility score (0-100)"
|
|
},
|
|
"bestPractices": {
|
|
"type": "number",
|
|
"description": "PageSpeed best practices score (0-100)"
|
|
},
|
|
"seo": {
|
|
"type": "number",
|
|
"description": "PageSpeed SEO score (0-100)"
|
|
},
|
|
"performance": {
|
|
"type": "number",
|
|
"description": "PageSpeed performance score (0-100)"
|
|
},
|
|
"audits": {
|
|
"$ref": "#/components/schemas/CheckAudits"
|
|
},
|
|
"ack": {
|
|
"type": "boolean",
|
|
"description": "Whether the check has been acknowledged"
|
|
},
|
|
"ackAt": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "When the check was acknowledged"
|
|
},
|
|
"expiry": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When the check expires"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"CheckTimings": {
|
|
"type": "object",
|
|
"description": "Detailed timing information for HTTP checks",
|
|
"properties": {
|
|
"start": {
|
|
"type": "number"
|
|
},
|
|
"socket": {
|
|
"type": "number"
|
|
},
|
|
"lookup": {
|
|
"type": "number"
|
|
},
|
|
"connect": {
|
|
"type": "number"
|
|
},
|
|
"secureConnect": {
|
|
"type": "number"
|
|
},
|
|
"upload": {
|
|
"type": "number"
|
|
},
|
|
"response": {
|
|
"type": "number"
|
|
},
|
|
"end": {
|
|
"type": "number"
|
|
},
|
|
"phases": {
|
|
"type": "object",
|
|
"properties": {
|
|
"wait": {
|
|
"type": "number"
|
|
},
|
|
"dns": {
|
|
"type": "number"
|
|
},
|
|
"tcp": {
|
|
"type": "number"
|
|
},
|
|
"tls": {
|
|
"type": "number"
|
|
},
|
|
"request": {
|
|
"type": "number"
|
|
},
|
|
"firstByte": {
|
|
"type": "number"
|
|
},
|
|
"download": {
|
|
"type": "number"
|
|
},
|
|
"total": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CheckCpuInfo": {
|
|
"type": "object",
|
|
"description": "CPU information for infrastructure checks",
|
|
"properties": {
|
|
"physical_core": {
|
|
"type": "integer"
|
|
},
|
|
"logical_core": {
|
|
"type": "integer"
|
|
},
|
|
"frequency": {
|
|
"type": "number"
|
|
},
|
|
"temperature": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"free_percent": {
|
|
"type": "number"
|
|
},
|
|
"usage_percent": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"CheckMemoryInfo": {
|
|
"type": "object",
|
|
"description": "Memory information for infrastructure checks",
|
|
"properties": {
|
|
"total_bytes": {
|
|
"type": "number"
|
|
},
|
|
"available_bytes": {
|
|
"type": "number"
|
|
},
|
|
"used_bytes": {
|
|
"type": "number"
|
|
},
|
|
"usage_percent": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"CheckDiskInfo": {
|
|
"type": "object",
|
|
"description": "Disk information for infrastructure checks",
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"mountpoint": {
|
|
"type": "string"
|
|
},
|
|
"read_speed_bytes": {
|
|
"type": "number"
|
|
},
|
|
"write_speed_bytes": {
|
|
"type": "number"
|
|
},
|
|
"total_bytes": {
|
|
"type": "number"
|
|
},
|
|
"free_bytes": {
|
|
"type": "number"
|
|
},
|
|
"usage_percent": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"CheckHostInfo": {
|
|
"type": "object",
|
|
"description": "Host information for infrastructure checks",
|
|
"properties": {
|
|
"os": {
|
|
"type": "string"
|
|
},
|
|
"platform": {
|
|
"type": "string"
|
|
},
|
|
"kernel_version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CheckErrorInfo": {
|
|
"type": "object",
|
|
"description": "Error information from checks",
|
|
"properties": {
|
|
"metric": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"err": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CheckCaptureInfo": {
|
|
"type": "object",
|
|
"description": "Capture agent information",
|
|
"properties": {
|
|
"version": {
|
|
"type": "string"
|
|
},
|
|
"mode": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CheckNetworkInfo": {
|
|
"type": "object",
|
|
"description": "Network interface information",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"bytes_sent": {
|
|
"type": "number"
|
|
},
|
|
"bytes_recv": {
|
|
"type": "number"
|
|
},
|
|
"packets_sent": {
|
|
"type": "number"
|
|
},
|
|
"packets_recv": {
|
|
"type": "number"
|
|
},
|
|
"err_in": {
|
|
"type": "number"
|
|
},
|
|
"err_out": {
|
|
"type": "number"
|
|
},
|
|
"drop_in": {
|
|
"type": "number"
|
|
},
|
|
"drop_out": {
|
|
"type": "number"
|
|
},
|
|
"fifo_in": {
|
|
"type": "number"
|
|
},
|
|
"fifo_out": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"CheckAudits": {
|
|
"type": "object",
|
|
"description": "PageSpeed audit results",
|
|
"properties": {
|
|
"cls": {
|
|
"$ref": "#/components/schemas/LighthouseAudit"
|
|
},
|
|
"si": {
|
|
"$ref": "#/components/schemas/LighthouseAudit"
|
|
},
|
|
"fcp": {
|
|
"$ref": "#/components/schemas/LighthouseAudit"
|
|
},
|
|
"lcp": {
|
|
"$ref": "#/components/schemas/LighthouseAudit"
|
|
},
|
|
"tbt": {
|
|
"$ref": "#/components/schemas/LighthouseAudit"
|
|
}
|
|
}
|
|
},
|
|
"LighthouseAudit": {
|
|
"type": "object",
|
|
"description": "Individual Lighthouse audit result",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"score": {
|
|
"type": "number"
|
|
},
|
|
"displayValue": {
|
|
"type": "string"
|
|
},
|
|
"numericValue": {
|
|
"type": "number"
|
|
},
|
|
"numericUnit": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|