{
  "openapi": "3.1.0",
  "info": {
    "title": "LivePanel API v2",
    "version": "2",
    "summary": "Everything the LivePanel web interface does, for programs.",
    "description": "Works only on panels with the **Premium** plan; other plans answer `402 upgrade_required`.\n\nAuthenticate with an API token from System → API tokens: `Authorization: Bearer lp_…`. A token acts as its account (role and permissions are enforced as in the browser) and only within its scopes.\n\nRequest bodies are JSON (up to 16 KB) and unknown fields are rejected. Errors are `{\"error\": \"code\"}`. Paths of files are relative to the site user’s home folder (site files: `www/<domain>/…`).\n\nHuman documentation: https://wiki.livepanel.uz/en/api-reference",
    "license": {
      "name": "Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://{host}:{port}/api/v2",
      "variables": {
        "host": {
          "default": "panel.example.uz"
        },
        "port": {
          "default": "6563"
        }
      }
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Account"
    },
    {
      "name": "Sites"
    },
    {
      "name": "Files"
    },
    {
      "name": "Databases"
    },
    {
      "name": "DNS"
    },
    {
      "name": "Mail"
    },
    {
      "name": "FTP"
    },
    {
      "name": "Cron"
    },
    {
      "name": "Backups"
    },
    {
      "name": "Git"
    },
    {
      "name": "Accounts"
    },
    {
      "name": "Limits"
    },
    {
      "name": "Branding"
    },
    {
      "name": "Server"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "get_me",
        "summary": "The token’s account, scopes, expiry and the panel version",
        "description": "Any valid token.",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "permissions": {
                          "$ref": "#/components/schemas/Permissions"
                        },
                        "main_admin": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "expires_at": {
                      "type": "integer"
                    },
                    "version": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_sites",
        "summary": "List sites",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Site"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_sites",
        "summary": "Create a site",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/owners": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_owners",
        "summary": "Site owners (Linux users)",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/lifecycle": {
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_sites_lifecycle",
        "summary": "Enable, disable or delete a site",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "enable",
                      "disable",
                      "delete"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/settings": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_sites_settings",
        "summary": "A site and its settings",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_sites_settings",
        "summary": "Save settings or switch the backend type. Send the settings object from GET with your changes.",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "settings": {
                    "type": "object",
                    "description": "aliases, gzip, gzip_level, nginx_static, static_ext, cache_days, hsts, http2, redirects, access_log, error_log, auth_on, auth_user, rate_on, rate, rate_unit, burst_on, burst, no_delay, env, access_mode, access_list, php_ini, waf (\"\" | on | detect), waf_app (\"\" | wordpress | drupal | nextcloud | dokuwiki | xenforo), waf_skip (rule IDs)"
                  },
                  "auth_password": {
                    "type": "string"
                  },
                  "runtime": {
                    "type": "string",
                    "description": "Empty keeps the type"
                  },
                  "handler": {
                    "type": "string"
                  },
                  "php": {
                    "type": "string"
                  },
                  "node": {
                    "type": "string"
                  },
                  "python": {
                    "type": "string"
                  },
                  "proxy": {
                    "type": "string"
                  },
                  "force_https": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "settings"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/ssl": {
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_sites_ssl",
        "summary": "Issue or remove an SSL certificate, set the HTTPS redirect",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "issue",
                      "remove",
                      "https"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "letsencrypt",
                      "selfsigned",
                      ""
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "force_https": {
                    "type": "boolean"
                  },
                  "wildcard": {
                    "type": "boolean",
                    "description": "letsencrypt only, Premium: also *.<domain>, checked through DNS (the zone must be in this panel and its NS must point here)"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/scan": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_sites_scan",
        "summary": "Last antivirus scan of a site",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_sites_scan",
        "summary": "Start an antivirus scan (ClamAV)",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/scan/action": {
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_sites_scan_action",
        "summary": "Quarantine, delete, restore or purge a found file",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "quarantine",
                      "delete",
                      "restore",
                      "purge"
                    ]
                  },
                  "path": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/stats-report": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_sites_stats_report",
        "summary": "GoAccess visitor report (HTML)",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fresh",
            "in": "query",
            "required": false,
            "description": "Rebuild now when set",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sites/waf": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_sites_waf",
        "summary": "Web application firewall of a site: mode, active, available and the latest stopped requests (events[]: time, ip, method, uri, status, rules[]: id, message). It is turned on with the waf, waf_app and waf_skip site settings",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/traffic": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_traffic",
        "summary": "Monthly traffic and daily chart (without domain: per account)",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Site domain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "YYYY-MM",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/site-service": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_site_service",
        "summary": "Site service state and logs",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "log",
            "in": "query",
            "required": false,
            "description": "access, error, or backend (Node.js/Python)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_site_service",
        "summary": "Restart the site service",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "restart"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/apps/install": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_apps_install",
        "summary": "Application install state",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "post_apps_install",
        "summary": "Install a CMS or framework on an empty site (runs in the background)",
        "description": "Scope: `sites:write`.",
        "security": [
          {
            "bearer": [
              "sites:write"
            ]
          }
        ],
        "x-scope": "sites:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "app": {
                    "type": "string",
                    "enum": [
                      "wordpress",
                      "joomla",
                      "drupal",
                      "laravel",
                      "symfony",
                      "codeigniter",
                      "strapi",
                      "ghost",
                      "express",
                      "nextjs",
                      "nestjs",
                      "wagtail",
                      "django",
                      "flask",
                      "fastapi"
                    ]
                  },
                  "title": {
                    "type": "string"
                  },
                  "admin_user": {
                    "type": "string"
                  },
                  "admin_password": {
                    "type": "string",
                    "minLength": 12
                  },
                  "admin_email": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "app"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/get-site-photo/{domain}": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_get_site_photo_domain",
        "summary": "Site preview image",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "Site domain",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/php": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_php",
        "summary": "Installed PHP versions",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/node": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_node",
        "summary": "Installed Node.js versions",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/python": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "get_python",
        "summary": "Installed Python versions",
        "description": "Scope: `sites:read`.",
        "security": [
          {
            "bearer": [
              "sites:read"
            ]
          }
        ],
        "x-scope": "sites:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "get_files",
        "summary": "List a folder, or with action=read the text of a file (its hash goes into expected when saving)",
        "description": "Scope: `files:read`.",
        "security": [
          {
            "bearer": [
              "files:read"
            ]
          }
        ],
        "x-scope": "files:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Path relative to the site user’s home folder, e.g. www/shop.example.uz/index.php",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "description": "read — return the file text",
            "schema": {
              "type": "string",
              "enum": [
                "read"
              ]
            }
          },
          {
            "name": "encoding",
            "in": "query",
            "required": false,
            "description": "Text encoding for action=read, default utf-8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Files"
        ],
        "operationId": "post_files",
        "summary": "Save a file, create a file or a folder",
        "description": "Scope: `files:write`.",
        "security": [
          {
            "bearer": [
              "files:write"
            ]
          }
        ],
        "x-scope": "files:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "save",
                      "create",
                      "mkdir"
                    ]
                  },
                  "content": {
                    "type": "string"
                  },
                  "expected": {
                    "type": "string",
                    "description": "Hash from the read, protects from overwriting newer changes"
                  },
                  "encoding": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "path",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/op": {
      "post": {
        "tags": [
          "Files"
        ],
        "operationId": "post_files_op",
        "summary": "File actions",
        "description": "Scope: `files:write`.",
        "security": [
          {
            "bearer": [
              "files:write"
            ]
          }
        ],
        "x-scope": "files:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "rename",
                      "move",
                      "copy",
                      "chmod",
                      "archive",
                      "extract",
                      "delete"
                    ]
                  },
                  "path": {
                    "type": "string"
                  },
                  "paths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "target": {
                    "type": "string",
                    "description": "rename: the new name only; archive: the archive name (made in the same folder); copy, move, extract: a folder path"
                  },
                  "mode": {
                    "type": "string",
                    "examples": [
                      "644",
                      "755"
                    ]
                  },
                  "recursive": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/upload": {
      "post": {
        "tags": [
          "Files"
        ],
        "operationId": "post_files_upload",
        "summary": "Upload a file: the request body is the file itself (Content-Length required, up to 2 GB)",
        "description": "Scope: `files:write`.",
        "security": [
          {
            "bearer": [
              "files:write"
            ]
          }
        ],
        "x-scope": "files:write",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Full destination path including the file name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "overwrite",
            "in": "query",
            "required": false,
            "description": "1 replaces an existing regular file; otherwise an existing file gives 409 file_exists",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/download": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "get_files_download",
        "summary": "Download a file",
        "description": "Scope: `files:read`.",
        "security": [
          {
            "bearer": [
              "files:read"
            ]
          }
        ],
        "x-scope": "files:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Path relative to the site user’s home folder, e.g. www/shop.example.uz/index.php",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/stats": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "get_files_stats",
        "summary": "Disk usage: largest folders and files",
        "description": "Scope: `files:read`.",
        "security": [
          {
            "bearer": [
              "files:read"
            ]
          }
        ],
        "x-scope": "files:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Path relative to the site user’s home folder, e.g. www/shop.example.uz/index.php",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/databases": {
      "get": {
        "tags": [
          "Databases"
        ],
        "operationId": "get_databases",
        "summary": "List databases",
        "description": "Scope: `databases:read`.",
        "security": [
          {
            "bearer": [
              "databases:read"
            ]
          }
        ],
        "x-scope": "databases:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Databases"
        ],
        "operationId": "post_databases",
        "summary": "Create, delete, change password, manage extra users and outside access",
        "description": "Scope: `databases:write`.",
        "security": [
          {
            "bearer": [
              "databases:write"
            ]
          }
        ],
        "x-scope": "databases:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "password",
                      "delete",
                      "user_add",
                      "user_update",
                      "user_remove",
                      "hosts"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "site": {
                    "type": "string"
                  },
                  "charset": {
                    "type": "string",
                    "examples": [
                      "utf8mb4"
                    ]
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "mysql",
                      "postgresql"
                    ]
                  },
                  "privileges": {
                    "type": "string",
                    "enum": [
                      "all",
                      "readwrite",
                      "readonly"
                    ]
                  },
                  "hosts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "IPs or networks allowed to connect from outside"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/databases/engines": {
      "get": {
        "tags": [
          "Databases"
        ],
        "operationId": "get_databases_engines",
        "summary": "Available database engines",
        "description": "Scope: `databases:read`.",
        "security": [
          {
            "bearer": [
              "databases:read"
            ]
          }
        ],
        "x-scope": "databases:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/databases/import": {
      "get": {
        "tags": [
          "Databases"
        ],
        "operationId": "get_databases_import",
        "summary": "Import state",
        "description": "Scope: `databases:read`.",
        "security": [
          {
            "bearer": [
              "databases:read"
            ]
          }
        ],
        "x-scope": "databases:read",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "description": "Database name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Databases"
        ],
        "operationId": "post_databases_import",
        "summary": "Import a .sql or .sql.gz file from the site folder",
        "description": "Scope: `databases:write`.",
        "security": [
          {
            "bearer": [
              "databases:write"
            ]
          }
        ],
        "x-scope": "databases:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "name",
                  "path"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/databases/export": {
      "get": {
        "tags": [
          "Databases"
        ],
        "operationId": "get_databases_export",
        "summary": "Download the database as .sql.gz",
        "description": "Scope: `databases:read`.",
        "security": [
          {
            "bearer": [
              "databases:read"
            ]
          }
        ],
        "x-scope": "databases:read",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "description": "Database name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/databases/phpmyadmin": {
      "post": {
        "tags": [
          "Databases"
        ],
        "operationId": "post_databases_phpmyadmin",
        "summary": "One-time phpMyAdmin sign-in link",
        "description": "Scope: `databases:write`.",
        "security": [
          {
            "bearer": [
              "databases:write"
            ]
          }
        ],
        "x-scope": "databases:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/databases/adminer": {
      "post": {
        "tags": [
          "Databases"
        ],
        "operationId": "post_databases_adminer",
        "summary": "One-time Adminer (PostgreSQL) sign-in link",
        "description": "Scope: `databases:write`.",
        "security": [
          {
            "bearer": [
              "databases:write"
            ]
          }
        ],
        "x-scope": "databases:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/dns": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "get_dns",
        "summary": "DNS zones, server IP and BIND state",
        "description": "Scope: `dns:read`.",
        "security": [
          {
            "bearer": [
              "dns:read"
            ]
          }
        ],
        "x-scope": "dns:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "post_dns",
        "summary": "Create or delete a zone, save all its records, turn DNSSEC on or off. save replaces the whole list: start from zone.records of GET /dns/zone (NS records are required). The response carries dnssec {enabled, pending, ds[]}: put ds[].record at the registrar",
        "description": "Scope: `dns:write`.",
        "security": [
          {
            "bearer": [
              "dns:write"
            ]
          }
        ],
        "x-scope": "dns:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "save",
                      "delete",
                      "dnssec"
                    ]
                  },
                  "zone": {
                    "type": "string"
                  },
                  "dnssec": {
                    "type": "boolean",
                    "description": "action dnssec: on or off"
                  },
                  "records": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "A",
                            "AAAA",
                            "CNAME",
                            "MX",
                            "TXT",
                            "NS",
                            "SRV",
                            "CAA"
                          ]
                        },
                        "ttl": {
                          "type": "integer"
                        },
                        "value": {
                          "type": "string"
                        },
                        "priority": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "ttl": {
                    "type": "integer"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action",
                  "zone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/dns/zone": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "get_dns_zone",
        "summary": "Records of a zone",
        "description": "Scope: `dns:read`.",
        "security": [
          {
            "bearer": [
              "dns:read"
            ]
          }
        ],
        "x-scope": "dns:read",
        "parameters": [
          {
            "name": "zone",
            "in": "query",
            "required": true,
            "description": "Zone name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail": {
      "get": {
        "tags": [
          "Mail"
        ],
        "operationId": "get_mail",
        "summary": "Mail domains, mailboxes, connection details and DNS records",
        "description": "Scope: `mail:read`.",
        "security": [
          {
            "bearer": [
              "mail:read"
            ]
          }
        ],
        "x-scope": "mail:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Mail"
        ],
        "operationId": "post_mail",
        "summary": "Manage mail domains and mailboxes",
        "description": "Scope: `mail:write`.",
        "security": [
          {
            "bearer": [
              "mail:write"
            ]
          }
        ],
        "x-scope": "mail:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "domain_add",
                      "domain_update",
                      "domain_remove",
                      "box_add",
                      "box_update",
                      "box_remove"
                    ]
                  },
                  "domain": {
                    "type": "string"
                  },
                  "site": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "catch_all": {
                    "type": "string"
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "quota_mb": {
                    "type": "integer"
                  },
                  "aliases": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "forwards": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ip": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts": {
      "get": {
        "tags": [
          "FTP"
        ],
        "operationId": "get_accounts",
        "summary": "FTP accounts",
        "description": "Scope: `ftp:read`.",
        "security": [
          {
            "bearer": [
              "ftp:read"
            ]
          }
        ],
        "x-scope": "ftp:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "FTP"
        ],
        "operationId": "post_accounts",
        "summary": "Create, update, toggle or delete an FTP account",
        "description": "Scope: `ftp:write`.",
        "security": [
          {
            "bearer": [
              "ftp:write"
            ]
          }
        ],
        "x-scope": "ftp:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "update",
                      "toggle",
                      "delete"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "site": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "home": {
                    "type": "string"
                  },
                  "read_only": {
                    "type": "boolean"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/cron": {
      "get": {
        "tags": [
          "Cron"
        ],
        "operationId": "get_cron",
        "summary": "Scheduled tasks",
        "description": "Scope: `cron:read`.",
        "security": [
          {
            "bearer": [
              "cron:read"
            ]
          }
        ],
        "x-scope": "cron:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Cron"
        ],
        "operationId": "post_cron",
        "summary": "Create, update, toggle, run now or delete a task",
        "description": "Scope: `cron:write`.",
        "security": [
          {
            "bearer": [
              "cron:write"
            ]
          }
        ],
        "x-scope": "cron:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "update",
                      "toggle",
                      "run",
                      "delete"
                    ]
                  },
                  "id": {
                    "type": "string"
                  },
                  "site": {
                    "type": "string"
                  },
                  "schedule": {
                    "type": "string",
                    "examples": [
                      "*/5 * * * *"
                    ]
                  },
                  "command": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/backups": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "get_backups",
        "summary": "Backups of a site: copies, the current job (state running/done/failed) and plan",
        "description": "Scope: `backups:read`.",
        "security": [
          {
            "bearer": [
              "backups:read"
            ]
          }
        ],
        "x-scope": "backups:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "post_backups",
        "summary": "Back up now, restore, delete a copy or set the schedule",
        "description": "Scope: `backups:write`.",
        "security": [
          {
            "bearer": [
              "backups:write"
            ]
          }
        ],
        "x-scope": "backups:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "restore",
                      "delete",
                      "plan"
                    ]
                  },
                  "id": {
                    "type": "string"
                  },
                  "files": {
                    "type": "boolean"
                  },
                  "databases": {
                    "type": "boolean"
                  },
                  "plan": {
                    "type": "object",
                    "properties": {
                      "schedule": {
                        "type": "string",
                        "enum": [
                          "off",
                          "daily",
                          "weekly"
                        ]
                      },
                      "hour": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 23
                      },
                      "weekday": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 6,
                        "description": "0 = Sunday"
                      },
                      "keep": {
                        "type": "integer"
                      },
                      "files": {
                        "type": "boolean"
                      },
                      "databases": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/backups/download": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "get_backups_download",
        "summary": "Download a copy (.tar)",
        "description": "Scope: `backups:read`.",
        "security": [
          {
            "bearer": [
              "backups:read"
            ]
          }
        ],
        "x-scope": "backups:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Copy id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/backups/remote": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "get_backups_remote",
        "summary": "Google Drive / Dropbox state of a site and the copies in storage",
        "description": "Scope: `backups:read`.",
        "security": [
          {
            "bearer": [
              "backups:read"
            ]
          }
        ],
        "x-scope": "backups:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "post_backups_remote",
        "summary": "Turn sending on/off, set copies kept, send now, fetch to the server, delete in storage",
        "description": "Scope: `backups:write`.",
        "security": [
          {
            "bearer": [
              "backups:write"
            ]
          }
        ],
        "x-scope": "backups:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "gdrive",
                      "dropbox"
                    ]
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "enable",
                      "disable",
                      "keep",
                      "sync",
                      "fetch",
                      "delete"
                    ]
                  },
                  "keep": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60
                  },
                  "file": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "provider",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/remote": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "get_remote",
        "summary": "Connected backup storages and their space",
        "description": "Scope: `backups:read`.",
        "security": [
          {
            "bearer": [
              "backups:read"
            ]
          }
        ],
        "x-scope": "backups:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "post_remote",
        "summary": "connect: get a sign-in link (open redirect in a browser); origin must be the panel address the request went to, otherwise 400 invalid_origin; without origin the code flow starts (pending.user_code). cancel, disconnect",
        "description": "Scope: `backups:write`.",
        "security": [
          {
            "bearer": [
              "backups:write"
            ]
          }
        ],
        "x-scope": "backups:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "gdrive",
                      "dropbox"
                    ]
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "connect",
                      "cancel",
                      "disconnect"
                    ]
                  },
                  "origin": {
                    "type": "string",
                    "description": "https://<panel address>, the same the request goes to"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "provider",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/git": {
      "get": {
        "tags": [
          "Git"
        ],
        "operationId": "get_git",
        "summary": "Repository, deploy key, webhook address and the last deploy log",
        "description": "Scope: `git:read`.",
        "security": [
          {
            "bearer": [
              "git:read"
            ]
          }
        ],
        "x-scope": "git:read",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Site domain, e.g. shop.example.uz",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Git"
        ],
        "operationId": "post_git",
        "summary": "Save the repository (save only sets it up), deploy (takes the files; follow last.state in GET /git), make a new webhook address or disconnect",
        "description": "Scope: `git:write`.",
        "security": [
          {
            "bearer": [
              "git:write"
            ]
          }
        ],
        "x-scope": "git:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "save",
                      "deploy",
                      "token",
                      "disconnect"
                    ]
                  },
                  "repo": {
                    "type": "string"
                  },
                  "branch": {
                    "type": "string"
                  },
                  "command": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "domain",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "operationId": "get_users",
        "summary": "Panel accounts",
        "description": "Scope: `users:read`.",
        "security": [
          {
            "bearer": [
              "users:read"
            ]
          }
        ],
        "x-scope": "users:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "operationId": "post_users",
        "summary": "Create an account",
        "description": "Scope: `users:write`.",
        "security": [
          {
            "bearer": [
              "users:write"
            ]
          }
        ],
        "x-scope": "users:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/{id}": {
      "patch": {
        "tags": [
          "Accounts"
        ],
        "operationId": "patch_users_id",
        "summary": "Change an account (also block it with disabled: true)",
        "description": "Scope: `users:write`.",
        "security": [
          {
            "bearer": [
              "users:write"
            ]
          }
        ],
        "x-scope": "users:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "operationId": "delete_users_id",
        "summary": "Delete an account (it must have no sites)",
        "description": "Scope: `users:write`.",
        "security": [
          {
            "bearer": [
              "users:write"
            ]
          }
        ],
        "x-scope": "users:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/2fa-reset": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "operationId": "post_users_2fa_reset",
        "summary": "Turn an account’s two-factor sign-in off",
        "description": "Scope: `users:write`.",
        "security": [
          {
            "bearer": [
              "users:write"
            ]
          }
        ],
        "x-scope": "users:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/audit": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "operationId": "get_audit",
        "summary": "Activity log (last 50 entries)",
        "description": "Scope: `users:read`.",
        "security": [
          {
            "bearer": [
              "users:read"
            ]
          }
        ],
        "x-scope": "users:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/limits": {
      "get": {
        "tags": [
          "Limits"
        ],
        "operationId": "get_limits",
        "summary": "Limits of an account (Pro and Premium)",
        "description": "Scope: `limits:read`.",
        "security": [
          {
            "bearer": [
              "limits:read"
            ]
          }
        ],
        "x-scope": "limits:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "description": "Account id (default: the token owner)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account_id": {
                      "type": "integer"
                    },
                    "limits": {
                      "$ref": "#/components/schemas/Limits"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Limits"
        ],
        "operationId": "put_limits",
        "summary": "Set limits of an account; 0 = unlimited",
        "description": "Scope: `limits:write`.",
        "security": [
          {
            "bearer": [
              "limits:write"
            ]
          }
        ],
        "x-scope": "limits:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LimitsPut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account_id": {
                      "type": "integer"
                    },
                    "limits": {
                      "$ref": "#/components/schemas/Limits"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/limits/usage": {
      "get": {
        "tags": [
          "Limits"
        ],
        "operationId": "get_limits_usage",
        "summary": "Current usage of an account",
        "description": "Scope: `limits:read`.",
        "security": [
          {
            "bearer": [
              "limits:read"
            ]
          }
        ],
        "x-scope": "limits:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "description": "Account id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings/branding": {
      "get": {
        "tags": [
          "Branding"
        ],
        "operationId": "get_settings_branding",
        "summary": "Panel name, color and logo",
        "description": "Scope: `branding:read`.",
        "security": [
          {
            "bearer": [
              "branding:read"
            ]
          }
        ],
        "x-scope": "branding:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Branding"
        ],
        "operationId": "post_settings_branding",
        "summary": "Set the panel name, color and logo",
        "description": "Scope: `branding:write`.",
        "security": [
          {
            "bearer": [
              "branding:write"
            ]
          }
        ],
        "x-scope": "branding:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "color": {
                    "type": "string",
                    "examples": [
                      "#2563eb"
                    ]
                  },
                  "logo": {
                    "type": "string",
                    "description": "data: URL, PNG/JPEG/WebP/GIF up to 1 MB"
                  },
                  "remove_logo": {
                    "type": "boolean"
                  },
                  "reset": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/license": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_license",
        "summary": "License state and plan",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/license/activate": {
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_license_activate",
        "summary": "free: true gets the Free plan from livepanel.uz; token installs a signed key (paid keys arrive by themselves after payment). A lower plan never replaces an active higher one: 409 license_not_better. Neither given: 400 license_token_required",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "free": {
                    "type": "boolean"
                  },
                  "token": {
                    "type": "string",
                    "description": "A signed license key for this installation"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/metrics": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_metrics",
        "summary": "Live server load",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/stats": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_stats",
        "summary": "Server load history",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "live, 1h, 24h, 7d or 30d",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/system/services": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_system_services",
        "summary": "System services",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_system_services",
        "summary": "Start, stop, restart, enable or disable a service",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "start",
                      "stop",
                      "restart",
                      "enable",
                      "disable"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "unit",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/applications": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_applications",
        "summary": "Server applications (PHP, Node.js, Python versions and tools)",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_applications",
        "summary": "Install or remove an application",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "install",
                      "remove"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "name",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/firewall": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_firewall",
        "summary": "Firewall state and rules",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_firewall",
        "summary": "Apply rules, then confirm with the returned token within a minute (otherwise the old rules come back)",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "apply",
                      "confirm"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "rules": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string",
                          "enum": [
                            "allow",
                            "deny"
                          ]
                        },
                        "proto": {
                          "type": "string"
                        },
                        "ports": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "comment": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/security": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_security",
        "summary": "Sign-in protection, blocked IPs and fail2ban",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/security/settings": {
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_security_settings",
        "summary": "Sign-in protection settings",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/security/unblock": {
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_security_unblock",
        "summary": "Unblock an IP",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ip": {
                    "type": "string"
                  },
                  "jail": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "ip"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quota": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_quota",
        "summary": "Disk quota state",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_quota",
        "summary": "Turn disk quotas on",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "enable"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/panel-tls": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_panel_tls",
        "summary": "The panel’s IP certificate",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_panel_tls",
        "summary": "issue: get/renew the IP certificate (400 service_not_paid without the paid Panel SSL service); self: back to the own certificate (fine when it already is)",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "issue",
                      "self"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/panel-addresses": {
      "get": {
        "tags": [
          "Server"
        ],
        "operationId": "get_panel_addresses",
        "summary": "Panel domains",
        "description": "Scope: `system:read`.",
        "security": [
          {
            "bearer": [
              "system:read"
            ]
          }
        ],
        "x-scope": "system:read",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Server"
        ],
        "operationId": "post_panel_addresses",
        "summary": "Add a panel domain, change its certificate or remove it",
        "description": "Scope: `system:write`.",
        "security": [
          {
            "bearer": [
              "system:write"
            ]
          }
        ],
        "x-scope": "system:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "add",
                      "cert",
                      "remove"
                    ]
                  },
                  "domain": {
                    "type": "string"
                  },
                  "cert": {
                    "type": "string",
                    "enum": [
                      "letsencrypt",
                      "selfsigned",
                      "custom"
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "cert_pem": {
                    "type": "string"
                  },
                  "key_pem": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "action",
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input and other validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: no, wrong, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "license_required, or upgrade_required when the panel is not on the Premium plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_denied (token scope) or forbidden (the account cannot manage this object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "hosting_unavailable: the server agent is busy, retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "lp_<token>",
        "description": "Scopes: backups:read, backups:write, branding:read, branding:write, cron:read, cron:write, databases:read, databases:write, dns:read, dns:write, files:read, files:write, ftp:read, ftp:write, git:read, git:write, limits:read, limits:write, mail:read, mail:write, sites:read, sites:write, system:read, system:write, users:read, users:write"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error code, e.g. scope_denied, site_not_found, upgrade_required"
          }
        },
        "additionalProperties": false,
        "required": [
          "error"
        ]
      },
      "Permissions": {
        "type": "object",
        "properties": {
          "sites": {
            "type": "boolean"
          },
          "files": {
            "type": "boolean"
          },
          "services": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "reseller",
              "user"
            ]
          },
          "creator_id": {
            "type": "integer"
          },
          "disabled": {
            "type": "boolean"
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          },
          "created": {
            "type": "integer",
            "description": "Unix time"
          },
          "ssh": {
            "type": "boolean"
          },
          "ssh_logins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "two_factor": {
            "type": "boolean"
          },
          "memory_block": {
            "type": "object",
            "description": "Present while the account is blocked for its RAM limit"
          },
          "creator": {
            "type": "boolean",
            "description": "true for the main administrator"
          }
        }
      },
      "AccountInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,63}$",
            "description": "Cannot change after creation; send it in PATCH too"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "reseller",
              "admin"
            ],
            "description": "admin only by the main administrator; resellers create user only"
          },
          "password": {
            "type": "string",
            "minLength": 6,
            "maxLength": 72,
            "description": "Required on create; empty in PATCH keeps it"
          },
          "creator_id": {
            "type": "integer",
            "description": "Parent account (default: the token owner)"
          },
          "disabled": {
            "type": "boolean",
            "description": "true blocks sign-in and the account’s sites stay as they are"
          },
          "permissions": {
            "$ref": "#/components/schemas/Permissions"
          },
          "ssh": {
            "type": "boolean",
            "description": "SSH/SFTP with the panel password"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "role"
        ]
      },
      "Site": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "owner": {
            "type": "string",
            "description": "Linux user"
          },
          "parent": {
            "type": "string"
          },
          "runtime": {
            "type": "string",
            "enum": [
              "php",
              "node",
              "python",
              "static",
              "proxy"
            ]
          },
          "handler": {
            "type": "string",
            "enum": [
              "fpm",
              "fastcgi",
              "apache",
              "cgi"
            ]
          },
          "php": {
            "type": "string"
          },
          "node": {
            "type": "string"
          },
          "python": {
            "type": "string"
          },
          "proxy": {
            "type": "string"
          },
          "root": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "disabled",
              "failed"
            ]
          },
          "error": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "created": {
            "type": "integer"
          },
          "ssl": {
            "type": "string",
            "enum": [
              "",
              "letsencrypt",
              "selfsigned"
            ]
          },
          "force_https": {
            "type": "boolean"
          },
          "account_id": {
            "type": "integer"
          },
          "account_name": {
            "type": "string"
          }
        }
      },
      "SiteCreate": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "examples": [
              "shop.example.uz"
            ]
          },
          "runtime": {
            "type": "string",
            "enum": [
              "php",
              "node",
              "python",
              "static",
              "proxy"
            ]
          },
          "handler": {
            "type": "string",
            "enum": [
              "fpm",
              "fastcgi",
              "apache",
              "cgi"
            ],
            "description": "PHP only"
          },
          "php": {
            "type": "string",
            "examples": [
              "8.3"
            ]
          },
          "node": {
            "type": "string",
            "description": "Node.js major, empty = system"
          },
          "python": {
            "type": "string",
            "examples": [
              "3.12"
            ],
            "description": "Must be installed"
          },
          "proxy": {
            "type": "string",
            "examples": [
              "http://127.0.0.1:3000"
            ]
          },
          "account_id": {
            "type": "integer",
            "description": "Default: the token owner"
          },
          "owner": {
            "type": "string",
            "description": "Existing Linux user"
          },
          "new_owner": {
            "type": "boolean"
          },
          "owner_name": {
            "type": "string",
            "description": "Name of a new Linux user"
          },
          "parent": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "domain",
          "runtime"
        ]
      },
      "Limits": {
        "type": "object",
        "properties": {
          "memory_mib": {
            "type": "integer",
            "description": "0 or >= 32"
          },
          "disk_mib": {
            "type": "integer",
            "description": "0 or >= 64; disk quotas must be on"
          },
          "cpu_percent": {
            "type": "integer",
            "description": "Must be 0 for now"
          },
          "domains": {
            "type": "integer"
          },
          "databases": {
            "type": "integer"
          },
          "users": {
            "type": "integer",
            "description": "Resellers only"
          }
        },
        "additionalProperties": false
      },
      "LimitsPut": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer"
          },
          "memory_mib": {
            "type": "integer",
            "description": "0 or >= 32"
          },
          "disk_mib": {
            "type": "integer",
            "description": "0 or >= 64; disk quotas must be on"
          },
          "cpu_percent": {
            "type": "integer",
            "description": "Must be 0 for now"
          },
          "domains": {
            "type": "integer"
          },
          "databases": {
            "type": "integer"
          },
          "users": {
            "type": "integer",
            "description": "Resellers only"
          }
        },
        "additionalProperties": false,
        "required": [
          "account_id"
        ]
      }
    }
  }
}
