{ "swagger": "2.0", "info": { "description": "API documentation for 3X-UI Panel (Master-Slave Cluster)", "title": "3X-UI Cluster API", "contact": {}, "version": "1.0" }, "host": "localhost:2053", "basePath": "/", "paths": { "/panel/api/account/add": { "post": { "description": "Creates a new user account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Add account", "parameters": [ { "description": "Account data", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Account" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/del/{id}": { "post": { "description": "Deletes an account and all associated client bindings", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Delete account", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/get/{id}": { "get": { "description": "Returns a single account by its ID", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Get account", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/list": { "get": { "description": "Returns all user accounts", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "List accounts", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/reset/traffic/{id}": { "post": { "description": "Resets all traffic counters for an account and pushes config to slaves", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Reset account traffic", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/update/{id}": { "post": { "description": "Updates an existing account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Update account", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true }, { "description": "Updated account data", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Account" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/{id}/clients": { "get": { "description": "Returns all clients linked to an account", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Get account clients", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/{id}/clients/add": { "post": { "description": "Associates an inbound client with an account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Add client to account", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/{id}/clients/remove/{clientEmail}": { "post": { "description": "Disassociates a client from an account", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Remove client from account", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Client email", "name": "clientEmail", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/account/{id}/traffic": { "get": { "description": "Returns aggregated upload/download traffic for an account", "produces": [ "application/json" ], "tags": [ "Accounts" ], "summary": "Get account traffic", "parameters": [ { "type": "integer", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/add": { "post": { "description": "Creates a new inbound configuration on a slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Add inbound", "parameters": [ { "description": "Inbound configuration", "name": "inbound", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Inbound" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/addClient": { "post": { "description": "Adds a new client to an existing inbound configuration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Add client to inbound", "parameters": [ { "description": "Inbound with client data", "name": "client", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Inbound" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/clearClientIps/{email}": { "post": { "description": "Clears all recorded IP addresses for a client", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Clear client IPs", "parameters": [ { "type": "string", "description": "Client email", "name": "email", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/clientIps/{email}": { "post": { "description": "Returns IP addresses associated with a client", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get client IPs", "parameters": [ { "type": "string", "description": "Client email", "name": "email", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/del/{id}": { "post": { "description": "Deletes an inbound configuration and pushes config to slave", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Delete inbound", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/delDepletedClients/{id}": { "post": { "description": "Removes clients whose traffic limits are exhausted", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Delete depleted clients", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/get/{id}": { "get": { "description": "Returns a specific inbound configuration by ID", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get inbound", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/getClientTraffics/{email}": { "get": { "description": "Returns traffic statistics for a client identified by email", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get client traffic by email", "parameters": [ { "type": "string", "description": "Client email", "name": "email", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/getClientTrafficsById/{id}": { "get": { "description": "Returns traffic statistics for clients in an inbound", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get client traffic by ID", "parameters": [ { "type": "string", "description": "Inbound ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/import": { "post": { "description": "Imports an inbound configuration from JSON data", "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Import inbound", "parameters": [ { "type": "string", "description": "Inbound JSON data", "name": "data", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/lastOnline": { "post": { "description": "Returns last online timestamps for all clients", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get last online times", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/list": { "get": { "description": "Returns all inbound configurations, optionally filtered by slave", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "List inbounds", "parameters": [ { "type": "integer", "description": "Filter by slave ID (-1 for all)", "name": "slaveId", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/onlines": { "post": { "description": "Returns a list of currently online client emails", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get online clients", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/resetAllTraffics": { "post": { "description": "Resets traffic counters for all inbounds", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Reset all traffic", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/update/{id}": { "post": { "description": "Updates an existing inbound configuration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Update inbound", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true }, { "description": "Updated inbound configuration", "name": "inbound", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Inbound" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/updateClient/{clientId}": { "post": { "description": "Updates a client's settings in an inbound", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Update inbound client", "parameters": [ { "type": "string", "description": "Client ID", "name": "clientId", "in": "path", "required": true }, { "description": "Inbound with updated client data", "name": "client", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Inbound" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/updateClientTraffic/{email}": { "post": { "description": "Sets upload/download traffic for a client", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Update client traffic", "parameters": [ { "type": "string", "description": "Client email", "name": "email", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/{id}/clients": { "get": { "description": "Returns all client emails associated with an inbound", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Get inbound client emails", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/{id}/delClient/{clientId}": { "post": { "description": "Removes a client from an inbound", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Delete inbound client", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Client ID", "name": "clientId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/inbounds/{id}/delClientByEmail/{email}": { "post": { "description": "Removes a client from an inbound using their email", "produces": [ "application/json" ], "tags": [ "Inbounds" ], "summary": "Delete client by email", "parameters": [ { "type": "integer", "description": "Inbound ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Client email", "name": "email", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/outbounds/add": { "post": { "description": "Creates a new outbound configuration for a slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Outbounds" ], "summary": "Add outbound", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/outbounds/del/{id}": { "post": { "description": "Deletes an outbound configuration from a slave", "produces": [ "application/json" ], "tags": [ "Outbounds" ], "summary": "Delete outbound", "parameters": [ { "type": "integer", "description": "Outbound index", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "Slave ID", "name": "slaveId", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/outbounds/list": { "get": { "description": "Returns outbound configurations for a specific slave", "produces": [ "application/json" ], "tags": [ "Outbounds" ], "summary": "List outbounds", "parameters": [ { "type": "integer", "description": "Slave ID", "name": "slaveId", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/outbounds/update": { "post": { "description": "Updates an outbound configuration for a slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Outbounds" ], "summary": "Update outbound", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/routing/add": { "post": { "description": "Creates a new routing rule for a slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Routing" ], "summary": "Add routing rule", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/routing/del/{id}": { "post": { "description": "Deletes a routing rule from a slave", "produces": [ "application/json" ], "tags": [ "Routing" ], "summary": "Delete routing rule", "parameters": [ { "type": "integer", "description": "Rule index", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "Slave ID", "name": "slaveId", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/routing/list": { "get": { "description": "Returns routing rules for a specific slave", "produces": [ "application/json" ], "tags": [ "Routing" ], "summary": "List routing rules", "parameters": [ { "type": "integer", "description": "Slave ID", "name": "slaveId", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/routing/update": { "post": { "description": "Updates a routing rule for a slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Routing" ], "summary": "Update routing rule", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/cpuHistory/{bucket}": { "get": { "description": "Returns aggregated CPU usage history for chart display", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Get CPU history", "parameters": [ { "type": "integer", "description": "Time bucket in seconds (2,30,60,120,180,300)", "name": "bucket", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getConfigJson": { "get": { "description": "Returns the current Xray configuration as JSON", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Get Xray config JSON", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getDb": { "get": { "description": "Downloads the panel database file", "produces": [ "application/octet-stream" ], "tags": [ "Server" ], "summary": "Download database", "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/panel/api/server/getNewEchCert": { "post": { "description": "Generates a new ECH (Encrypted Client Hello) certificate", "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Generate ECH certificate", "parameters": [ { "type": "string", "description": "Server Name Indication", "name": "sni", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getNewUUID": { "get": { "description": "Generates a new UUID v4", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Generate UUID", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getNewVlessEnc": { "get": { "description": "Generates a new VLESS encryption key", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Generate VLESS encryption key", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getNewX25519Cert": { "get": { "description": "Generates a new X25519 key pair", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Generate X25519 certificate", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getNewmldsa65": { "get": { "description": "Generates a new ML-DSA-65 key pair", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Generate ML-DSA-65 key", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getNewmlkem768": { "get": { "description": "Generates a new ML-KEM-768 key pair", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Generate ML-KEM-768 key", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/getXrayVersion": { "get": { "description": "Returns a list of available Xray versions (cached for 1 minute)", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Get Xray versions", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/importDB": { "post": { "description": "Imports a database file and restarts the Xray service", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Import database", "parameters": [ { "type": "file", "description": "Database file", "name": "db", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/installXray/{version}": { "post": { "description": "Installs or updates Xray to the specified version", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Install Xray version", "parameters": [ { "type": "string", "description": "Xray version to install", "name": "version", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/logs/{count}": { "post": { "description": "Retrieves panel logs with filtering by count, level, and syslog", "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Get application logs", "parameters": [ { "type": "string", "description": "Number of log lines", "name": "count", "in": "path", "required": true }, { "type": "string", "description": "Log level filter", "name": "level", "in": "formData" }, { "type": "string", "description": "Syslog filter", "name": "syslog", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/restartSlaveXray/{slaveId}": { "post": { "description": "Restarts the Xray service on a specific slave node", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Restart slave Xray", "parameters": [ { "type": "integer", "description": "Slave ID", "name": "slaveId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/restartXrayService": { "post": { "description": "Restarts the Xray service", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Restart Xray service", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/status": { "get": { "description": "Returns the current server status including CPU, memory, disk, and network info", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Get server status", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/stopXrayService": { "post": { "description": "Stops the running Xray service", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Stop Xray service", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/updateGeofile/{fileName}": { "post": { "description": "Updates the specified geo file (geoip.dat/geosite.dat) for Xray", "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Update geo file", "parameters": [ { "type": "string", "description": "Geo file name", "name": "fileName", "in": "path" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/server/xraylogs/{count}": { "post": { "description": "Retrieves Xray access logs with filtering by traffic type", "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "Server" ], "summary": "Get Xray logs", "parameters": [ { "type": "string", "description": "Number of log lines", "name": "count", "in": "path", "required": true }, { "type": "string", "description": "Text filter", "name": "filter", "in": "formData" }, { "type": "string", "description": "Show direct traffic", "name": "showDirect", "in": "formData" }, { "type": "string", "description": "Show blocked traffic", "name": "showBlocked", "in": "formData" }, { "type": "string", "description": "Show proxy traffic", "name": "showProxy", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/setting/all": { "post": { "description": "Returns all current panel settings", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Get all settings", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/setting/defaultSettings": { "post": { "description": "Returns the default panel settings", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Get default settings", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/setting/getDefaultJsonConfig": { "get": { "description": "Returns the default Xray configuration template", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Get default Xray config", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/setting/restartPanel": { "post": { "description": "Restarts the panel service after a 3-second delay", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Restart panel", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/setting/update": { "post": { "description": "Updates all panel settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Update settings", "parameters": [ { "description": "Settings data", "name": "settings", "in": "body", "required": true, "schema": { "$ref": "#/definitions/entity.AllSetting" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/setting/updateUser": { "post": { "description": "Updates the login username and password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Update user credentials", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave-certs/del/{id}": { "post": { "description": "Deletes a TLS certificate by ID", "produces": [ "application/json" ], "tags": [ "SlaveCerts" ], "summary": "Delete certificate", "parameters": [ { "type": "integer", "description": "Certificate ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave-certs/list": { "get": { "description": "Returns all TLS certificates across all slaves", "produces": [ "application/json" ], "tags": [ "SlaveCerts" ], "summary": "List all certificates", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave-certs/slave/{slaveId}": { "get": { "description": "Returns TLS certificates for a specific slave node", "produces": [ "application/json" ], "tags": [ "SlaveCerts" ], "summary": "Get certificates for slave", "parameters": [ { "type": "integer", "description": "Slave ID", "name": "slaveId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave/add": { "post": { "description": "Registers a new slave node", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Slaves" ], "summary": "Add slave", "parameters": [ { "description": "Slave data", "name": "slave", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Slave" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave/connect": { "get": { "description": "WebSocket endpoint for slave-to-master communication", "tags": [ "Slaves" ], "summary": "Connect slave (WebSocket)", "parameters": [ { "type": "string", "description": "Slave secret key", "name": "secret", "in": "query", "required": true } ], "responses": {} } }, "/panel/api/slave/del/{id}": { "post": { "description": "Deletes a slave node with cascade deletion of all associated data", "produces": [ "application/json" ], "tags": [ "Slaves" ], "summary": "Delete slave", "parameters": [ { "type": "integer", "description": "Slave ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave/install/{id}": { "get": { "description": "Generates a bash install command for setting up a slave node", "produces": [ "application/json" ], "tags": [ "Slaves" ], "summary": "Get install command", "parameters": [ { "type": "integer", "description": "Slave ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/slave/list": { "get": { "description": "Returns all slave nodes with their system stats and traffic", "produces": [ "application/json" ], "tags": [ "Slaves" ], "summary": "List slaves", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/": { "post": { "description": "Returns Xray configuration for a specific slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Get Xray settings", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/getDefaultJsonConfig": { "get": { "description": "Returns the default Xray configuration template", "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Get default Xray config", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/getOutboundsTraffic": { "get": { "description": "Returns traffic statistics for outbound connections", "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Get outbound traffic", "parameters": [ { "type": "integer", "description": "Slave ID (-1 for all)", "name": "slaveId", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/getXrayResult": { "get": { "description": "Returns the current Xray service running result", "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Get Xray result", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/resetOutboundsTraffic": { "post": { "description": "Resets traffic counters for a specific outbound on a slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Reset outbound traffic", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/update": { "post": { "description": "Updates the Xray configuration for a specific slave", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Update Xray settings", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } }, "/panel/api/xray/warp/{action}": { "post": { "description": "Handles Warp registration, config, data, and license operations", "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "XraySettings" ], "summary": "Warp operations", "parameters": [ { "type": "string", "description": "Action (data/del/config/reg/license)", "name": "action", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Msg" } } } } } }, "definitions": { "entity.AllSetting": { "type": "object", "properties": { "datepicker": { "description": "Date picker format", "type": "string" }, "expireDiff": { "description": "Expiration warning threshold in days", "type": "integer" }, "externalTrafficInformEnable": { "description": "Enable external traffic reporting", "type": "boolean" }, "externalTrafficInformURI": { "description": "URI for external traffic reporting", "type": "string" }, "ldapAutoCreate": { "type": "boolean" }, "ldapAutoDelete": { "type": "boolean" }, "ldapBaseDN": { "type": "string" }, "ldapBindDN": { "type": "string" }, "ldapDefaultExpiryDays": { "type": "integer" }, "ldapDefaultLimitIP": { "type": "integer" }, "ldapDefaultTotalGB": { "type": "integer" }, "ldapEnable": { "description": "LDAP settings", "type": "boolean" }, "ldapFlagField": { "description": "Generic flag configuration", "type": "string" }, "ldapHost": { "type": "string" }, "ldapInboundTags": { "type": "string" }, "ldapInvertFlag": { "type": "boolean" }, "ldapPassword": { "type": "string" }, "ldapPort": { "type": "integer" }, "ldapSyncCron": { "type": "string" }, "ldapTruthyValues": { "type": "string" }, "ldapUseTLS": { "type": "boolean" }, "ldapUserAttr": { "description": "e.g., mail or uid", "type": "string" }, "ldapUserFilter": { "type": "string" }, "ldapVlessField": { "type": "string" }, "pageSize": { "description": "UI settings", "type": "integer" }, "remarkModel": { "description": "Remark model pattern for inbounds", "type": "string" }, "sessionMaxAge": { "description": "Session maximum age in minutes", "type": "integer" }, "subAnnounce": { "description": "Subscription announce", "type": "string" }, "subCertFile": { "description": "SSL certificate file for subscription server", "type": "string" }, "subDomain": { "description": "Domain for subscription server validation", "type": "string" }, "subEnable": { "description": "Subscription server settings", "type": "boolean" }, "subEnableRouting": { "description": "Enable routing for subscription", "type": "boolean" }, "subEncrypt": { "description": "Encrypt subscription responses", "type": "boolean" }, "subJsonEnable": { "description": "Enable JSON subscription endpoint", "type": "boolean" }, "subJsonFragment": { "description": "JSON subscription fragment configuration", "type": "string" }, "subJsonMux": { "description": "JSON subscription mux configuration", "type": "string" }, "subJsonNoises": { "description": "JSON subscription noise configuration", "type": "string" }, "subJsonPath": { "description": "Path for JSON subscription endpoint", "type": "string" }, "subJsonRules": { "type": "string" }, "subJsonURI": { "description": "JSON subscription server URI", "type": "string" }, "subKeyFile": { "description": "SSL private key file for subscription server", "type": "string" }, "subListen": { "description": "Subscription server listen IP", "type": "string" }, "subPath": { "description": "Base path for subscription URLs", "type": "string" }, "subPort": { "description": "Subscription server port", "type": "integer" }, "subProfileUrl": { "description": "Subscription profile URL", "type": "string" }, "subRoutingRules": { "description": "Subscription global routing rules (Only for Happ)", "type": "string" }, "subShowInfo": { "description": "Show client information in subscriptions", "type": "boolean" }, "subSupportUrl": { "description": "Subscription support URL", "type": "string" }, "subTitle": { "description": "Subscription title", "type": "string" }, "subURI": { "description": "Subscription server URI", "type": "string" }, "subUpdates": { "description": "Subscription update interval in minutes", "type": "integer" }, "tgBotAPIServer": { "description": "Custom API server for Telegram bot", "type": "string" }, "tgBotBackup": { "description": "Enable database backup via Telegram", "type": "boolean" }, "tgBotChatId": { "description": "Telegram chat ID for notifications", "type": "string" }, "tgBotEnable": { "description": "Telegram bot settings", "type": "boolean" }, "tgBotLoginNotify": { "description": "Send login notifications", "type": "boolean" }, "tgBotProxy": { "description": "Proxy URL for Telegram bot", "type": "string" }, "tgBotToken": { "description": "Telegram bot token", "type": "string" }, "tgCpu": { "description": "CPU usage threshold for alerts", "type": "integer" }, "tgLang": { "description": "Telegram bot language", "type": "string" }, "tgRunTime": { "description": "Cron schedule for Telegram notifications", "type": "string" }, "timeLocation": { "description": "Security settings", "type": "string" }, "trafficDiff": { "description": "Traffic warning threshold percentage", "type": "integer" }, "twoFactorEnable": { "description": "Enable two-factor authentication", "type": "boolean" }, "twoFactorToken": { "description": "Two-factor authentication token", "type": "string" }, "webBasePath": { "description": "Base path for web panel URLs", "type": "string" }, "webCertFile": { "description": "Path to SSL certificate file for web server", "type": "string" }, "webDomain": { "description": "Web server domain for domain validation", "type": "string" }, "webKeyFile": { "description": "Path to SSL private key file for web server", "type": "string" }, "webListen": { "description": "Web server settings", "type": "string" }, "webPort": { "description": "Web server port number", "type": "integer" } } }, "entity.Msg": { "type": "object", "properties": { "msg": { "description": "Response message text", "type": "string" }, "obj": { "description": "Optional data object" }, "success": { "description": "Indicates if the operation was successful", "type": "boolean" } } }, "model.Account": { "type": "object", "properties": { "createdAt": { "description": "Creation timestamp", "type": "integer" }, "down": { "description": "Total downloaded traffic in bytes", "type": "integer" }, "enable": { "description": "Whether the account is enabled", "type": "boolean" }, "expiryTime": { "description": "Expiration timestamp (0 = never expires)", "type": "integer" }, "id": { "type": "integer" }, "remark": { "description": "Account description", "type": "string" }, "reset": { "description": "Traffic reset period in days (0 = never)", "type": "integer" }, "subId": { "description": "Subscription UUID", "type": "string" }, "tgId": { "description": "Telegram user ID for notifications", "type": "integer" }, "totalGB": { "description": "Total traffic limit in GB (0 = unlimited)", "type": "integer" }, "up": { "description": "Total uploaded traffic in bytes", "type": "integer" }, "updatedAt": { "description": "Last update timestamp", "type": "integer" }, "username": { "description": "Unique account identifier", "type": "string" } } }, "model.Inbound": { "type": "object", "properties": { "address": { "description": "Custom domain/IP for subscription links (optional)", "type": "string" }, "allTime": { "description": "All-time traffic usage", "type": "integer" }, "clientStats": { "description": "Client traffic statistics", "type": "array", "items": { "$ref": "#/definitions/xray.ClientTraffic" } }, "down": { "description": "Download traffic in bytes", "type": "integer" }, "enable": { "description": "Whether the inbound is enabled", "type": "boolean" }, "expiryTime": { "description": "Expiration timestamp", "type": "integer" }, "id": { "description": "Unique identifier", "type": "integer" }, "lastTrafficResetTime": { "description": "Last traffic reset timestamp", "type": "integer" }, "listen": { "description": "Xray configuration fields", "type": "string" }, "port": { "type": "integer" }, "protocol": { "$ref": "#/definitions/model.Protocol" }, "remark": { "description": "Human-readable remark", "type": "string" }, "settings": { "type": "string" }, "slaveId": { "description": "Associated Slave ID (must be a valid slave)", "type": "integer" }, "sniffing": { "type": "string" }, "streamSettings": { "type": "string" }, "tag": { "type": "string" }, "total": { "description": "Total traffic limit in bytes", "type": "integer" }, "trafficReset": { "description": "Traffic reset schedule", "type": "string" }, "up": { "description": "Upload traffic in bytes", "type": "integer" } } }, "model.Protocol": { "type": "string", "enum": [ "vmess", "vless", "tunnel", "http", "trojan", "shadowsocks", "mixed", "wireguard" ], "x-enum-varnames": [ "VMESS", "VLESS", "Tunnel", "HTTP", "Trojan", "Shadowsocks", "Mixed", "WireGuard" ] }, "model.Slave": { "type": "object", "properties": { "address": { "description": "Slave IP or Domain", "type": "string" }, "id": { "type": "integer" }, "lastSeen": { "type": "integer" }, "name": { "type": "string" }, "port": { "description": "Slave Port (optional if using reverse WS)", "type": "integer" }, "secret": { "description": "Auth Token for Slave", "type": "string" }, "status": { "description": "online, offline", "type": "string" }, "systemStats": { "description": "CPU/Mem stats (JSON)", "type": "string" }, "version": { "description": "Slave version", "type": "string" } } }, "xray.ClientTraffic": { "type": "object", "properties": { "accountId": { "description": "Associated account ID (0 = no account)", "type": "integer" }, "allTime": { "type": "integer" }, "down": { "type": "integer" }, "email": { "type": "string" }, "enable": { "type": "boolean" }, "expiryTime": { "type": "integer" }, "id": { "type": "integer" }, "inboundId": { "type": "integer" }, "lastOnline": { "type": "integer" }, "reset": { "type": "integer" }, "subId": { "type": "string" }, "total": { "type": "integer" }, "up": { "type": "integer" }, "uuid": { "type": "string" } } } }, "securityDefinitions": { "SessionAuth": { "type": "apiKey", "name": "3x-ui", "in": "cookie" } } }