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

Сервер

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

GET
/panel/api/server/status

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/status"
{  "success": true,  "obj": {    "cpu": 12.5,    "mem": {      "current": 2147483648,      "total": 8589934592    },    "swap": {      "current": 0,      "total": 4294967296    },    "disk": {      "current": 53687091200,      "total": 268435456000    },    "netIO": {      "up": 1073741824,      "down": 2147483648    },    "xray": {      "state": "running",      "version": "v25.10.31"    },    "tcpCount": 42,    "load": {      "load1": 0.5,      "load5": 0.3,      "load15": 0.2    }  }}
GET
/panel/api/server/fail2banStatus

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/fail2banStatus"
{  "success": true,  "obj": {    "enabled": true,    "installed": true,    "usable": true,    "windows": false  }}
GET
/panel/api/server/cpuHistory/{bucket}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

bucket*integer

Bucket size in seconds. Allowed: 2, 30, 60, 120, 180, 300.

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/cpuHistory/0"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/history/{metric}/{bucket}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

metric*string

cpu | mem | netUp | netDown | online | load1 | load5 | load15.

bucket*integer

Bucket size in seconds. Allowed: 2, 30, 60, 120, 180, 300.

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/history/string/0"
{  "success": true,  "obj": [    {      "t": 1700000000,      "v": 12.5    },    {      "t": 1700000002,      "v": 13.1    }  ]}
GET
/panel/api/server/xrayMetricsState

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/xrayMetricsState"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/xrayMetricsHistory/{metric}/{bucket}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

metric*string

xrAlloc | xrSys | xrHeapObjects | xrNumGC | xrPauseNs.

bucket*integer

Bucket size in seconds. Allowed: 2, 30, 60, 120, 180, 300.

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/xrayMetricsHistory/string/0"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/xrayObservatory

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/xrayObservatory"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/xrayObservatoryHistory/{tag}/{bucket}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

tag*string

Outbound tag from the observatory config.

bucket*integer

Bucket size in seconds. Allowed: 2, 30, 60, 120, 180, 300.

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/xrayObservatoryHistory/string/0"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getXrayVersion

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getXrayVersion"
{  "success": true,  "obj": [    "v25.10.31",    "v25.9.15",    "v25.8.1"  ]}
GET
/panel/api/server/getPanelUpdateInfo

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getPanelUpdateInfo"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getConfigJson

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getConfigJson"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getDb

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getDb"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getMigration

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getMigration"
{  "success": true,  "msg": "string",  "obj": null}
GET
/panel/api/server/getNewUUID

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getNewUUID"
{  "success": true,  "obj": {    "uuid": "550e8400-e29b-41d4-a716-446655440000"  }}
GET
/panel/api/server/getWebCertFiles

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getWebCertFiles"
{  "success": true,  "obj": {    "webCertFile": "/root/cert/example.com/fullchain.pem",    "webKeyFile": "/root/cert/example.com/privkey.pem"  }}
GET
/panel/api/server/descendants

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/descendants"
{  "success": true,  "obj": [    {      "guid": "c3d4-...",      "parentGuid": "a1b2-...",      "name": "Node3",      "address": "10.0.0.3",      "status": "online"    }  ]}
GET
/panel/api/server/getNewX25519Cert

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getNewX25519Cert"
{  "success": true,  "obj": {    "privateKey": "uN9qLfV3zH8w...",    "publicKey": "5v8xPqR2sM7k..."  }}
GET
/panel/api/server/getNewmldsa65

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getNewmldsa65"
{  "success": true,  "obj": {    "seed": "mldsa65-seed",    "verify": "mldsa65-verify"  }}
GET
/panel/api/server/getNewmlkem768

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getNewmlkem768"
{  "success": true,  "obj": {    "client": "mlkem768-client",    "seed": "mlkem768-seed"  }}
GET
/panel/api/server/getNewVlessEnc

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/getNewVlessEnc"
{  "success": true,  "obj": {    "auths": [      {        "id": 0,        "label": "Auth #0",        "encryption": "aes-256-gcm",        "decryption": ""      }    ]  }}
POST
/panel/api/server/stopXrayService

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

application/json

curl -X POST "https://example.com/panel/api/server/stopXrayService"
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/restartXrayService

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

application/json

curl -X POST "https://example.com/panel/api/server/restartXrayService"
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/installXray/{version}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

version*string

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

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/installXray/string"
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/updatePanel

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/updatePanel" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d ''
{  "success": true,  "obj": {    "runId": "1735689600123456789"  }}
POST
/panel/api/server/setUpdateChannel

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

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

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/updateGeofile"
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/updateGeofile/{fileName}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

fileName*string

Filename of the data file to refresh.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/updateGeofile/string"
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/logs/{count}

Authorization

AuthorizationBearer <token>

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

In: header

Path Parameters

count*integer

Number of trailing log lines.

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/logs/0" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d ''
{  "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

AuthorizationBearer <token>

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

In: header

Path Parameters

count*integer

Number of trailing log lines.

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/xraylogs/0" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d ''
{  "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

AuthorizationBearer <token>

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

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/importDB" \  -F db="string"
{  "success": true,  "msg": "string",  "obj": null}
POST
/panel/api/server/getNewEchCert

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

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

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/getCertHash" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'certFile=string'
{  "success": true,  "obj": [    "e8e2d3..."  ]}
POST
/panel/api/server/getRemoteCertHash

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/panel/api/server/getRemoteCertHash" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'server=string'
{  "success": true,  "obj": [    "e8e2d3..."  ]}
GET
/panel/api/server/clientIps

Authorization

AuthorizationBearer <token>

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

In: header

Response Body

application/json

curl -X GET "https://example.com/panel/api/server/clientIps"
{  "success": true,  "obj": [    {      "clientEmail": "",      "id": 0,      "ips": null    }  ]}
POST
/panel/api/server/clientIps

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[index: integer]?

Response Body

application/json

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