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
+13
View File
@@ -390,6 +390,19 @@ merged with GUID-based baselines to avoid double counting after resets.
`model.NodeClientTraffic`, `model.ClientGlobalTraffic` (cross-master totals).
A client reset is queued per hosting node in `model.NodePendingReset` (`service/node_reset_queue.go`)
and replayed by the node sync until the node accepts it.
Client mutations reserve node dispatch turns when their local transactions commit. The writer and
inbound mutex are released before dispatch waits. Conflicting inbounds are ordered, independent
inbounds can use any of four live slots on a node, and full deletion and reconciliation use an
exclusive node turn. Each live push waits up to four seconds for its turn and then receives up to
four seconds for the whole RPC batch. A saturated delta is left dirty for reconciliation. Full
deletions are stored in the transactional node outbox and retried until the direct peer confirms
deletion or absence. HTTP requests can also include validation, writer waits and multiple waves of
inbound work. A direct acknowledgment can report downstream work pending alongside these results.
Node traffic polls run independently within the shared worker limit. The publisher sums the latest
valid speed sample from every eligible node. Display samples expire after two five-second windows
and leave the cumulative counter baseline available for the next poll.
Periodic resets: `job/periodic_traffic_reset_job.go` (keyed off `Inbound.TrafficReset`).
Cross-panel totals are stored per master GUID and hosted email, separately from local
@@ -13,6 +13,18 @@ A checklist for the most common issues. When in doubt, raise the log level
- Make sure the **panel port isn't already in use** by another service.
- Verify the database path is writable (default `/etc/x-ui/x-ui.db`).
## Panel restart takes too long
The restart action acknowledges that a request was accepted. The service logs
successful completion once the panel and subscription listeners have both started.
A normal panel restart keeps the running Xray process. Each restart has a
75-second budget shared by both listener drains and the other shutdown and startup phases.
If a phase fails or overruns that budget, the panel exits with an error so its
supervisor can restart it. This recovery can interrupt Xray sessions. On a
systemd installation, inspect `journalctl -u x-ui` for the phase and elapsed
time. Use a supervisor configured to restart the service after failures.
## 502 / panel unreachable behind a proxy
- Confirm the panel is actually listening on the upstream port (e.g. `2053`).
@@ -8,7 +8,7 @@ The overview page combines a current server snapshot with short time-series char
## Choose a chart window
Each overview chart has the same time-range selector in its upper-right corner. The default is **2m**. The choices are **2m**, **5m**, **30m**, **1h**, **6h**, and **12h**. Changing any selector changes the window on every overview chart.
Use **Time range** beside **Xray Metrics** to change the window on every overview chart. The choices are **2m**, **5m**, **30m**, **1h**, **6h**, and **12h**. The default is **2m**. This browser remembers your selection for the panel across reloads and panel restarts.
The number of chart points stays capped at 60. Short windows use finer samples; longer windows use averages. At **2m** the charts are live: every status poll, once every 2 seconds, adds a point. A longer window is read from the server's stored history and refreshed once per point, at most once a minute.
+142 -29
View File
@@ -336,10 +336,9 @@ _openapi:
- depth: 2
title: 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.
url: '#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'
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.
url: '#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'
- depth: 2
title: Per-client source IPs grouped by the panelGuid of the node that observed
them. Lets the central panel attribute and enforce per-client IP limits
@@ -348,10 +347,12 @@ _openapi:
url: '#per-client-source-ips-grouped-by-the-panelguid-of-the-node-that-observed-them-lets-the-central-panel-attribute-and-enforce-per-client-ip-limits-using-the-real-visitor-ips-each-node-sees-instead-of-the-address-of-the-intermediate-panel-it-syncs-through'
- depth: 2
title: 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.
url: '#inbound-tags-that-carried-traffic-within-the-heartbeat-window-grouped-by-the-hosting-nodes-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'
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.
url: '#inbound-tags-that-carried-traffic-within-the-heartbeat-window-grouped-by-the-hosting-nodes-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-u0000-marks-a-partial-report-inbounds-whose-tags-are-absent-remain-unknown'
- depth: 2
title: Map of client email → last-seen unix timestamp.
url: '#map-of-client-email--last-seen-unix-timestamp'
@@ -681,21 +682,22 @@ _openapi:
id: list-the-emails-of-currently-connected-clients-last-seen-within-the-heartbeat-window-deduped-across-every-node
- content: 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.
id: 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
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.
id: 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
- content: Per-client source IPs grouped by the panelGuid of the node that
observed them. Lets the central panel attribute and enforce per-client
IP limits using the real visitor IPs each node sees, instead of the
address of the intermediate panel it syncs through.
id: per-client-source-ips-grouped-by-the-panelguid-of-the-node-that-observed-them-lets-the-central-panel-attribute-and-enforce-per-client-ip-limits-using-the-real-visitor-ips-each-node-sees-instead-of-the-address-of-the-intermediate-panel-it-syncs-through
- content: 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.
id: inbound-tags-that-carried-traffic-within-the-heartbeat-window-grouped-by-the-hosting-nodes-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
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.
id: inbound-tags-that-carried-traffic-within-the-heartbeat-window-grouped-by-the-hosting-nodes-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-u0000-marks-a-partial-report-inbounds-whose-tags-are-absent-remain-unknown
- content: Map of client email → last-seen unix timestamp.
id: map-of-client-email--last-seen-unix-timestamp
- content: Traffic counters for a client identified by email.
@@ -812,6 +814,16 @@ _openapi:
(`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.
For 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.
heading: 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
- content: Uses the same calendar and catch-up calculation as auto-renew in the
panel timezone. resetWeekday is 1 (Monday) to 7 (Sunday), 0 disables
@@ -823,7 +835,8 @@ _openapi:
preview is informational and does not reserve an allowance or
guarantee node availability.
heading: preview-client-auto-renewal-dates-without-saving-or-resetting-anything
- content: 'An omitted `flow` leaves every attached inbound on its own flow. Send
- content: >-
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.
@@ -834,9 +847,20 @@ _openapi:
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.'
place.
For 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.
heading: 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
- content: 'Query-parameter alias for the path endpoint. Use email=. or email=..
- content: >-
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`,
@@ -849,9 +873,20 @@ _openapi:
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.'
place.
For 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.
heading: 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-1
- content: 'The inbounds are applied concurrently and independently: one that
- content: >-
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
@@ -859,9 +894,20 @@ _openapi:
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.'
prefix and leaves the client already removed from every inbound.
For 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.
heading: delete-a-client-by-email-removes-it-from-every-attached-inbound-and-drops-its-traffic-record-unless-keeptraffic1-is-passed
- content: 'Query-parameter alias for the path endpoint. Use email=. or email=..
- content: >-
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
@@ -871,23 +917,55 @@ _openapi:
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.'
prefix and leaves the client already removed from every inbound.
For 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.
heading: delete-a-client-by-email-removes-it-from-every-attached-inbound-and-drops-its-traffic-record-unless-keeptraffic1-is-passed-1
- content: 'A WireGuard client brings its stored `allowedIPs` into the new inbound
- content: >-
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.'
attached and a `success:false` response can be partial.
For 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.
heading: attach-an-existing-client-to-one-or-more-additional-inbounds-body-is-json
- content: 'The inbounds are applied concurrently and independently: one that
- content: >-
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.'
beyond the inbounds, so every error carries the prefix.
For 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.
heading: detach-a-client-from-one-or-more-inbounds-without-deleting-the-client
- content: The original credentials remain the primary device. Additional devices
share their parent client email, traffic quota, expiry and enable
@@ -909,6 +987,41 @@ _openapi:
previously downloaded configuration loses access after the
configuration is applied.
heading: delete-an-additional-wireguard-device-and-release-its-address
- content: 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.
heading: shift-expiry-andor-traffic-quota-for-many-clients-in-one-call-adddaysaddbytes-may-be-negative-clients-with-unlimited-expiry-expirytime0-or-unlimited-traffic-totalgb0-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-visionxtls-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-https-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-externallinksadded-counts-inserted-rows-externallinksskipped-counts-duplicate-rows-across-found-clients-externallinkserrors-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
- content: 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.
heading: 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
- content: 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.
heading: 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
- content: 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.
heading: 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-keeptraffictrue-to-retain-the-xray_client_traffic-rows-after-deletion
- content: 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.
heading: 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-eg-duplicate-email-triggers-a-single-xray-restart-at-the-end-if-any-inbound-was-running
- content: 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.
heading: attach-many-existing-clients-to-many-inbounds-in-one-call-each-client-keeps-its-identity-emailuuidpasswordsubid-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-bulkattachid-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
- content: 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.
heading: mirror-of-bulkattach-detach-many-existing-clients-from-many-inbounds-in-one-call-for-each-email-intersects-the-clients-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-detachedskippederrors-lists-and-triggers-a-single-xray-restart-if-any-target-inbound-was-running
---
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
@@ -8,7 +8,7 @@ icon: ChartNoAxesCombined
## انتخاب بازهٔ نمودار
هر نمودار نمای کلی یک سلکت بازهٔ زمانی در گوشهٔ بالای سمت راست دارد. مقدار پیش‌فرض **2m** است. گزینه‌ها **2m**، **5m**، **30m**، **1h**، **6h** و **12h** هستند. تغییر بازه در هر نمودار، بازهٔ همهٔ نمودارهای نمای کلی را تغییر می‌دهد.
از گزینهٔ **بازهٔ زمانی** کنار **شاخص‌های Xray** برای تغییر بازهٔ همهٔ نمودارهای نمای کلی استفاده کنید. گزینه‌ها **2m**، **5m**، **30m**، **1h**، **6h** و **12h** هستند. مقدار پیش‌فرض **2m** است. مرورگر انتخاب شما را برای این پنل پس از بارگیری مجدد صفحه و راه‌اندازی دوبارهٔ پنل حفظ می‌کند.
تعداد نقطه‌های نمودار حداکثر ۶۰ نقطه است. بازه‌های کوتاه‌تر از نمونه‌های دقیق‌تر و بازه‌های بلندتر از میانگین نمونه‌ها استفاده می‌کنند. در بازهٔ **2m** نمودارها زنده‌اند: هر بار دریافت وضعیت، یعنی هر ۲ ثانیه، یک نقطه اضافه می‌کند. بازه‌های بلندتر از تاریخچهٔ ذخیره‌شده در سرور خوانده می‌شوند و به‌ازای هر نقطه یک بار، و حداکثر دقیقه‌ای یک بار، به‌روزرسانی می‌شوند.
+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",