توکنهای API
مدیریت توکنهای Bearer برای احراز هویت برنامهنویسیشده (رباتها، پنلهای مرکزی که از طرف این نود عمل میکنند، CI). هر توکن یک نام یکتا و یک پرچم فعالسازی دارد — برای لغو بدون حذف، آن را غیرفعال کنید و برای لغو دائمی، آن را حذف کنید. توکنها به صورت هش SHA-256 ذخیره میشوند و متن خام تنها یکبار، در پاسخ ایجاد، بازگردانده میشود — پس از آن قابل بازیابی نیست، بنابراین همان موقع آن را کپی کنید. برای هر درخواست /panel/api/* یکی را به صورت <code>Authorization: Bearer <token></code> ارسال کنید — این توکن یک اعتبارنامهٔ مدیر کامل است.
AuthorizationBearer <token>Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
Successful response
application/json- response
success?booleanmsg?stringobj?unknowncurl -X GET "https://example.com/panel/api/setting/apiTokens"{ "success": true, "obj": [ { "id": 1, "name": "central-panel-a", "enabled": true, "createdAt": 1736000000, "scope": "node-admin", "expiresAt": 0 } ]}AuthorizationBearer <token>Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
application/json- body
name*stringHuman-readable label, e.g. "central-panel-a".
scope?stringadmin (default), monitor, node-sync, or node-admin. node-admin inherits node-sync and may also start a panel update.
"admin""monitor""node-sync""node-admin"expiresAt?integerFuture Unix milliseconds, or 0 for no expiry.
Successful response
application/json- response
success?booleanmsg?stringobj?curl -X POST "https://example.com/panel/api/setting/apiTokens/create" \ -H "Content-Type: application/json" \ -d '{ "name": "central-panel-a", "scope": "node-admin", "expiresAt": 1798761600000 }'{ "success": true, "obj": { "createdAt": 1736000000, "enabled": true, "expiresAt": 0, "id": 2, "name": "central-panel-a", "scope": "admin", "token": "new-token-string" }}AuthorizationBearer <token>Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
id*integerToken row ID.
application/json- body
expectedScope*stringStored scope expected by the operator.
Successful response
application/json- response
success?booleanmsg?stringobj?unknowncurl -X POST "https://example.com/panel/api/setting/apiTokens/delete/0" \ -H "Content-Type: application/json" \ -d '{ "expectedScope": "node-sync" }'{ "success": true}AuthorizationBearer <token>Scoped API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
id*integerToken row ID.
application/json- body
enabled*booleanNew enabled state.
expectedScope*stringStored scope expected by the operator.
Successful response
application/json- response
success?booleanmsg?stringobj?unknowncurl -X POST "https://example.com/panel/api/setting/apiTokens/setEnabled/0" \ -H "Content-Type: application/json" \ -d '{ "enabled": false, "expectedScope": "node-sync" }'{ "success": true}احراز هویت
دو حالت احراز هویت پشتیبانی میشود. نشستهای UI از یک کوکی استفاده میکنند که توسط نقطهپایانی ورود تنظیم میشود. کلاینتهای برنامهنویسیشده (رباتها، اسکریپتها، پنلهای راه دور) با یک توکن Bearer که از مسیر Settings → Security → API Token گرفته میشود احراز هویت میکنند. هر دو روش برای همهٔ نقاطپایانی زیر /panel/api/* کار میکنند.
ورودیها
مدیریت پیکربندیهای ورودی و کلاینتهای آنها. همهٔ endpointها زیر /panel/api/inbounds قرار دارند و به یک نشست واردشده یا توکن Bearer نیاز دارند. endpointهای تولیدکنندهٔ لینک تنها زمانی به هدرهای forwarded اعتنا میکنند که درخواست از یک پراکسی مورد اعتماد پیکربندیشده برسد.

3x-ui