EasyXrayEasyXray

Authentication

Two authentication modes are supported. UI sessions use a cookie set by the login endpoint. Programmatic clients (bots, scripts, remote panels) authenticate with a Bearer token taken from Settings → Security → API Token. Both work for every endpoint under /easyxray/api/v1/*.

POST
/login

Authorization

headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
username*string

Panel admin username.

password*string

Panel admin password.

twoFactorCode?string

OTP code when 2FA is enabled. Omit otherwise.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
curl -X POST "https://example.com/login" \  -H "Content-Type: application/json" \  -d '{    "username": "admin",    "password": "admin",    "twoFactorCode": "123456"  }'
{  "success": true,  "msg": "Logged in successfully"}
POST
/logout

Authorization

headerAuthorizationBearer <token>

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

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
curl -X POST "https://example.com/logout"
{  "success": true}
GET
/csrf-token

Authorization

headerAuthorizationBearer <token>

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

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
curl -X GET "https://example.com/csrf-token"
{  "success": true,  "obj": "csrf-token-string"}
GET
/sponsors

Authorization

headerAuthorizationBearer <token>

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

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?

SponsorList is the active sponsor set plus the contact link for new sponsors.

curl -X GET "https://example.com/sponsors"
{  "success": true,  "obj": {    "contact": "https://t.me/example",    "sponsors": [      {        "enable": true,        "from": "2026-10-01T00:00:00Z",        "id": "acme-2026-10",        "link": "https://acme.example/?utm_source=EasyXray",        "logo": "/sponsors/logo/acme.png",        "name": "Acme VPS",        "slots": [          ""        ],        "text": {},        "title": {},        "until": "2026-11-01T00:00:00Z"      }    ]  }}
POST
/getTwoFactorEnable

Authorization

headerAuthorizationBearer <token>

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

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?unknown
curl -X POST "https://example.com/getTwoFactorEnable"
{  "success": true,  "obj": false}