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/*.
AuthorizationBearer <token>API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
application/json- body
username*stringPanel admin username.
password*stringPanel admin password.
twoFactorCode?stringOTP code when 2FA is enabled. Omit otherwise.
Successful response
application/json- response
success?booleanmsg?stringobj?unknowncurl -X POST "https://example.com/login" \ -H "Content-Type: application/json" \ -d '{ "username": "admin", "password": "admin", "twoFactorCode": "123456" }'{ "success": true, "msg": "Logged in successfully"}AuthorizationBearer <token>API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
Successful response
application/json- response
success?booleanmsg?stringobj?unknowncurl -X POST "https://example.com/logout"{ "success": true}AuthorizationBearer <token>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/csrf-token"{ "success": true, "obj": "csrf-token-string"}AuthorizationBearer <token>API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
Successful response
application/json- response
success?booleanmsg?stringobj?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" } ] }}AuthorizationBearer <token>API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.
Successful response
application/json- response
success?booleanmsg?stringobj?unknowncurl -X POST "https://example.com/getTwoFactorEnable"{ "success": true, "obj": false}
EasyXray