Skip to content

Nodes ​

Add, monitor and manage Xray nodes.

20 endpoints

POST /api/node ​

Add Node

Add a new node to the database and optionally add it as a host.

Sudo admin only

Request body application/json · NodeCreate

FieldTypeRequiredDescription
namestringyes
addressstringyes
portintegernoDefault: 62050.
api_portintegernoDefault: 62051.
usage_coefficientnumbernoDefault: 1.0.
agent_enabledbooleannoDefault: true.
ip_limit_enabledbooleannoDefault: true.
add_as_new_hostbooleannoDefault: true.
core_idstringnoDefault: "main".
json
{
  "add_as_new_host": true,
  "address": "192.168.1.1",
  "api_port": 62051,
  "name": "DE node",
  "port": 62050,
  "usage_coefficient": 1
}

Response 200 Successful Response · NodeResponse

Response fields
FieldTypeDescription
namestring
addressstring
portinteger
api_portinteger
usage_coefficientnumber
agent_enabledboolean
ip_limit_enabledboolean
idinteger
xray_versionstring
statusconnected / connecting / error / disabled
messagestring
core_idstring
json
{
  "name": "string",
  "address": "string",
  "port": 62050,
  "api_port": 62051,
  "usage_coefficient": 1.0,
  "agent_enabled": true,
  "ip_limit_enabled": true,
  "id": 0,
  "xray_version": "string",
  "status": "connected",
  "message": "string",
  "core_id": "main"
}

Errors: 401 Unauthorized, 403 Forbidden, 409 Conflict

bash
curl -X POST 'https://YOUR-PANEL/api/node' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"add_as_new_host": true, "address": "192.168.1.1", "api_port": 62051, "name": "DE node", "port": 62050, "usage_coefficient": 1}'

GET /api/node-install/{job_id} ​

Install Status

Progress and log of a node installation started over SSH. Pass offset to get only the new log lines.

Sudo admin only

Parameters

NameInTypeRequiredDescription
job_idpathstringyes
offsetqueryintegerno

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/node-install/<job_id>' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/node/settings ​

Get Node Settings

Retrieve the current node settings, including TLS certificate.

Sudo admin only

Response 200 Successful Response · NodeSettings

Response fields
FieldTypeDescription
min_node_versionstring
certificatestring
json
{
  "min_node_version": "v0.2.0",
  "certificate": "string"
}

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/node/settings' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/node/{node_id} ​

Get Node

Retrieve details of a specific node by its ID.

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Response 200 Successful Response · NodeResponse

Response fields
FieldTypeDescription
namestring
addressstring
portinteger
api_portinteger
usage_coefficientnumber
agent_enabledboolean
ip_limit_enabledboolean
idinteger
xray_versionstring
statusconnected / connecting / error / disabled
messagestring
core_idstring
json
{
  "name": "string",
  "address": "string",
  "port": 62050,
  "api_port": 62051,
  "usage_coefficient": 1.0,
  "agent_enabled": true,
  "ip_limit_enabled": true,
  "id": 0,
  "xray_version": "string",
  "status": "connected",
  "message": "string",
  "core_id": "main"
}

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/node/<node_id>' \
  -H 'Authorization: Bearer $TOKEN'

PUT /api/node/{node_id} ​

Modify Node

Update a node's details. Only accessible to sudo admins.

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Request body application/json · NodeModify

FieldTypeRequiredDescription
namestringno
addressstringno
portintegerno
api_portintegerno
usage_coefficientnumberno
agent_enabledbooleanno
ip_limit_enabledbooleanno
statusNodeStatusno
core_idstringno
json
{
  "address": "192.168.1.1",
  "api_port": 62051,
  "name": "DE node",
  "port": 62050,
  "status": "disabled",
  "usage_coefficient": 1.0
}

Response 200 Successful Response · NodeResponse

Response fields
FieldTypeDescription
namestring
addressstring
portinteger
api_portinteger
usage_coefficientnumber
agent_enabledboolean
ip_limit_enabledboolean
idinteger
xray_versionstring
statusconnected / connecting / error / disabled
messagestring
core_idstring
json
{
  "name": "string",
  "address": "string",
  "port": 62050,
  "api_port": 62051,
  "usage_coefficient": 1.0,
  "agent_enabled": true,
  "ip_limit_enabled": true,
  "id": 0,
  "xray_version": "string",
  "status": "connected",
  "message": "string",
  "core_id": "main"
}

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X PUT 'https://YOUR-PANEL/api/node/<node_id>' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"address": "192.168.1.1", "api_port": 62051, "name": "DE node", "port": 62050, "status": "disabled", "usage_coefficient": 1.0}'

DELETE /api/node/{node_id} ​

Remove Node

Delete a node and remove it from xray in the background.

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X DELETE 'https://YOUR-PANEL/api/node/<node_id>' \
  -H 'Authorization: Bearer $TOKEN'

PUT /api/node/{node_id}/extra ​

Put Node Extra

Save the node's extra settings (SSH access, VPS details, flags). Secrets are stored encrypted and are never returned.

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Request body application/json · NodeExtraIn

FieldTypeRequiredDescription
flagstringno
transportstringno
sshSSHInno
forget_sshbooleannoDefault: false.
json
{
  "flag": "",
  "transport": "string",
  "ssh": {
    "host": "",
    "port": 22,
    "username": "root",
    "auth": "password",
    "password": "",
    "private_key": "",
    "passphrase": "",
    "key_id": ""
  },
  "forget_ssh": false
}

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X PUT 'https://YOUR-PANEL/api/node/<node_id>/extra' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"flag": "", "transport": "string", "ssh": {"host": "", "port": 22, "username": "root", "auth": "password", "password": "", "private_key": "", "passphrase": "", "key_id": ""}, "forget_ssh": false}'

POST /api/node/{node_id}/install ​

Install Node

install Marzban-node and/or the agent on the VPS over SSH (runs in the background)

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Request body application/json · InstallIn

FieldTypeRequiredDescription
sshSSHInno
savebooleannoDefault: false.
nodebooleannoDefault: true.
agentbooleannoDefault: true.
json
{
  "ssh": {
    "host": "",
    "port": 22,
    "username": "root",
    "auth": "password",
    "password": "",
    "private_key": "",
    "passphrase": "",
    "key_id": ""
  },
  "save": false,
  "node": true,
  "agent": true
}

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/node/<node_id>/install' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"ssh": {"host": "", "port": 22, "username": "root", "auth": "password", "password": "", "private_key": "", "passphrase": "", "key_id": ""}, "save": false, "node": true, "agent": true}'

POST /api/node/{node_id}/install-xray ​

Install Node Xray Version

Install a chosen Xray-core version on the node over SSH (the node downloads the XTLS release itself). The current binary is kept as xray.old and put back if the new one doesn't run, so a node is never left without a working core.

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Request body application/json · NodeXrayVersionIn

FieldTypeRequiredDescription
versionstringyes
json
{
  "version": "string"
}

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/node/<node_id>/install-xray' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"version": "string"}'

POST /api/node/{node_id}/reconnect ​

Reconnect Node

Connect again now: a hanging attempt is dropped, not waited for

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/node/<node_id>/reconnect' \
  -H 'Authorization: Bearer $TOKEN'

POST /api/node/{node_id}/restart ​

Restart Node Core

restart the node's Xray (connects first if it isn't connected)

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/node/<node_id>/restart' \
  -H 'Authorization: Bearer $TOKEN'

POST /api/node/{node_id}/uninstall ​

Uninstall Node

remove everything Alexen put on the node's server (containers, firewall rules, tunnels, files) over SSH; other panels on it stay untouched

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/node/<node_id>/uninstall' \
  -H 'Authorization: Bearer $TOKEN'

POST /api/node/{node_id}/update-xray ​

Update Node Xray

give the node the panel's Xray (same version) over SSH and restart it

Sudo admin only

Parameters

NameInTypeRequiredDescription
node_idpathintegeryes

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/node/<node_id>/update-xray' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/nodes ​

Get Nodes

Retrieve a list of all nodes. Accessible only to sudo admins.

Sudo admin only

Response 200 Successful Response · NodeResponse[]

Response fields
FieldTypeDescription
namestring
addressstring
portinteger
api_portinteger
usage_coefficientnumber
agent_enabledboolean
ip_limit_enabledboolean
idinteger
xray_versionstring
statusconnected / connecting / error / disabled
messagestring
core_idstring
json
[
  {
    "name": "string",
    "address": "string",
    "port": 62050,
    "api_port": 62051,
    "usage_coefficient": 1.0,
    "agent_enabled": true,
    "ip_limit_enabled": true,
    "id": 0,
    "xray_version": "string",
    "status": "connected",
    "message": "string",
    "core_id": "main"
  }
]

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/nodes' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/nodes/extras ​

Nodes Extras

Extra settings of all nodes (secrets are masked).

Sudo admin only

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/nodes/extras' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/nodes/system ​

Nodes System

CPU, memory, disk, uptime and network speed of the master and every node

Sudo admin only

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/nodes/system' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/nodes/usage ​

Get Usage

Retrieve usage statistics for nodes within a specified date range.

Sudo admin only

Parameters

NameInTypeRequiredDescription
startquerystringno
endquerystringno

Response 200 Successful Response · NodesUsageResponse

Response fields
FieldTypeDescription
usagesNodeUsageResponse[]
json
{
  "usages": [
    {
      "node_id": 0,
      "node_name": "string",
      "uplink": 0,
      "downlink": 0
    }
  ]
}

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/nodes/usage' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/ssh-keys ​

List Ssh Keys

saved SSH keys (names + public keys only; private keys are never returned)

Sudo admin only

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X GET 'https://YOUR-PANEL/api/ssh-keys' \
  -H 'Authorization: Bearer $TOKEN'

POST /api/ssh-keys ​

Add Ssh Key

Save an SSH key in the key library (name, private key, optional passphrase). The private key is stored encrypted and never returned.

Sudo admin only

Request body application/json · SSHKeyIn

FieldTypeRequiredDescription
namestringno
private_keystringno
passphrasestringno
generatebooleannoDefault: false.
json
{
  "name": "",
  "private_key": "",
  "passphrase": "",
  "generate": false
}

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X POST 'https://YOUR-PANEL/api/ssh-keys' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "", "private_key": "", "passphrase": "", "generate": false}'

DELETE /api/ssh-keys/{key_id} ​

Delete Ssh Key

Delete a saved SSH key.

Sudo admin only

Parameters

NameInTypeRequiredDescription
key_idpathstringyes

Response 200 Successful Response

Errors: 401 Unauthorized, 403 Forbidden

bash
curl -X DELETE 'https://YOUR-PANEL/api/ssh-keys/<key_id>' \
  -H 'Authorization: Bearer $TOKEN'

Alexen v2.3.14 · 204 API endpoints