Merge remote-tracking branch 'origin/main' into codex/nodes-fleet-7342

This commit is contained in:
Hamed Sanaei
2026-12-03 03:09:40 +03:30
153 changed files with 12368 additions and 1621 deletions
+541 -52
View File
@@ -2114,6 +2114,16 @@
],
"nullable": true
},
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
},
"skipped": {
"example": [],
"items": {
@@ -2127,6 +2137,170 @@
],
"type": "object"
},
"BulkAttachResult": {
"description": "BulkAttachResult reports the outcome of a bulk attach across target inbounds.",
"properties": {
"attached": {
"items": {
"type": "string"
},
"type": "array"
},
"errors": {
"items": {
"type": "string"
},
"type": "array"
},
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
},
"skipped": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"attached",
"errors",
"skipped"
],
"type": "object"
},
"BulkCreateReport": {
"properties": {
"email": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"required": [
"email",
"reason"
],
"type": "object"
},
"BulkCreateResult": {
"description": "BulkCreateResult mirrors BulkAdjustResult for the create flow.",
"properties": {
"created": {
"type": "integer"
},
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
},
"skipped": {
"items": {
"$ref": "#/components/schemas/BulkCreateReport"
},
"type": "array"
}
},
"required": [
"created"
],
"type": "object"
},
"BulkDeleteReport": {
"properties": {
"email": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"required": [
"email",
"reason"
],
"type": "object"
},
"BulkDeleteResult": {
"description": "BulkDeleteResult mirrors BulkAdjustResult: total deleted plus per-email\nskip reasons when an email could not be processed.",
"properties": {
"deleted": {
"type": "integer"
},
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
},
"skipped": {
"items": {
"$ref": "#/components/schemas/BulkDeleteReport"
},
"type": "array"
}
},
"required": [
"deleted"
],
"type": "object"
},
"BulkDetachResult": {
"description": "BulkDetachResult reports the outcome of a bulk detach across target inbounds.",
"properties": {
"detached": {
"items": {
"type": "string"
},
"type": "array"
},
"errors": {
"items": {
"type": "string"
},
"type": "array"
},
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
},
"skipped": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"detached",
"errors",
"skipped"
],
"type": "object"
},
"BulkExternalLinksResult": {
"properties": {
"added": {
@@ -2149,6 +2323,48 @@
],
"type": "object"
},
"BulkSetEnableReport": {
"properties": {
"email": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"required": [
"email",
"reason"
],
"type": "object"
},
"BulkSetEnableResult": {
"properties": {
"changed": {
"type": "integer"
},
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
},
"skipped": {
"items": {
"$ref": "#/components/schemas/BulkSetEnableReport"
},
"type": "array"
}
},
"required": [
"changed"
],
"type": "object"
},
"Client": {
"description": "Client represents a client configuration for Xray inbounds with traffic limits and settings.",
"properties": {
@@ -2419,6 +2635,42 @@
],
"type": "object"
},
"ClientNodeApplyOutcome": {
"properties": {
"nodeId": {
"example": 7,
"type": "integer"
},
"reason": {
"example": "timeout",
"type": "string"
},
"status": {
"example": "pending",
"type": "string"
}
},
"required": [
"nodeId",
"status"
],
"type": "object"
},
"ClientNodeApplyResponse": {
"properties": {
"nodePending": {
"example": true,
"type": "boolean"
},
"nodeResults": {
"items": {
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
},
"type": "array"
}
},
"type": "object"
},
"ClientNodeUsage": {
"description": "ClientNodeUsage is one node's counters for a client since its last reset.",
"properties": {
@@ -10773,7 +11025,7 @@
],
"summary": "Create a new client and attach it to one or more inbounds in a single call. Body is JSON. Per-protocol secrets are generated server-side when omitted, so callers can send only the universal fields.",
"operationId": "post_panel_api_clients_add",
"description": "Client email must not be exactly `.` or `..`. Existing reserved-name clients can be read, renamed to a valid name, or deleted using the query-parameter /get, /update and /del aliases. Fields the server fills in when they are omitted — a valid value sent by the caller is never overwritten. Re-adding an email that already exists, with its stored `subId`, reuses the stored `id`, `password`, `auth` and `secret` instead of minting new ones, so the identity stays in sync across its inbounds.\n\n- **VLESS / VMess** — `id`, a fresh UUID\n- **Trojan** — `password`\n- **Shadowsocks** — `password`. On a `2022-blake3-*` inbound a supplied password that does not base64-decode to the key length of the cipher (16 or 32 bytes) is replaced by a generated key and the call still succeeds, so read the client back if you did not let the server pick. Legacy ciphers keep any non-empty password\n- **Hysteria** — `auth`\n- **mtproto** — `secret`, a FakeTLS secret derived from the fronting domain of the inbound, or from `www.cloudflare.com` when it has none\n- **WireGuard** — `privateKey` and `publicKey` when both are blank, or `publicKey` alone when only a `privateKey` was sent, plus `allowedIPs`: one free `/32` taken from the /24 the existing peers of that inbound already sit in, or from `10.0.0.0/24` when it has none\n\nAccepted on the same body but never generated: `preSharedKey` and `keepAlive` (WireGuard), `adTag` (mtproto).\n\nWireGuard is the only one of these that can fail. Allocation widens the search to the containing /16 before giving up with `inbound <id>: wireguard: no free address available in <scope>`, and an `allowedIPs` supplied by the caller is validated instead of allocated: `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of that same inbound holds, or `... used by a client on <inbound>` when the holder sits on another WireGuard or AmneziaWG inbound. Ranges are compared, not strings, so `10.0.0.9/24` collides with `10.0.0.5/32`; a `/0` entry collides with every address of its family another client holds, and only a `0.0.0.0/0` or `::/0` default route that is already stored (legacy peers) keeps nobody out. Allocation likewise skips every address inside a prefix another client holds. The same validation runs on POST /panel/api/clients/{email}/attach, where a client that already carries an address brings it along.\n\nAn `inboundIds` entry that names no existing inbound rejects the whole call before anything is written. Past that, the inbounds are applied concurrently and independently: one that fails no longer stops the others, so a `success:false` response can still have created the client on the rest. Every error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. `limitHwid` is applied only when every inbound succeeded, so re-run the call after fixing the failure.",
"description": "Client email must not be exactly `.` or `..`. Existing reserved-name clients can be read, renamed to a valid name, or deleted using the query-parameter /get, /update and /del aliases. Fields the server fills in when they are omitted — a valid value sent by the caller is never overwritten. Re-adding an email that already exists, with its stored `subId`, reuses the stored `id`, `password`, `auth` and `secret` instead of minting new ones, so the identity stays in sync across its inbounds.\n\n- **VLESS / VMess** — `id`, a fresh UUID\n- **Trojan** — `password`\n- **Shadowsocks** — `password`. On a `2022-blake3-*` inbound a supplied password that does not base64-decode to the key length of the cipher (16 or 32 bytes) is replaced by a generated key and the call still succeeds, so read the client back if you did not let the server pick. Legacy ciphers keep any non-empty password\n- **Hysteria** — `auth`\n- **mtproto** — `secret`, a FakeTLS secret derived from the fronting domain of the inbound, or from `www.cloudflare.com` when it has none\n- **WireGuard** — `privateKey` and `publicKey` when both are blank, or `publicKey` alone when only a `privateKey` was sent, plus `allowedIPs`: one free `/32` taken from the /24 the existing peers of that inbound already sit in, or from `10.0.0.0/24` when it has none\n\nAccepted on the same body but never generated: `preSharedKey` and `keepAlive` (WireGuard), `adTag` (mtproto).\n\nWireGuard is the only one of these that can fail. Allocation widens the search to the containing /16 before giving up with `inbound <id>: wireguard: no free address available in <scope>`, and an `allowedIPs` supplied by the caller is validated instead of allocated: `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of that same inbound holds, or `... used by a client on <inbound>` when the holder sits on another WireGuard or AmneziaWG inbound. Ranges are compared, not strings, so `10.0.0.9/24` collides with `10.0.0.5/32`; a `/0` entry collides with every address of its family another client holds, and only a `0.0.0.0/0` or `::/0` default route that is already stored (legacy peers) keeps nobody out. Allocation likewise skips every address inside a prefix another client holds. The same validation runs on POST /panel/api/clients/{email}/attach, where a client that already carries an address brings it along.\n\nAn `inboundIds` entry that names no existing inbound rejects the whole call before anything is written. Past that, the inbounds are applied concurrently and independently: one that fails no longer stops the others, so a `success:false` response can still have created the client on the rest. Every error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. `limitHwid` is applied only when every inbound succeeded, so re-run the call after fixing the failure.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"requestBody": {
"required": true,
"content": {
@@ -10830,12 +11082,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true,
"msg": "Client added"
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -10941,7 +11215,7 @@
],
"summary": "Update an existing client by email. Changes propagate to every attached inbound. Body is the JSON client payload: omitted fields keep their current values, and an explicit zero, empty or null value clears a field, except as noted below.",
"operationId": "post_panel_api_clients_update_email",
"description": "An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.",
"description": "An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"parameters": [
{
"name": "email",
@@ -10985,12 +11259,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true,
"msg": "Client updated"
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -11005,7 +11301,7 @@
],
"summary": "Update an existing client by email. Changes propagate to every attached inbound. Body is the JSON client payload: omitted fields keep their current values, and an explicit zero, empty or null value clears a field, except as noted below.",
"operationId": "post_panel_api_clients_update",
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.",
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"parameters": [
{
"name": "email",
@@ -11049,12 +11345,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true,
"msg": "Client updated"
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -11069,7 +11387,7 @@
],
"summary": "Delete a client by email. Removes it from every attached inbound and drops its traffic record unless keepTraffic=1 is passed.",
"operationId": "post_panel_api_clients_del_email",
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.",
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"parameters": [
{
"name": "email",
@@ -11104,12 +11422,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true,
"msg": "Client deleted"
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -11124,7 +11464,7 @@
],
"summary": "Delete a client by email. Removes it from every attached inbound and drops its traffic record unless keepTraffic=1 is passed.",
"operationId": "post_panel_api_clients_del",
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.",
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"parameters": [
{
"name": "email",
@@ -11159,12 +11499,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true,
"msg": "Client deleted"
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -11179,7 +11541,7 @@
],
"summary": "Attach an existing client to one or more additional inbounds. Body is JSON.",
"operationId": "post_panel_api_clients_email_attach",
"description": "A WireGuard client brings its stored `allowedIPs` into the new inbound instead of being given a fresh address, so the call fails with `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of the target inbound holds. Free the address on that inbound first — see POST /panel/api/clients/add for the full rule. Inbounds are applied independently, so the remaining ones are still attached and a `success:false` response can be partial.",
"description": "A WireGuard client brings its stored `allowedIPs` into the new inbound instead of being given a fresh address, so the call fails with `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of the target inbound holds. Free the address on that inbound first — see POST /panel/api/clients/add for the full rule. Inbounds are applied independently, so the remaining ones are still attached and a `success:false` response can be partial.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"parameters": [
{
"name": "email",
@@ -11233,11 +11595,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true
"success": true,
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -11252,7 +11637,7 @@
],
"summary": "Detach a client from one or more inbounds without deleting the client.",
"operationId": "post_panel_api_clients_email_detach",
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have detached the remaining inbounds. Detach writes nothing beyond the inbounds, so every error carries the prefix.",
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have detached the remaining inbounds. Detach writes nothing beyond the inbounds, so every error carries the prefix.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
"parameters": [
{
"name": "email",
@@ -11305,11 +11690,34 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"oneOf": [
{
"$ref": "#/components/schemas/ClientNodeApplyResponse"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
}
},
"example": {
"success": true
"success": true,
"obj": {
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
]
}
}
}
}
@@ -12083,6 +12491,7 @@
],
"summary": "Shift expiry and/or traffic quota for many clients in one call. addDays/addBytes may be negative. Clients with unlimited expiry (expiryTime=0) or unlimited traffic (totalGB=0) are skipped for the corresponding field — bulk extend never converts unlimited to limited. A client that was auto-disabled solely because it was depleted (expired or over quota) is automatically re-enabled — locally and on its node — when the adjustment lifts it out of depletion; a manually-disabled or still-depleted client is left disabled. The optional flow directive sets the XTLS flow on every client: \"none\" clears it, \"xtls-rprx-vision\"/\"xtls-rprx-vision-udp443\" set it where the inbound supports it (omit or \"\" to leave it unchanged). The optional limitHwid sets maximum registered devices (0 = unlimited). The optional adTag sets MTProto Telegram sponsor channel (\"none\" clears). Alternatively, send externalLinks to append external share links and http(s) subscriptions to each selected client in one transaction. This mode cannot be combined with other adjustments. Existing entries, metadata, and ordering are preserved. Duplicates match (kind, value) per client, including repeated input rows; the first entry wins. Missing clients are not written and appear in skipped. externalLinks.added counts inserted rows, externalLinks.skipped counts duplicate rows across found clients, externalLinks.errors counts missing clients, and adjusted counts clients receiving at least one new row. Validation or database failure aborts the whole append without writes. Repeating an append is idempotent and does not restart Xray.",
"operationId": "post_panel_api_clients_bulkAdjust",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12174,6 +12583,14 @@
"obj": {
"adjusted": 2,
"externalLinks": null,
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": []
}
}
@@ -12190,6 +12607,7 @@
],
"summary": "Enable many clients in one call. Emails are grouped by inbound and applied with a single read-modify-write per inbound; the running Xray (local or remote node) is updated to add each user. Note that enabling a client whose quota is exhausted or whose expiry has passed only flips the flag — the traffic loop will disable it again on the next tick. Returns the changed count and per-email skip reasons.",
"operationId": "post_panel_api_clients_bulkEnable",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12220,17 +12638,27 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"$ref": "#/components/schemas/BulkSetEnableResult"
}
}
},
"example": {
"success": true,
"obj": {
"changed": 2,
"changed": 0,
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": [
{
"email": "carol",
"reason": "client not found"
"email": "",
"reason": ""
}
]
}
@@ -12248,6 +12676,7 @@
],
"summary": "Disable many clients in one call. Emails are grouped by inbound and applied with a single read-modify-write per inbound; the running Xray (local or remote node) is updated to remove each user. Returns the changed count and per-email skip reasons.",
"operationId": "post_panel_api_clients_bulkDisable",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12278,17 +12707,27 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"$ref": "#/components/schemas/BulkSetEnableResult"
}
}
},
"example": {
"success": true,
"obj": {
"changed": 2,
"changed": 0,
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": [
{
"email": "carol",
"reason": "client not found"
"email": "",
"reason": ""
}
]
}
@@ -12306,6 +12745,7 @@
],
"summary": "Delete many clients in one call. The server processes the list sequentially so each delete sees the committed state of the previous one — avoids the race the per-email fan-out had on the panel side. Pass keepTraffic=true to retain the xray_client_traffic rows after deletion.",
"operationId": "post_panel_api_clients_bulkDel",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12337,17 +12777,27 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"$ref": "#/components/schemas/BulkDeleteResult"
}
}
},
"example": {
"success": true,
"obj": {
"deleted": 2,
"deleted": 0,
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": [
{
"email": "carol",
"reason": "client not found"
"email": "",
"reason": ""
}
]
}
@@ -12365,6 +12815,7 @@
],
"summary": "Create many clients in one call. Body is a JSON array of {client, inboundIds} payloads — the same shape /add accepts. Items are processed sequentially; per-email skip reasons are returned for items that fail (e.g., duplicate email). Triggers a single Xray restart at the end if any inbound was running.",
"operationId": "post_panel_api_clients_bulkCreate",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12416,17 +12867,27 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"$ref": "#/components/schemas/BulkCreateResult"
}
}
},
"example": {
"success": true,
"obj": {
"created": 2,
"created": 0,
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": [
{
"email": "alice@example.com",
"reason": "email already in use"
"email": "",
"reason": ""
}
]
}
@@ -12549,6 +13010,7 @@
],
"summary": "Attach many existing clients to many inbounds in one call. Each client keeps its identity (email/UUID/password/subId) and a shared traffic row; all clients are added to a target inbound in a single AddInboundClient call. Clients already present on a target are reported under skipped. Explicit email requests return per-email lists. Alternatively submit selection with explicit clientIds or a frozen allMatching scopeToken plus excludedClientIds and the search and group it was frozen under. Scoped requests start a background job and return {jobId}. Poll GET /bulkAttach/:id for counts or a stale-selection error. Newer IDs stay outside the frozen scope. Changes to the frozen membership are rejected before applying changes. Triggers a single Xray restart if any target inbound was running.",
"operationId": "post_panel_api_clients_bulkAttach",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12606,20 +13068,31 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"$ref": "#/components/schemas/BulkAttachResult"
}
}
},
"example": {
"success": true,
"obj": {
"attached": [
"alice",
"bob"
""
],
"errors": [
""
],
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": [
"bob"
],
"errors": []
""
]
}
}
}
@@ -12687,6 +13160,7 @@
],
"summary": "Mirror of bulkAttach: detach many existing clients from many inbounds in one call. For each email, intersects the client's current inbounds with the requested set and detaches from those only; (email, inbound) pairs where the client is not currently attached are silently no-ops. Emails not attached to any of the requested inbounds are reported under skipped. Client records are kept even if they become orphaned — use bulkDel for full removal. Returns per-email detached/skipped/errors lists and triggers a single Xray restart if any target inbound was running.",
"operationId": "post_panel_api_clients_bulkDetach",
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
"requestBody": {
"required": true,
"content": {
@@ -12741,18 +13215,31 @@
"msg": {
"type": "string"
},
"obj": {}
"obj": {
"$ref": "#/components/schemas/BulkDetachResult"
}
}
},
"example": {
"success": true,
"obj": {
"detached": [
"alice",
"bob"
""
],
"skipped": [],
"errors": []
"errors": [
""
],
"nodePending": true,
"nodeResults": [
{
"nodeId": 7,
"reason": "timeout",
"status": "pending"
}
],
"skipped": [
""
]
}
}
}
@@ -13620,7 +14107,7 @@
"tags": [
"Clients"
],
"summary": "Online client emails grouped by the panelGuid of the node that physically hosts each client. The local panel uses its own GUID; each node (at any depth in a chain) uses its GUID. Lets the inbounds page attribute online status to the real node instead of the intermediate one it syncs through.",
"summary": "Online client emails grouped by the panelGuid of the node that physically hosts each client. The local panel uses its own GUID; each node (at any depth in a chain) uses its GUID. An empty list means the node reported no online clients. An absent GUID means there is no usable report.",
"operationId": "post_panel_api_clients_onlinesByGuid",
"responses": {
"200": {
@@ -13705,7 +14192,7 @@
"tags": [
"Clients"
],
"summary": "Inbound tags that carried traffic within the heartbeat window, grouped by the hosting node's panelGuid. Pairs with onlinesByGuid so the inbounds page only marks a multi-inbound client online on the inbounds it actually used. Nodes that do not report per-inbound activity are absent.",
"summary": "Inbound tags that carried traffic within the heartbeat window, grouped by the hosting node's panelGuid. Use with onlinesByGuid to scope online counts. An empty list means no active tags, an absent GUID means there is no usable report, and null means a confirmed legacy node lacks the activity endpoint. The reserved NUL tag (U+0000) marks a partial report. Inbounds whose tags are absent remain unknown.",
"operationId": "post_panel_api_clients_activeInbounds",
"responses": {
"200": {
@@ -20062,8 +20549,10 @@
"type": "array",
"items": {
"type": "string"
}
}
},
"nullable": true
},
"description": "Empty lists mean no active tags, absent GUIDs mean no usable report, and null denotes legacy nodes without per-inbound activity. The reserved NUL tag (U+0000) marks a partial report. Unlisted inbounds stay unknown."
},
"lastOnlineMap": {
"type": "object",