Skip to Content
3x-ui3x-ui
СправочникСправочник по API

Сервер

Состояние системы, получение логов, генераторы сертификатов, управление бинарным файлом Xray, а также резервное копирование и восстановление. Все эндпоинты находятся в /panel/api/server.

GET
/panel/api/server/status

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?

Status represents comprehensive system and application status information. It includes CPU, memory, disk, network statistics, and Xray process status.

Example Request
curl -X GET 'https://example.com/panel/api/server/status'
Example Response200
{  "success": true,  "obj": {    "amneziawg": null,    "appStats": null,    "cpu": 0,    "cpuCores": 0,    "cpuSpeedMhz": 0,    "disk": null,    "diskIO": null,    "diskTraffic": null,    "loads": [      0    ],    "logicalPro": 0,    "mem": null,    "netIO": null,    "netTraffic": null,    "networkInterface": null,    "panelGuid": "",    "panelVersion": "",    "publicIP": null,    "resourceScope": "",    "sampleAgeMillis": 125,    "swap": null,    "tcpCount": 0,    "udpCount": 0,    "unavailableMetrics": [      ""    ],    "uptime": 0,    "xray": null  }}
GET
/panel/api/server/fail2banStatus

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/fail2banStatus'
Example Response200
{  "success": true,  "obj": {    "enabled": true,    "installed": true,    "usable": true,    "windows": false  }}
GET
/panel/api/server/cpuHistory/{bucket}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

bucket*integer

Bucket size in seconds. Allowed: 2, 5, 30, 60, 180, 360, 720, 1440, 2880, 10080.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/cpuHistory/0'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/history/{metric}/{bucket}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

metric*string

cpu | mem | swap | netUp | netDown | pktUp | pktDown | diskRead | diskWrite | diskUsage | tcpCount | udpCount | online | load1 | load5 | load15.

bucket*integer

Bucket size in seconds. Allowed: 2, 5, 30, 60, 180, 360, 720, 1440, 2880, 10080.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/history/string/0'
Example Response200
{  "success": true,  "obj": [    {      "t": 1700000000,      "v": 12.5    },    {      "t": 1700000002,      "v": 13.1    }  ]}
GET
/panel/api/server/xrayMetricsState

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/xrayMetricsState'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/xrayMetricsHistory/{metric}/{bucket}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

metric*string

xrAlloc | xrSys | xrHeapObjects | xrNumGC | xrPauseNs.

bucket*integer

Bucket size in seconds. Allowed: 2, 5, 30, 60, 180, 360, 720, 1440, 2880, 10080.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/xrayMetricsHistory/string/0'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/xrayObservatory

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/xrayObservatory'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/xrayObservatoryHistory/{tag}/{bucket}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

tag*string

Outbound tag from the observatory config.

bucket*integer

Bucket size in seconds. Allowed: 2, 5, 30, 60, 180, 360, 720, 1440, 2880, 10080.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/xrayObservatoryHistory/string/0'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getXrayVersion

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getXrayVersion'
Example Response200
{  "success": true,  "obj": [    "v25.10.31",    "v25.9.15",    "v25.8.1"  ]}
GET
/panel/api/server/getPanelUpdateInfo

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getPanelUpdateInfo'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getConfigJson

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getConfigJson'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getDb

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getDb'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getMigration

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getMigration'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getNewUUID

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?
Example Request
curl -X GET 'https://example.com/panel/api/server/getNewUUID'
Example Response200
{  "success": true,  "obj": {    "uuid": "550e8400-e29b-41d4-a716-446655440000"  }}
GET
/panel/api/server/getWebCertFiles

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getWebCertFiles'
Example Response200
{  "success": true,  "obj": {    "webCertFile": "/root/cert/example.com/fullchain.pem",    "webKeyFile": "/root/cert/example.com/privkey.pem"  }}
GET
/panel/api/server/descendants

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/descendants'
Example Response200
{  "success": true,  "obj": [    {      "guid": "c3d4-...",      "parentGuid": "a1b2-...",      "name": "Node3",      "address": "10.0.0.3",      "status": "online"    }  ]}
GET
/panel/api/server/getNewX25519Cert

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getNewX25519Cert'
Example Response200
{  "success": true,  "obj": {    "privateKey": "uN9qLfV3zH8w...",    "publicKey": "5v8xPqR2sM7k..."  }}
GET
/panel/api/server/getNewmldsa65

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?
Example Request
curl -X GET 'https://example.com/panel/api/server/getNewmldsa65'
Example Response200
{  "success": true,  "obj": {    "seed": "mldsa65-seed",    "verify": "mldsa65-verify"  }}
GET
/panel/api/server/getNewmlkem768

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?
Example Request
curl -X GET 'https://example.com/panel/api/server/getNewmlkem768'
Example Response200
{  "success": true,  "obj": {    "client": "mlkem768-client",    "seed": "mlkem768-seed"  }}
GET
/panel/api/server/getNewVlessEnc

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X GET 'https://example.com/panel/api/server/getNewVlessEnc'
Example Response200
{  "success": true,  "obj": {    "auths": [      {        "id": 0,        "label": "Auth #0",        "encryption": "aes-256-gcm",        "decryption": ""      }    ]  }}
POST
/panel/api/server/stopXrayService

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/stopXrayService'
Example Response
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/restartXrayService

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/restartXrayService'
Example Response
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/installXray/{version}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

version*string

Xray tag (e.g. v25.10.31) or "latest".

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/installXray/string'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/updatePanel

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/x-www-form-urlencoded
  1. body
dev?boolean

Override this run's channel. Omit to use the panel's configured channel.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/updatePanel' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d ''
Example Response200
{  "success": true,  "obj": {    "runId": "1735689600123456789"  }}
POST
/panel/api/server/setUpdateChannel

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/x-www-form-urlencoded
  1. body
dev*boolean

true = dev channel, false = stable.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/setUpdateChannel' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'dev=true'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/updateGeofile

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/updateGeofile'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/updateGeofile/{fileName}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

fileName*string

Filename of the data file to refresh.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/updateGeofile/string'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/logs/{count}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

count*integer

Number of trailing log lines.

Request Body

application/x-www-form-urlencoded
  1. body
level?string

Minimum log level filter.

syslog?boolean

Read system logs instead of the panel log.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?array<string>|null
Example Request
curl -X POST 'https://example.com/panel/api/server/logs/0' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d ''
Example Response200
{  "success": true,  "obj": [    "2025/01/01 12:00:00 [INFO] Server started",    "2025/01/01 12:00:01 [INFO] Xray is running"  ]}
POST
/panel/api/server/xraylogs/{count}

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

count*integer

Number of trailing log lines.

Request Body

application/x-www-form-urlencoded
  1. body
filter?string

Keyword filter — only lines containing this string.

showDirect?string

"true" to include direct (freedom) traffic lines.

showBlocked?string

"true" to include blocked (blackhole) traffic lines.

showProxy?string

"true" to include proxy traffic lines.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?array<>|null
Example Request
curl -X POST 'https://example.com/panel/api/server/xraylogs/0' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d ''
Example Response200
{  "success": true,  "obj": [    {      "DateTime": "2025-01-01T12:00:00Z",      "Email": "alice@example.com",      "Event": 0,      "FromAddress": "192.0.2.10:54321",      "Inbound": "inbound-443",      "Outbound": "direct",      "ToAddress": "example.com:443"    }  ]}
POST
/panel/api/server/importDB

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

multipart/form-data
  1. body
db*unknown

Database backup or migration file to upload.

keepHostSettings?boolean

Keep this machine's addresses, certificates, node identity, and network traffic interface selection. Default true.

Defaulttrue

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/importDB'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/getNewEchCert

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/x-www-form-urlencoded
  1. body
sni*string

Server Name Indication to generate the ECH config for.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/getNewEchCert' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'sni=string'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/getCertHash

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/x-www-form-urlencoded
  1. body
certFile*string

Path to a certificate file on the server. Takes precedence over certContent.

Match.*\S.*
certContent?string

Inline PEM (or DER) certificate content, used when certFile is empty.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/getCertHash' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'certFile=string'
Example Response200
{  "success": true,  "obj": [    "e8e2d3..."  ]}
POST
/panel/api/server/getRemoteCertHash

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/x-www-form-urlencoded
  1. body
server*string

Remote server as domain or domain:port (default port 443), e.g. cloudflare-dns.com.

allowPrivate?boolean

Ping a private/internal/loopback server (LAN, Docker service name). Default false (SSRF guard blocks it and the error response sets obj.privateTarget=true).

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/getRemoteCertHash' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'server=string'
Example Response200
{  "success": true,  "obj": [    "e8e2d3..."  ]}
GET
/panel/api/server/clientIps

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?array<>
Example Request
curl -X GET 'https://example.com/panel/api/server/clientIps'
Example Response200
{  "success": true,  "obj": [    {      "clientEmail": "",      "id": 0,      "ips": null    }  ]}
POST
/panel/api/server/clientIps

Authorization

headerAuthorizationBearer <token>

Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/json
  1. body
[index: integer]?

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
Example Request
curl -X POST 'https://example.com/panel/api/server/clientIps' \  -H 'Content-Type: application/json' \  -d '[  {    "clientEmail": "string",    "ips": [      {        "ip": "string",        "timestamp": 0      }    ]  }]'
Example Response200
{  "success": true,  "msg": "string",  "obj": null}