{
  "openapi": "3.0.4",
  "info": {
    "title": "Presentation",
    "version": "1.0"
  },
  "paths": {
    "/api/auth/register": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/refresh": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/verify-email": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/forgot-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/reset-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/resend-verification-code": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendVerificationCodeCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendVerificationCodeCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResendVerificationCodeCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Servers"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServerCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServerCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServerCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers/{id}": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServerCommandBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServerCommandBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServerCommandBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers/{id}/settings": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "patch": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSettingsBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSettingsBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSettingsBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers/{id}/state": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers/{id}/uptime": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers/{id}/overview": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "bucketSec",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/servers/{id}/pings": {
      "get": {
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/telegram-accounts": {
      "get": {
        "tags": [
          "TelegramAccounts"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "TelegramAccounts"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTelegramAccountCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTelegramAccountCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTelegramAccountCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/telegram-accounts/{id}": {
      "delete": {
        "tags": [
          "TelegramAccounts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/users/notification-settings": {
      "get": {
        "tags": [
          "Users"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchNotificationSettingsCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchNotificationSettingsCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchNotificationSettingsCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateServerCommand": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "host": {
            "type": "string",
            "nullable": true
          },
          "query": {
            "type": "string",
            "nullable": true
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "protocol": {
            "$ref": "#/components/schemas/Protocol"
          }
        },
        "additionalProperties": false
      },
      "CreateTelegramAccountCommand": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "photo_url": {
            "type": "string",
            "nullable": true
          },
          "auth_date": {
            "type": "integer",
            "format": "int64"
          },
          "hash": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ForgotPasswordCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LoginCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LogoutCommand": {
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatchNotificationSettingsCommand": {
        "type": "object",
        "properties": {
          "onDown": {
            "type": "boolean",
            "nullable": true
          },
          "onUp": {
            "type": "boolean",
            "nullable": true
          },
          "onLatency": {
            "type": "boolean",
            "nullable": true
          },
          "cooldownSec": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Protocol": {
        "enum": [
          "HTTP",
          "TCP",
          "ICMP",
          "HTTPS"
        ],
        "type": "string"
      },
      "RefreshCommand": {
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RegisterCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ResendVerificationCodeCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ResetPasswordCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "newPassword": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateServerCommandBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "host": {
            "type": "string",
            "nullable": true
          },
          "query": {
            "type": "string",
            "nullable": true
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "protocol": {
            "$ref": "#/components/schemas/Protocol"
          }
        },
        "additionalProperties": false
      },
      "UpdateSettingsBody": {
        "type": "object",
        "properties": {
          "intervalSec": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "latencyThresholdMs": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "retries": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "failureThreshold": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "VerifyEmailCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Enter JWT bearer token only",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}